Create a Customer
Create a customer.
Request URL
POST {base_url}/dm/open_api/v1/customers
Request parameters
Headers
BodyParameter | Required | Type | Description |
---|---|---|---|
Authorization | Yes | String | Pass the access token in the header. Format: Bearer {access_token}. |
Parameter | Required | Type | Description |
---|---|---|---|
firstName | Yes | String | First name. |
lastName | No | String | Last name. |
company | Yes | String | Company name. |
Yes | String | Email address. | |
businessNumber | No | String | Business number. |
mobileNumber | No | String | Mobile number. |
homeNumber | No | String | Home number. |
faxNumber | No | String | Fax number. |
zipCode | No | String | ZIP code. |
street | No | String | Street. |
city | No | String | City. |
state | No | String | State. |
country | No | String | Country. |
remark | No | String | Remark. |
Response parameters
Parameter | Type | Description |
---|---|---|
data | Object <Details> | The detailed information. |
requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
status | String | Request result:
|
time | Long | The response time. Note: The YCM API response returns a
timestamp, you can convert the timestamp to detailed
date and time as needed. For more information, see Convert Timestamp to Local Date and Time.
|
Details
Parameter | Type | Description |
---|---|---|
customerId | Long | The ID of the customer. |
Example
Request example
Create a customer.POST /dm/open_api/v1/customers HTTP/1.1
Host: ycm.yeastar.com
Authorization: Bearer eyJjdXN0b21Kd3RQYXlsb2FkSW5mbyI6eyJncmFudFR5cGUiOiJjbGllbnRfY3JlZGVudGlhbHMiLCJ5c0lkIjoxNzg5NjM2MDM5MDg1MDI1NjY0NSwidmVyc2lvbiI6MTY2Mzc0MTEyNSwicmVmcmVzaFZlcnNpb24iOjE2NjQyNjgyNjV9LCJzY29wZSI6WyJhbGwiXSwiZXhwIjoxNjY0MjcwMDY1LCJhdXRob3JpdGllcyI6WyJST0xFX0NMSUVOVCJdLCJqdGkiOiJjMzM3ZmM5ZS1iZGE0LTQ1NjItOGI5NS1hZTc1NzAxYmIwZjIiLCJjbGllbnRfaWQiOiJ5QXN4ZzdITkRFczNxSHprQk1aUU5Pblo2NTBPRUNNWSJ9.gPhOXaLMqZMZ57fcaF5hTAOrt65ABaW8ZEtHaFRfPw8
Content-Type: application/json
{
"firstName":"Leo",
"lastName":"Ball",
"company":"Example Company",
"email":"leo@example.com"
}
Response exampleHTTP/1.1 200 OK
{
"data": {
"customerId": 50429524
},
"requestId": "9482a20c695e81f5e9c60a0b360ed5f6",
"status": "Success",
"time": 1665561298
}