Routes

This endpoint provides the ability to manage 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 sub-domain may be pre-configured with a termination route that will be used by default on all customer accounts.

The following HTTP method(s) are available:

Relationship to other resources:

Name

Resource Type

Relationship Type

Updatable

Description

customer

customers

To-one

No

Parent customer’s ID that will include this incoming trunk

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 SUB-DOMAIN

src_prefix

integer

Source prefix that will take this Route

Yes, default is null

Yes, if allowed on SUB-DOMAIN

dst_prefix

integer

Destination prefix that will take this Route

Yes, default is null

Yes, if allowed on SUB-DOMAIN

src_rewrite_rule

string

Regex-based rewrite rule for SRC number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

src_rewrite_result

string

Regex-based result rule for SRC number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

dst_rewrite_rule

string

Regex-based rewrite rule for DST number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

dst_rewrite_result

string

Regex-based result rule for DST number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

Request and Response examples:

http

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

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

response

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"
    }
  }
}

Retrieving 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:

http

GET /api/rest/public/operator/termination_routes HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=

curl

curl -i https://api.telecom.center/api/rest/public/operator/termination_routes -H 'Content-Type: application/vnd.api+json' --user username:password

response

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"
      }
    },
    {
      "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
      }
    },
    {
      "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"
      }
    }
  ],
  "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:

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 SUB-DOMAIN

src_prefix

integer

Source prefix that will take this Route

Yes, default is null

Yes, if allowed on SUB-DOMAIN

dst_prefix

integer

Destination prefix that will take this Route

Yes, default is null

Yes, if allowed on SUB-DOMAIN

src_rewrite_rule

string

Regex-based rewrite rule for SRC number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

src_rewrite_result

string

Regex-based result rule for SRC number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

dst_rewrite_rule

string

Regex-based rewrite rule for DST number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

dst_rewrite_result

string

Regex-based result rule for DST number

Yes, default is null

Yes, if allowed on SUB-DOMAIN

Request and Response examples:

http

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

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

response

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:

http

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

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

response

HTTP/2 204 No Content
Content-Type: application/vnd.api+json

The HTTP status code 204 will be the response after a successful deletion of a route with an empty response body.