Create a Customer

HTTP method and endpoint

POST /api/v1/pbx/customers

Request parameters

Parameter Importance Type Description Restriction
company Required String Company name.
  • Maximum 99 characters.
  • The following characters are NOT allowed:

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

contactName Required String Contact name.
  • Maximum 63 characters.
  • The following characters are NOT allowed:

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

email Required String Email address.
  • Maximum 63 characters.
position Optional String Job title.
  • Maximum 31 characters.
  • The following characters are NOT allowed:

    &\"$<>'`|

cellphone Optional String Cell phone number.
  • Maximum 31 characters.
  • Only numbers and + - are allowed.
telephone Optional String Telephone number.
  • Maximum 31 characters.
  • Only numbers and + - are allowed.
fax Optional String Fax number.
  • Maximum 31 characters.
  • Only numbers and + - are allowed.
address Optional String Company address.
  • Maximum 255 characters.
  • The following characters are NOT allowed:

    &\"$<>'`|

remark Optional String Remark.
  • Maximum 255 characters.
  • The following characters are NOT allowed:

    &\"$<>'`|

externalId Optional String External ID.
  • Maximum 63 characters.
  • The following characters are NOT allowed:

    &\"$<>'`|

Examples

Request example

POST /api/v1/pbx/customers HTTP/1.1
Host: ympapi.yeastarcloud.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJsb2dpbl9uYW1lIjoiY2VjaWxpYUB5ZWFzdGFyLmNvbSIsInNjb3BlIjpbInRydXN0Il0sImV4cCI6MTU0NzAwMDA5NSwiYXV0aG9yaXRpZXMiOlsiUk9MRV9hZG1pbiJdLCJqdGkiOiIxZDNjZjU3Ny00YzNjLTRhMmMtYWM3OS00ZTc3ODAwMWFiMzQiLCJjbGllbnRfaWQiOiI5Nzg5OTNmMDk2YzQ0MTFmYTljYzgwZWUyZTYyZjFmMiJ9.IHh14j1Ro3HV6MWMjhFeHU1QTkQBc7lg4PVvKpifXnk
Content-Type: application/json
Cache-Control: no-cache

{
	"contactName": "Daisy",
	"company": "Yeastar",
	"email": "daisy909@gmail.com",
	"externalId": "",
	"position": "BD",
	"cellphone": "283793483",
	"telephone": "",
	"fax": "",
	"remark": "",
	"address": "Xiamen"
}

Response example

HTTP/1.1 200 OK
{
    "status": "Success",
    "customer": {
        "id": 170
    }
}