Create PBX

Create PBX #

Creates a new PbxConnectionProfile assigned to a Customer tenant.

POST /v1.0/customers/{CUSTOMER_TENANT_ID}/pbxs

Example #

This request will create a new ~.pbx.kazoo.name.~ PbxConnectionProfile with the following details:

  • Customer: Within the Customer tenant with id of {CUSTOMER_TENANT_ID}
  • Name: “Customers ~.pbx.kazoo.name.~ Pbx”
  • Host Rest: “https://rest.example.com
  • Host Websocket: “wss://ws.example.com”
  • Account Id: “12345”
  • API Key: “ABCDEF”

Request #

POST /api/v1.0/customers/{CUSTOMER_TENANT_ID}/pbxs HTTP/1.1
Content-Type: application/json
accept-charges: true
Authorization: Bearer {TOKEN}
Connection: keep-alive
{
    "name": "Customers ~.pbx.kazoo.name.~ Pbx",
 	"hostRest": "https://rest.example.com",
    "hostWebsocket": "wss://ws.example.com",
    "accountId": "12345",
    "apiKey": "ABCDEF",
    "_type": "KazooPbxConnectionProfile"
}

Response #

HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8
Content-Length: xx
Location: http://{SERVER}/api/v1.0/customers/{CUSTOMER_TENANT_ID}/pbxs/{PBX_ID}
{
	"data": {
 		"hostRest": "https://rest.example.com",
        "hostWebsocket": "wss://ws.example.com",
        "accountId": "12345",
        "apiKey": "ABCDEF",
        "_type": "KazooPbxConnectionProfile",
        "id": "{PBX_ID}",
        "name":" Customers ~.pbx.kazoo.name.~ Pbx",
        "tenantId": "{CUSTOMER_TENANT_ID}",
        "countryCode": "US",
        "enabled": false
	},
	"status": "success",
	"timestamp": "2019-11-29T16:03:23.9251680Z"
}

Errors #

Unauthorized #

When the token is not provided, invalid or expired

HTTP/1.1 401 Unauthorized

Bad Request #

When the provided tenant id is not in the correct format

HTTP/1.1 400 Bad Request
Date: Thu, 06 Feb 2020 12:45:27 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 149
{
	"error": 400,
	"message": "The value '<tenant id>' is not valid.",
	"status": "error",
	"timestamp": "2020-02-06T12:45:27.5903465Z"
}

Not Found #

When there are no Customers that have a matching tenant id

HTTP/1.1 404 Not Found
Date: Thu, 06 Feb 2020 12:46:58 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 95
{
	"error": 404,
	"message": "Not Found",
	"status": "error",
	"timestamp": "2020-02-06T12:46:58.7669535Z"
}