Request
| Basic information | |
|---|---|
| HTTP URL | https://oapi.dingtalk.io/topapi/extcontact/update |
| HTTP Method | POST |
| Supported app types | appType-Internal app |
| Permissions required | permission-qyapi_ext_write-Write permission for external contacts |
Query parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| access_token | String | Yes | 6d1bxxxx | The app credential used to call this API. Obtain it through the API for getting the access_token of an internal app. |
Request body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
| contact | OpenExtContact | Yes | The external contact information. | |
| title | String | No | Development Engineer | The job title. |
| label_ids | Number[] | Yes | [1,2,3] | The tag list. Call the Get the external contact list API to query tag information. Refer to How to customize tag groups for an organization to add custom tags. A maximum of 20 labelIds can be passed per call. |
| share_dept_ids | Number[] | No | [420606536] | The IDs of departments to share with. Call the Get the sub-department ID list API to obtain them. A maximum of 20 department IDs can be passed per call. |
| address | String | No | Beijing | The address. |
| remark | String | No | Technical Lead | The alias. |
| follower_user_id | String | Yes | 023420013645 | The userId of the owner. |
| name | String | Yes | Zhang xx | The name of the external contact. |
| user_id | String | Yes | 123420013632 | The userId of the external contact. Call the Get the external contact list API to obtain it. |
| company_name | String | No | DingTalk | The organization name of the external contact. |
| share_user_ids | String[] | No | [“023420013644”] | The list of userids of employees to share with. A maximum of 20 labelIds can be passed per call. |
Request example
Response
Response body
| Name | Type | Example | Description |
|---|---|---|---|
| errcode | Number | 0 | The return code. |
| request_id | String | 8n3mksu5hqzy | The request ID. |
Response body example
Error codes
If an error occurs when you call this API, look up a solution in the Global error codes document based on the error message.| Error code (errcode) | Error message (errmsg) | Solution |
|---|---|---|
| 33009 | Invalid tokenGrantType | Check whether the access_token is correct. |
| 40036 | Empty parameter | Check whether all required parameters are filled in. |
| 40003 | Invalid userId | Check whether the userId is correct. |
| 60112 | Invalid user name | Check whether the user name is correct. |
| 60121 | The corresponding user is not found | Check whether the user information is correct. |
| 60204 | A label is required for the external contact | Fill in the label_ids for the external contact. |
| 43007 | Permission required | Check whether the access_token has the permission to perform this operation. |
| 60103 | Invalid mobile number | Check whether the mobile number is correct. |
| 60200 | The external contact already exists | Check whether the external contact information is correct. |
| 60203 | The number of external contacts exceeds the limit | Remove some external contacts. |
| -1 | System busy | Try again later. |