Skip to main content
POST
/
v1.0
/
numbers
/
data-usage
json
{
  "ValueUnit": "MB",
  "NotifyValue": 10,
  "ThrottleValue": 15,
  "ThrottleSpeed": "1-mbps",
  "LimitValue": 20,
  "PhoneNumbers": [
    { "Number": "+12016093801" },
    { "Number": "+12232233180" }
  ]
}
curl -X POST https://api.telegent.com/v1.0/numbers/data-usage \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"ValueUnit": "MB",
"NotifyValue": 10,
"ThrottleValue": 15,
"ThrottleSpeed": "1-mbps",
"LimitValue": 20,
"PhoneNumbers": [
{ "Number": "+12016093801" },
{ "Number": "+12232233180" }
]
}'
import requests

url = "https://api.telegent.com/v1.0/numbers/data-usage"

payload = {
"ValueUnit": "MB",
"LimitValue": 20,
"PhoneNumbers": [{ "Number": "+12016093801" }],
"NotifyValue": 10,
"ThrottleValue": 15,
"ThrottleSpeed": "1-mbps"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ValueUnit: 'MB',
LimitValue: 20,
PhoneNumbers: [{Number: '+12016093801'}],
NotifyValue: 10,
ThrottleValue: 15,
ThrottleSpeed: '1-mbps'
})
};

fetch('https://api.telegent.com/v1.0/numbers/data-usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.telegent.com/v1.0/numbers/data-usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ValueUnit' => 'MB',
'LimitValue' => 20,
'PhoneNumbers' => [
[
'Number' => '+12016093801'
]
],
'NotifyValue' => 10,
'ThrottleValue' => 15,
'ThrottleSpeed' => '1-mbps'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.telegent.com/v1.0/numbers/data-usage"

payload := strings.NewReader("{\n \"ValueUnit\": \"MB\",\n \"LimitValue\": 20,\n \"PhoneNumbers\": [\n {\n \"Number\": \"+12016093801\"\n }\n ],\n \"NotifyValue\": 10,\n \"ThrottleValue\": 15,\n \"ThrottleSpeed\": \"1-mbps\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.telegent.com/v1.0/numbers/data-usage")
.header("Content-Type", "application/json")
.body("{\n \"ValueUnit\": \"MB\",\n \"LimitValue\": 20,\n \"PhoneNumbers\": [\n {\n \"Number\": \"+12016093801\"\n }\n ],\n \"NotifyValue\": 10,\n \"ThrottleValue\": 15,\n \"ThrottleSpeed\": \"1-mbps\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.telegent.com/v1.0/numbers/data-usage")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ValueUnit\": \"MB\",\n \"LimitValue\": 20,\n \"PhoneNumbers\": [\n {\n \"Number\": \"+12016093801\"\n }\n ],\n \"NotifyValue\": 10,\n \"ThrottleValue\": 15,\n \"ThrottleSpeed\": \"1-mbps\"\n}"

response = http.request(request)
puts response.read_body
{
  "Status": "Complete",
  "StatusMessage": "",
  "ValueUnit": "MB",
  "NotifyValue": 10,
  "ThrottleValue": 15,
  "ThrottleSpeed": "1-mbps",
  "LimitValue": 20,
  "PhoneNumbers": [
    {
      "Number": "+12016093801"
    },
    {
      "Number": "+12232233180"
    }
  ]
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}
{
"StatusCode": 123,
"Message": "<string>"
}

Body

application/json
ValueUnit
enum<string>
required

Unit of data measurement

Available options:
MB
Example:

"MB"

LimitValue
integer
required

Maximum data cap/limit

Example:

20

PhoneNumbers
object[]
required

Array of phone numbers to apply data limits to

NotifyValue
integer

Data usage threshold for subscriber notification

Example:

10

ThrottleValue
integer

Data usage threshold for speed throttling

Example:

15

ThrottleSpeed
enum<string>

Throttled speed limit

Available options:
1-mbps,
5-mbps,
20-mbps,
50-mbps,
100-mbps
Example:

"1-mbps"

Response

Data Usage Limit Set

The response is of type object.