List the Subscribed Numbers
GET Method
kaleyra.io allows you to list all the numbers subscribed by an account using this API.
Base URL
https://<api_domain>/v1/<SID>
API Domain and Value
api_domain | Value |
---|---|
IN pod | api.in.kaleyra.io |
SG Pod | api.ap.kaleyra.io |
EU Pod | api.eu.kaleyra.io |
API Request to List the Numbers Subscribed by a User
To get the list of numbers subscribed by a user on the kaleyra.io platform, use the <api_domain>/v1/<sid>/number/subscriptions
endpoint with the following request method:
Request Format
The following is the request format to get the list of numbers subscribed by a user on the kaleyra.io platform:
curl -X GET 'https://<api_domain>/v1/<sid>/number/subscriptions' \
-H 'api-key: <api-key>'
Sample Request Format
The following is the sample request format to get the list of numbers subscribed by a user on the kaleyra.io platform:
curl -X GET 'https://api.in.kaleyra.io/v1/HXAP16XXXXXX97IN/number/subscriptions' \
-H 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3'
URL Parameters and Headers
Following is the list of parameters and headers to send the API request:
Headers | Data Type | Description | Example | Mandatory? |
---|---|---|---|---|
sid | String | Account SID (Security Identifier). | HXAP16XXXXXX97IN | Yes |
api-key | String | API key generated from kaleyra.io account. | Axxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx3 | Yes |
Response Format
This section provides you the success and failure JSON response formats for different scenarios.
Success Response
The following success response is received when the JSON script has the correct syntax with status code 200 OK
:
{
"code": "CLE402",
"message": "Request executed successfully",
"data": [
{
"number": "918061xxxxxx",
"capabilities": [
"voice_out"
],
"iso_code": "IN",
"number_type": "Fixed Line",
"number_status": "Active",
"monthly_recurring_cost": 18.3532,
"setup_cost": 166.8471,
"start_date": "2024-08-13",
"end_date": "2024-11-11",
"subscription_id": "SG_faxxxxe1-9xx7-4xxc-axx1-83xxxxxxxx73",
"currency_code": "INR"
},
{
"number": "918061xxxxxx",
"capabilities": [
"voice_in",
"voice_out"
],
"iso_code": "IN",
"number_type": "Fixed Line",
"number_status": "Active",
"monthly_recurring_cost": 97.7688,
"setup_cost": 162.948,
"start_date": "2024-06-12",
"end_date": "2024-10-12",
"subscription_id": "SG_84xxxx48-7xxc-4xx3-axxc-d5xxxxxxxxf5",
"currency_code": "INR"
}
],
"total": 2,
"offset": "0",
"limit": "25",
"error": null
}
Failure Responses
The following failure responses are received when the JSON script has an incorrect syntax:
{
"code": "CLE404",
"status": 400,
"message": "Invalid Inputs, Validation Error.",
"error": {
"scalar": "The provided country code is invalid."
}
}
{
"code": "CLE404",
"status": 400,
"message": "Invalid Inputs, Validation Error.",
"error": {
"scalar": "The provided capability is invalid."
}
}
{
"code": "CLE404",
"status": 400,
"message": "Invalid Inputs, Validation Error.",
"error": {
"scalar": "The provided number type is invalid."
}
}
{
"code": "CLE404",
"status": 400,
"message": "Invalid Inputs, Validation Error.",
"error": {
"scalar": "The maximum limit allowed is 50."
}
}
{
"code": "RBC001",
"message": "Incorrect SID or API key.",
"data": [],
"error": {
"body": "Incorrect SID or API key.",
"error": "record not found"
}
}
{
"code": "RBC201",
"message": "Incorrect SID or API key.",
"data": [],
"error": {
"body": "Incorrect SID or API key.",
"error": "API Key Not Found"
}
}
Updated 7 days ago