Routes¶
This endpoint allows managing routes on your domain and customers.
Routes are used to point call traffic to a specific termination gateway. They support RegEx rewrite and simple SRC/DST number rules that can be configured during the creation process or added later if your customers or domain uses multiple gateways.
Important
Your commercial account may be pre-configured with a system route that will be used by default for
customers with "termination_mode": system
and "termination_mode": system_customer
.
The following HTTP method(s) are available:
GET /termination_routes - For Fetching Routes
POST /termination_routes - For Creating a Route
DELETE /termination_routes/{id} - For Deleting a Route
PATCH /termination_routes/{id} - For Updating a Route
Relationship to other resources:
Name |
Resource Type |
Relationship Type |
Updatable |
Description |
---|---|---|---|---|
customer |
customers |
To-one |
No |
Parent customer’s ID that will include this route |
gateway |
gateways |
To-one |
Yes |
Gateway that this route will point the call traffic to |
Important
Relationships can be used with include
and fields
parameters if the method supports it.
Creating a Route¶
Use the HTTP POST method to create a new route.
POST
/api/rest/public/operator/termination_routes
This method supports Sparse fieldsets and Inclusion of related resources
Attributes:
Attribute |
Value |
Description |
Optional |
Controlled via UI |
---|---|---|---|---|
name |
string |
Route name |
No |
Yes, if allowed on commercial account |
src_prefix |
integer |
Source prefix that will take this route |
Yes, default is null |
Yes, if allowed on commercial account |
dst_prefix |
integer |
Destination prefix that will take this route |
Yes, default is null |
Yes, if allowed on commercial account |
src_rewrite_rule |
string |
Regex-based rewrite rule for SRC number |
Yes, default is null |
Yes, if allowed on commercial account |
src_rewrite_result |
string |
Regex-based result rule for SRC number |
Yes, default is null |
Yes, if allowed on commercial account |
dst_rewrite_rule |
string |
Regex-based rewrite rule for DST number |
Yes, default is null |
Yes, if allowed on commercial account |
dst_rewrite_result |
string |
Regex-based result rule for DST number |
Yes, default is null |
Yes, if allowed on commercial account |
Request and Response examples:
POST /api/rest/public/operator/termination_routes HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
{
"data": {
"type": "termination_routes",
"attributes": {
"name": "routename"
},
"relationships": {
"customer": {
"data": {
"id": "123",
"type": "customers"
}
},
"gateway": {
"data": {
"id": "7d952482-1bff-4401-9d46-63126c9bc69d",
"type": "termination_gateways"
}
}
}
}
}
curl -i -X POST https://api.telecom.center/api/rest/public/operator/termination_routes -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"name": "routename"}, "relationships": {"customer": {"data": {"id": "123", "type": "customers"}}, "gateway": {"data": {"id": "7d952482-1bff-4401-9d46-63126c9bc69d", "type": "termination_gateways"}}}, "type": "termination_routes"}}' --user username:password
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "e587ac76-45b2-45a4-b976-b57cff82e43d",
"type": "termination_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/termination_routes/e587ac76-45b2-45a4-b976-b57cff82e43d"
},
"attributes": {
"name": "routename",
"src_prefix": "string",
"dst_prefix": "string",
"src_rewrite_rule": "string",
"src_rewrite_result": "string",
"dst_rewrite_rule": "string",
"dst_rewrite_result": "string"
"operator": true
}
}
}
Note
The "operator"
attribute is used to differentiate the creator of a Termination Route. The "operator"
value is true
when the Termination Route was created via API or by telecom.center staff (system) and false
if it was created by Customers.
Fetching Routes¶
Use the HTTP GET method to retrieve a list of routes.
GET
/api/rest/public/operator/termination_routes
This method supports Sorting, Pagination, Sparse fieldsets and Inclusion of related resources
Other supported parameters:
Parameter |
Value |
Description |
---|---|---|
filter[id] |
Route ID |
Used for filtering results by resource ID |
filter[customer.id] |
Customer ID |
Used for filtering results by customer ID |
filter[name] |
Termination route’s name |
Used for filtering results by name |
Request and Response examples:
GET /api/rest/public/operator/termination_routes HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
curl -i -X GET https://api.telecom.center/api/rest/public/operator/termination_routes -H "Content-Type: application/vnd.api+json" --user username:password
HTTP/2 200 OK
Content-Type: application/vnd.api+json
{
"data": [
{
"id": "e587ac76-45b2-45a4-b976-b57cff82e43d",
"type": "termination_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/termination_routes/e587ac76-45b2-45a4-b976-b57cff82e43d"
},
"attributes": {
"name": "routename",
"src_prefix": "string",
"dst_prefix": "string",
"src_rewrite_rule": "string",
"src_rewrite_result": "string",
"dst_rewrite_rule": "string",
"dst_rewrite_result": "string"
"operator": true
}
},
{
"id": "a29e4de3-63d0-47ff-b098-8aaa9b4e34e1",
"type": "termination_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/termination_routes/a29e4de3-63d0-47ff-b098-8aaa9b4e34e1"
},
"attributes": {
"name": "Updated Route",
"src_prefix": "111",
"dst_prefix": "222",
"src_rewrite_rule": null,
"src_rewrite_result": null,
"dst_rewrite_rule": null,
"dst_rewrite_result": null
"operator": true
}
},
{
"id": "d39d7928-b16b-43fd-9e97-23c8ee625625",
"type": "termination_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/termination_routes/d39d7928-b16b-43fd-9e97-23c8ee625625"
},
"attributes": {
"name": "string",
"src_prefix": "string",
"dst_prefix": "string",
"src_rewrite_rule": "string",
"src_rewrite_result": "string",
"dst_rewrite_rule": "string",
"dst_rewrite_result": "string"
"operator": true
}
}
],
"meta": {
"record_count": 3
},
"links": {
"first": "https://api.telecom.center/api/rest/public/operator/termination_routes?page%5Bnumber%5D=1&page%5Bsize%5D=50",
"last": "https://api.telecom.center/api/rest/public/operator/termination_routes?page%5Bnumber%5D=1&page%5Bsize%5D=50"
}
}
The response body will contain an array of all routes.
Additionally, a route ID may be included in the request URL to retrieve the details of a specific route. Example below:
GET
/api/rest/public/operator/termination_routes/{id}
Updating a Route¶
Use the HTTP PATCH method to update a route.
PATCH
/api/rest/public/operator/termination_routes/{id}
This method supports Sparse fieldsets and Inclusion of related resources
Attributes:
Attribute |
Value |
Description |
Optional |
Controlled via UI |
---|---|---|---|---|
name |
string |
Route name |
No |
Yes, if allowed on commercial account |
src_prefix |
integer |
Source prefix that will take this route |
Yes, default is null |
Yes, if allowed on commercial account |
dst_prefix |
integer |
Destination prefix that will take this route |
Yes, default is null |
Yes, if allowed on commercial account |
src_rewrite_rule |
string |
Regex-based rewrite rule for SRC number |
Yes, default is null |
Yes, if allowed on commercial account |
src_rewrite_result |
string |
Regex-based result rule for SRC number |
Yes, default is null |
Yes, if allowed on commercial account |
dst_rewrite_rule |
string |
Regex-based rewrite rule for DST number |
Yes, default is null |
Yes, if allowed on commercial account |
dst_rewrite_result |
string |
Regex-based result rule for DST number |
Yes, default is null |
Yes, if allowed on commercial account |
Request and Response examples:
PATCH /api/rest/public/operator/termination_routes/71abaa93-e42f-4072-9f4f-6022ad1a7df9 HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
{
"data": {
"id": "71abaa93-e42f-4072-9f4f-6022ad1a7df9",
"type": "termination_routes",
"attributes": {
"name": "Different route"
}
}
}
curl -i -X PATCH https://api.telecom.center/api/rest/public/operator/termination_routes/71abaa93-e42f-4072-9f4f-6022ad1a7df9 -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"name": "Different route"}, "id": "71abaa93-e42f-4072-9f4f-6022ad1a7df9", "type": "termination_routes"}}' --user username:password
HTTP/2 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "71abaa93-e42f-4072-9f4f-6022ad1a7df9",
"type": "termination_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/termination_routes/71abaa93-e42f-4072-9f4f-6022ad1a7df9"
},
"attributes": {
"name": "Different route"
}
}
}
Deleting a Route¶
Use the HTTP DELETE method to delete a route.
DELETE
/api/rest/public/operator/termination_routes/{id}
Request and Response examples:
DELETE /api/rest/public/operator/termination_routes/71abaa93-e42f-4072-9f4f-6022ad1a7df9 HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
curl -i -X DELETE https://api.telecom.center/api/rest/public/operator/termination_routes/71abaa93-e42f-4072-9f4f-6022ad1a7df9 -H "Content-Type: application/vnd.api+json" --user username:password
HTTP/2 204 No Content
Content-Type: application/vnd.api+json
A successful deletion of a route will result with a HTTP status code 204 with an empty response body.