External accounts¶
This endpoint provides the ability to manage External Accounts on your Customer accounts.
External accounts represent objects that are outside the telecom.center™ servers and are controlled by the operator. Each commercial account may have a unique External Account integration that allows the seamless combination of phone.systems™ PBX services with third-party operator services.
Important
External Accounts cannot be created or deleted by customers. A customer may only update allowed settings for an External Account that was provisioned to their account.
The following HTTP method(s) are available:
GET /external_account_routes - For Fetching External Accounts
POST /external_account_routes - For Creating an External Account
DELETE /external_account_routes/{id} - For Deleting an External Account
PATCH /external_account_routes/{id} - For Updating an External Account
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 |
available_did_number |
available_did_numbers |
To-one |
Yes |
DID number that will be used as external caller ID |
Important
Relationships can be used with include
and fields
parameters if the method supports it.
Creating an external account¶
Use the HTTP POST method to create an External Account:
POST
/api/rest/public/operator/external_account_routes
This method supports Sparse fieldsets and Inclusion of related resources
Important
If a valid available DID number relationship is included in this request, "allow_external_calls"
will be set to true
for this external account.
Request and Response examples:
http
POST /api/rest/public/operator/external_account_routes HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
{
"data": {
"id": "111444AA44",
"type": "external_account_routes",
"relationships": {
"customer": {
"data": {
"id": "123",
"type": "customers"
}
},
"available_did_number": {
"data": {
"id": "c31a684b-02e1-4311-8f61-34d8dac2758d",
"type": "available_did_numbers"
}
}
}
}
}
curl
curl -i -X POST https://api.telecom.center/api/rest/public/operator/external_account_routes -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "111444AA44", "relationships": {"available_did_number": {"data": {"id": "c31a684b-02e1-4311-8f61-34d8dac2758d", "type": "available_did_numbers"}}, "customer": {"data": {"id": "123", "type": "customers"}}}, "type": "external_account_routes"}}' --user username:password
response
HTTP/1.1 201 Created
Content-Type: application/vnd.api+json
{
"data": {
"id": "111444AA44",
"type": "external_account_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/external_account_routes/8578"
},
"attributes": {
"incoming_internal": false,
"incoming_external": false,
"outgoing_internal": false,
"outgoing_external": false,
"on_demand": false,
"caller_id_name": null,
"internal_caller_id": null,
"external_caller_id": "441174090316",
"allow_external_calls": true
}
}
}
Fetching external accounts¶
Use the HTTP GET method to retrieve a list of External Accounts:
GET
/api/rest/public/operator/external_account_routes
This method supports Sorting, Pagination, Sparse fieldsets and Inclusion of related resources
Other supported parameters:
Parameter |
Value |
Description |
---|---|---|
filter[id] |
External Account ID |
Used for filtering results by resource ID |
filter[customer.id] |
Customer ID |
Used for filtering results by Customer ID |
filter[external_caller_id] |
integer |
Used for filtering results by external caller ID |
filter[allow_external_calls] |
“true”,”false” |
Used for filtering results by allowed external calls |
Request and Response examples:
http
GET /api/rest/public/operator/external_account_routes HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
curl
curl -i -X GET https://api.telecom.center/api/rest/public/operator/external_account_routes -H "Content-Type: application/vnd.api+json" --user username:password
response
HTTP/2 200 OK
Content-Type: application/vnd.api+json
{
"data": [
{
"id": "123",
"type": "external_account_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/external_account_routes/123"
},
"attributes": {
"incoming_internal": false,
"incoming_external": false,
"outgoing_internal": false,
"outgoing_external": false,
"on_demand": false,
"caller_id_name": null,
"internal_caller_id": null,
"external_caller_id": "987654345678",
"allow_external_calls": true
}
},
{
"id": "111444AA44",
"type": "external_account_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/external_account_routes/8578"
},
"attributes": {
"incoming_internal": false,
"incoming_external": false,
"outgoing_internal": false,
"outgoing_external": false,
"on_demand": false,
"caller_id_name": null,
"internal_caller_id": null,
"external_caller_id": "441174090316",
"allow_external_calls": false
}
}
],
"meta": {
"record_count": 2
},
"links": {
"first": "https://api.telecom.center/api/rest/public/operator/external_account_routes?page%5Bnumber%5D=1&page%5Bsize%5D=50",
"last": "https://api.telecom.center/api/rest/public/operator/external_account_routes?page%5Bnumber%5D=1&page%5Bsize%5D=50"
}
}
Additionally, an External Account ID may be included in the request URL in order to retrieve the details of a specific External Account:
GET
/api/rest/public/operator/external_account_routes/{id}
Updating an external account¶
Use the HTTP PATCH method to update an External Account:
PATCH
/api/rest/public/operator/external_account_routes/{id}
This method supports Sparse fieldsets and Inclusion of related resources
Request and Response examples:
http
PATCH /api/rest/public/operator/external_account_routes/8578 HTTP/1.1
Host: api.telecom.center
Content-Type: application/vnd.api+json
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
{
"data": {
"id": "111444AA44",
"type": "external_account_routes",
"relationships": {
"available_did_number": {
"data": {
"id": "e22194fd-610b-4750-859b-3a77ea124b65",
"type": "available_did_numbers"
}
}
}
}
}
curl
curl -i -X PATCH https://api.telecom.center/api/rest/public/operator/external_account_routes/8578 -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"id": "111444AA44", "relationships": {"available_did_number": {"data": {"id": "e22194fd-610b-4750-859b-3a77ea124b65", "type": "available_did_numbers"}}}, "type": "external_account_routes"}}' --user username:password
response
HTTP/2 200 OK
Content-Type: application/vnd.api+json
{
"data": {
"id": "111444AA44",
"type": "external_account_routes",
"links": {
"self": "https://api.telecom.center/api/rest/public/operator/external_account_routes/8578"
},
"attributes": {
"incoming_internal": false,
"incoming_external": false,
"outgoing_internal": false,
"outgoing_external": false,
"on_demand": false,
"caller_id_name": null,
"internal_caller_id": null,
"external_caller_id": "441174090320",
"allow_external_calls": true
}
}
}
Deleting an external account¶
Use the HTTP DELETE method to delete an External Account:
DELETE
/api/rest/public/operator/external_account_routes/{id}
Request and Response examples:
http
DELETE /api/rest/public/operator/external_account_routes/e22194fd-610b-4750-859b-3a77ea124b65 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/external_account_routes/e22194fd-610b-4750-859b-3a77ea124b65 -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 an External Account with an empty response body.