Create a PBX

HTTP method and endpoint

POST /api/v1/pbx/instances

Request parameters

Parameter Importance Type Description Restriction
name Required String PBX name. The following characters are NOT allowed:

:!$\/#;[]"=<>^%{}`|

extension Required Integer The maximum number of extensions for the PBX. Only numbers are allowed.
concurrentCall Required Integer The maximum number of concurrent calls for the PBX. Only numbers are allowed.
recordingCapacity Optional Integer
  • The maximum recording time for the PBX.
  • Time Unit: minute.
  • If Call Recording is enabled, the recordingCapacity value should be larger than 500.
    Note: Each PBX has 500-minute recording time for free.
  • If Call Recording is disabled, the recordingCapacity is 0.
callRecording Required Boolean Is the Call Recording feature enabled or not.
  • false: Call Recording is disabled.
  • true: Call Recording is enabled.
versionId Required Integer The PBX version ID. Only numbers are allowed.
customerIds Required Array<Integer> The PBX customer(s).
  • Only numbers are allowed.
  • Maximum 3 customer IDs.
domain Required String PBX domain.
  • Only lowercase letters, numbers and . are allowed.
  • Must begin with a letter.
type Required String PBX Type. Permitted value:
  • trial
  • commercial
expireTime Optional String

The expiry date of PBX.

Configure this parameter when PBX type is set to trial.
Format: YYYY-MM-DD

Example: 2019-06-11

pbxApiAvailable Optional Integer If the PBX user has option to enable API feature on PBX web interface. Permitted value:
  • 1: API configuration page is displayed on PBX web interface, and PBX user has option to enable or disable API feature.
  • 0: PBX user has no option to enable API.
Note: If this parameter is not defined, the default value is 1.

Response parameters

Parameter Type Description
instance Object PBX instance.
sn String PBX Serial Number.
id Integer PBX ID.

Examples

Request example

POST /api/v1/pbx/instances HTTP/1.1
Host: ympapi.yeastarcloud.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbl9uYW1lIjoiY2VjaWxpYUB5ZWFzdGFyLmNvbSIsInNjb3BlIjpbInRydXN0Il0sImV4cCI6MTU0NzAxNDc4OSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9hZG1pbiJdLCJqdGkiOiJiYWYxN2Q2Ny03NGYzLTRlNjQtODMxMi0wYWM1ZTkyZmViZjAiLCJjbGllbnRfaWQiOiI5Nzg5OTNmMDk2YzQ0MTFmYTljYzgwZWUyZTYyZjFmMiJ9.KriN9QENpnb2Vy5qw_ktut4ONrPz-LYhPCxl58jGqSc
Content-Type: application/json
Cache-Control: no-cache
{
    "name": "apicreate001",
    "domain": "apicreate001",
    "customerIds": [52],
    "versionId": 164,
    "extension": 10,
    "concurrentCall":10,
    "recordingCapacity": 500,
    "callRecording": "true" ,
    "type":"trial",
    "expireTime":"2019-5-4",
    "pbxApiAvailable":0
}

Response example

HTTP/1.1 200 OK
{
    "status": "Success",
    "instance": {
        "id": 1421,
        "sn": "3682804SWHO345MJ"
    }
}