Create a Colleague
Create a colleague.
Request URL
POST {base_url}/user/openapi/user/v1/colleagues
Request parameters
- Headers
-
Parameter Required Description Content-Type Yes Specify the type of data that is sent in the body of the POST request. Valid value:
application/json.User-Agent Yes Provide information about the user agent, such as the type of web browser, operating system, software version, etc., so as to help Yeastar Partner Portal to identify the user or the application that is making the request. Example:
User-Agent: OpenAPI.Authorization Yes Pass the access token in the header, so as to authenticate the API request. Format: Bearer {access_token}.
- Body parameters
-
Parameter Required Type Description yeastarId Yes String Yeastar ID (email address). resourceIds Yes Array The IDs of the permissions to be assigned to the colleague. Note: You can query permission IDs using the Query User Permission interface.ownerId No String The unique ID of the user for whom you want to create the colleague account. Note:- To create a colleague account for yourself, do not pass this parameter.
- To create a colleague account for a subordinate user, obtain subordinate user's ID using the Query Subordinate User List interface.
firstName No String First name. Note: EitherfirstNameorlastNameis required.lastName No String Last name. Note: EitherfirstNameorlastNameis required.remark No String Remark. isRmUser No Integer Whether to assign the RM role to the colleague, allowing the colleague to manage PBXs associated with the account in Yeastar Central Management. Valid value:0: No1: Yes
Response parameters
| Parameter | Type | Description |
|---|---|---|
| code | String | The response message of the API request. |
| detailMessage | String | The detailed error information. When the request is successful, this parameter returns empty. |
| requestId | String | The unique ID of the request, which can be used to quickly locate the request. |
| result | String | The unique ID of the newly created colleague. |
| status | Integer | The HTTP status code of the API request. |
Example
Request example
POST /user/openapi/user/v1/colleagues HTTP/1.1 Host: openapi.partner.yeastar.com Content-Type: application/json User-Agent: OpenAPI Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicmVzMSJdLCJYLU1TLVVTRVIiOiJ7XCJleHByXCI6XCIwXCIsXCJ0eXBlXCI6XCJwYXJ0bmVyXCIsXCJ1Y0lkXCI6XCIzMDc2OTE1NDU0NDY4NzY3NzQ0XCIsXCJ1c2VyQ29kZVwiOlwiUGFydG5lclwiLFwidXNlcklkXCI6XCIzMDc2OTE1NDU0NDg5NzM5MjY0XCIsXCJ1c2VybmFtZVwiOlwicGFydG5lcmV4YW1wbGVAb3V0bG9vay5jb21cIn0iLCJ1c2VyX25hbWUiOiJwYXJ0bmVyZXhhbXBsZUBvdXRsb29rLmNvbSIsInNjb3BlIjpbImFsbCJdLCJleHAiOjE3Mzk3MTc5MjYsInRva2VuX3R5cGUiOiJvcGVuYXBpIiwianRpIjoidmlzMkh0QkxaUStNQmxPbS9UdThWR1pyNFljPSIsImF1dGhvcml0aWVzIjpbIjc5Il0sImNsaWVudF9pZCI6IjE0NDI5NjM2ODBiMjM0YjA0YmRjZDVjMTZmODcyOWQ2In0.RPRoTJRkXCB4krDSwGRpUFyCfUVv2LHjIiBICA1pCiY { "yeastarId": "leo@example.com", "firstName": "Leo", "lastName": "Ball", "remark": "Test from docs team", "resourceIds": [ "8", "10", "18", "19", "20", "405", "22", "407", "409", "29", "30", "31", "32", "33", "34", "291", "292", "293", "295", "297", "43", "44", "45", "315", "316", "318", "319", "320", "321", "328", "329", "330", "331", "205", "334", "207", "210", "214", "215", "216", "344", "217", "218", "219", "220", "221", "222", "226", "227", "483", "484", "229", "365", "366", "367", "369", "373", "374", "383" ], "isRmUser": 0 }Response example
{
"code": "success",
"detailMessage": "",
"requestId": "aa862cd7985f49598344bf47769f5d97",
"result": "3535577337929203712",
"status": 200
}