Customers

This endpoint provides the ability to manage customers and their available limitations on your account. You can create a customer for each registered user account on your hosted service and delete this entry when such account is closed.

Each customer contains their own set of resources and configuration that is isolated and independent from other customers.

The following HTTP method(s) are available:

Customer Settings

A variety of customer settings are supported that can be used according to your preference:

  • Capacity limitation - Used to apply a concurrent call limit. For more information refer to the Capacity Groups section.

  • SIP account limitation - Used to limit the amount of SIP accounts that can be created by the customer. This attribute may be interpretated as “Seat” limitation.

  • Termination mode - Used to specify the outbound call (termination) mode on a customer’s account. Each mode defines the type of termination gateways and routes that will be used. The following modes are available:

    • operator - The customer account will use termination gateways and routes created via API (operator: true).

    • operator_customer - The customer account will use termination gateways and routes created via API (operator: true), with ability to add their own gateways and routes (operator: false) that will work together.

    • system - The customer account will use termination gateways, pre-configured by the telecom.center™ staff, on your commercial account.

    • system_customer - The customer account will use termination gateways, pre-configured by the telecom.center™ staff, on your commercial account, with ability to add their own gateways and routes (operator: false) that will work together.

    • customer - The customer account will use termination gateways and routes created by the customer (operator: false). Outbound trunk configuration must be enabled on your commercial account.

Creating a Customer

Use the HTTP POST method to create a new customer.

POST

/api/rest/public/operator/customers

This method supports Sparse fieldsets

Attributes:

Attribute

Value

Description

Optional

Controlled via UI

name

Any string

Customer name

No

No

language

“EN”, ”RU”, “LT”, “LV”

Customer phone.systems UI language

Yes, default is EN

Yes

trm_mode

“customer”, “operator_customer”

Termination mode

Yes, default is set on commercial account

No

capacity_limit

Any integer

Capacity limitation

Yes, default is no limitation (null)

No

sip_account_limit

Any integer

SIP account limitation

Yes, default is no limitation (null)

No

Request and Response examples:

http

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

{
  "data": {
    "id": "123",
    "type": "customers",
    "attributes": {
      "name": "John Johnson",
      "language": "EN",
      "trm_mode": "operator",
      "capacity_limit": 10,
      "sip_account_limit": 5
    }
  }
}

curl

curl -i -X POST https://api.telecom.center/api/rest/public/operator/customers -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 10, "language": "EN", "name": "John Johnson", "sip_account_limit": 5, "trm_mode": "operator"}, "id": "123", "type": "customers"}}' --user username:password

response

HTTP/1.1 201 Created
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "12322",
    "type": "customers",
    "links": {
      "self": "https://api.telecom.center/api/rest/public/operator/customers/12322"
    },
    "attributes": {
      "name": "string",
      "language": "EN",
      "capacity_limit": 10,
      "sip_account_limit": 20,
      "trm_mode": "operator"
    }
  }
}

Fetching Customers

Use the HTTP GET method to retrieve a list of customers.

GET

/api/rest/public/operator/customers

This method supports Sorting, Pagination and Sparse fieldsets

Other supported parameters:

Parameter

Value

Description

filter[id]

integer

Used for filtering results by customer ID

Request and Response examples:

http

GET /api/rest/public/operator/customers 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/customers -H "Content-Type: application/vnd.api+json" --user username:password

response

HTTP/2 200 OK
Content-Type: application/vnd.api+json

{
  "data": [
    {
      "id": "1",
      "type": "customers",
      "links": {
        "self": "https://api.telecom.center/api/rest/public/operator/customers/1"
      },
      "attributes": {
        "name": "Customer1",
        "language": "EN",
        "capacity_limit": null,
        "sip_account_limit": 20,
        "trm_mode": "operator"
      }
    },
    {
      "id": "10",
      "type": "customers",
      "links": {
        "self": "https://api.telecom.center/api/rest/public/operator/customers/10"
      },
      "attributes": {
        "name": "Customer10",
        "language": "EN",
        "capacity_limit": null,
        "sip_account_limit": null,
        "trm_mode": "operator"
      }
    },
    {
      "id": "44",
      "type": "customers",
      "links": {
        "self": "https://api.telecom.center/api/rest/public/operator/customers/44"
      },
      "attributes": {
        "name": "Customer44",
        "language": "EN",
        "capacity_limit": 6,
        "sip_account_limit": null,
        "trm_mode": "operator_customer"
      }
    },
    {
      "id": "123",
      "type": "customers",
      "links": {
        "self": "https://api.telecom.center/api/rest/public/operator/customers/123"
      },
      "attributes": {
        "name": "John Smith",
        "language": "EN",
        "capacity_limit": 0,
        "sip_account_limit": 2,
        "trm_mode": "operator"
      }
    },
    {
      "id": "6676",
      "type": "customers",
      "links": {
        "self": "https://api.telecom.center/api/rest/public/operator/customers/6676"
      },
      "attributes": {
        "name": "Customer6676",
        "language": "EN",
        "capacity_limit": 99,
        "sip_account_limit": 20,
        "trm_mode": "operator_customer"
      }
    }
  ],
  "meta": {
    "record_count": 5
  },
  "links": {
    "first": "https://api.telecom.center/api/rest/public/operator/customers?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://api.telecom.center/api/rest/public/operator/customers?page%5Bnumber%5D=1&page%5Bsize%5D=50"
  }
}

Additionally, a customer ID may be included in the request URL to retrieve a specific customer. Example below:

GET

/api/rest/public/operator/customers/{id}

The response body will contain a single customer if the ID matches.

Updating a Customer

This method allows you to adjust available limitations to a customer when needed, or when triggered by a specific event on your hosted service which impacts the customer’s services in phone.systems™.

Use the HTTP PATCH method to update an existing customer.

PATCH

/api/rest/public/operator/customers/{id}

This method supports Sparse fieldsets

Attributes:

Attribute

Value

Description

Optional

Controlled via UI

capacity_limit

Any integer

Capacity limitation

Yes, default is no limitation (null)

No

sip_account_limit

Any integer

SIP account limitation

Yes, default is no limitation (null)

No

trm_mode

“operator”, “operator_customer”

Termination mode

Yes, default is set on commercial account

No

Request and Response examples:

http

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

{
  "data": {
    "id": "123",
    "type": "customers",
    "attributes": {
      "capacity_limit": 0,
      "sip_account_limit": 0,
      "trm_mode": "operator_customer"
    }
  }
}

curl

curl -i -X PATCH https://api.telecom.center/api/rest/public/operator/customers/123 -H "Content-Type: application/vnd.api+json" --data-raw '{"data": {"attributes": {"capacity_limit": 0, "sip_account_limit": 0, "trm_mode": "operator_customer"}, "id": "123", "type": "customers"}}' --user username:password

response

HTTP/2 200 OK
Content-Type: application/vnd.api+json

{
  "data": {
    "id": "123",
    "type": "customers",
    "links": {
      "self": "https://api.telecom.center/api/rest/public/operator/customers/123"
    },
    "attributes": {
      "name": "string",
      "language": "EN",
      "capacity_limit": 0,
      "sip_account_limit": 0,
      "trm_mode": "operator_customer"
    }
  }
}

Deleting a Customer

Use the HTTP DELETE method to delete a customer.

DELETE

/api/rest/public/operator/customers/{id}

This method will delete the customer, its related resources and call routing configuration.

Warning

This is a permanent action without the possibility to restore the customer data.

The customer will no longer be able to access the UI. The deleted customer ID may be re-used to create a new customer. Deleted customers will no longer appear when Fetching customers.

Request and Response examples:

http

DELETE /api/rest/public/operator/customers/123 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/customers/123 -H "Content-Type: application/vnd.api+json" --user username:password

response

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