Customers

This endpoint provides the ability to manage customers and their available limitations on your domain. 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:

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

Comment

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

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",
      "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}, "id": "123", "type": "customers"}}' --user username:password

response

HTTP/1.1 201 Created
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": "John Johnson",
      "language": "EN",
      "capacity_limit": 10,
      "sip_account_limit": 5
    }
  }
}

Retrieving 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 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://pbx2-sandbox.in.didww.com/api/rest/public/operator/customers/1"
      },
      "attributes": {
        "name": "Customer1",
        "language": "EN",
        "capacity_limit": null,
        "sip_account_limit": 99
      }
    },
    {
      "id": "10",
      "type": "customers",
      "links": {
        "self": "https://pbx2-sandbox.in.didww.com/api/rest/public/operator/customers/10"
      },
      "attributes": {
        "name": "Customer10",
        "language": "EN",
        "capacity_limit": null,
        "sip_account_limit": null
      }
    },
    {
      "id": "44",
      "type": "customers",
      "links": {
        "self": "https://pbx2-sandbox.in.didww.com/api/rest/public/operator/customers/44"
      },
      "attributes": {
        "name": "Customer44",
        "language": "EN",
        "capacity_limit": 6,
        "sip_account_limit": null
      }
    },
    {
      "id": "123",
      "type": "customers",
      "links": {
        "self": "https://pbx2-sandbox.in.didww.com/api/rest/public/operator/customers/123"
      },
      "attributes": {
        "name": "John Smith",
        "language": "EN",
        "capacity_limit": 0,
        "sip_account_limit": 0
      }
    },
    {
      "id": "6676",
      "type": "customers",
      "links": {
        "self": "https://pbx2-sandbox.in.didww.com/api/rest/public/operator/customers/6676"
      },
      "attributes": {
        "name": "Customer6676",
        "language": "EN",
        "capacity_limit": 99,
        "sip_account_limit": 1
      }
    }
  ],
  "meta": {
    "record_count": 5
  },
  "links": {
    "first": "https://pbx2-sandbox.in.didww.com/api/rest/public/operator/customers?page%5Bnumber%5D=1&page%5Bsize%5D=50",
    "last": "https://pbx2-sandbox.in.didww.com/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 as shown 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 update a customer’s available limitations when needed, or when any specific event has occurred on your hosted service that will have an impact on a 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

Comment

Optional

Controlled via UI

capacity_limit

Any integer

Capacity limitation

Yes

No

sip_account_limit

Any integer

SIP Account limitation

Yes

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

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

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, and there is no ability to restore the customer data.

The customer will no longer be able to access the UI. The deleted Customer ID may be reused to create a new customer. Deleted customers will no longer appear when retrieving 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