Add a Phonebook

Add a new phonebook.

Request URL

POST {base_url}/{api_path}/phonebook/create?access_token={access_token}

Request parameters

Table 1.
Parameter Required Type Description
name Yes String Phonebook name.
member_select No String Member selection method.
Valid value:
  • sel_all: Select all company contacts.
  • sel_specific: Select specific company contacts.
add_contacts_id_list No Array<Integer> The ID(s) of the company contact(s) to be added into the phonebook.
Note:

Response parameters

Table 2.
Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
id Integer The unique ID of the phonebook.

Examples

Request example

POST /openapi/v1.0/phonebook/create?access_token=ZzB1UpneFiGbHm7saIpmF8GJ7jVIgu8T HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json

{
    "name": "api-test",
    "member_select":"sel_specific",
    "add_contacts_id_list": [
       3,4
    ]
    
}

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "id": 6
}