The Contacts API helps you manage contacts and contact tags.
To use the Contacts API, you need an access token that you can get by authenticating with a user account or a service account.
The API scopes are contact and contact.read.
There are two types of contacts: "customer/client contacts" and "external message contacts" that refers to "LINE users" or "LINE WORKS users of other companies."
You can only create "customer/client contacts" using the Contacts API.
When creating a customer/client contact, you need to specify the contact access permission model (permission), which includes the contact master member ID (masterUserId) and the contact accessible range (accessibleRange). If accessibleRange is set to ALL, all members of a domain can access the contact.
You must also specify the contact name information (contactName), in which either lastName or firstName is required.
Additionally, either telephones or emails is required.
{ "permission": { "masterUserId": "userf7da-f82c-4284-13e7-030f3b4c756x", "accessibleRange": "ALL" }, "contactName": { "lastName": "Customer", "firstName": "Contact" }, "telephones": [ { "type": "CELLPHONE", "telephone": "1234-5678", "primary": true } ]}You can determine whether the returned contact is a "customer/client contact" or an "external message contact" by the external message contact ID (linkedExternalUser); if it is a "customer/client contact," linkedExternalUser is null, and if it is an "external message contact," linkedExternalUser and type have values other than null.
If the same "external message contact" is added to another user's contacts, it is treated as a different contact.
If the master of an "external message contact" changes, the user ID of the changed master is added to buddyUserIds.
{ "contactId": "81c6c568-e090-4d9e-549f-049dea60cbc7", "contactName": { "lastName": "Task", "firstName": "User" }, "linkedExternalUser": { "id": "32deb574-f7a9-4973-44c9-040944411275", "type": "WORKS", "buddyUserIds": [ "0c9cf0c3-83ba-48ed-10eb-043fcd624244" ] }...}You can manage contacts using the following API operations.
| HTTP request | Description |
|---|---|
| POST /contacts | Create a contact |
| GET /contacts | Get contacts |
| GET /users/{userId}/contacts | Get member accessible contacts |
| GET /contacts/{contactId} | Get a contact |
| PUT /contacts/{contactId} | Update a contact |
| PATCH /contacts/{contactId} | Update part of a contact |
| DELETE /contacts/{contactId} | Delete a contact |
| DELETE /contacts/{contactId}/forcedelete | Force delete a contact |
| POST /contacts/{contactId}/photo | Upload a contact photo |
| GET /contacts/{contactId}/photo | Get a contact photo |
| DELETE /contacts/{contactId}/photo | Delete a contact photo |
Tags are used to classify contacts.
Tags include a "company tag" that all members can access and a "user tag" that only the creator can access.
When creating a tag, specify the tag name (contactTagName).
{ "contactTagName": "Tag"}When getting a tag, you can determine if it is a "company tag" or "user tag" based on the value of type in the response.
{ "contactTagId": "ctag2a81-94b6-4642-6903-03aa7977da91", "contactTagName": "Company tag", "type": "COMPANY"}You can create a "company tag" using the following API operation.
| HTTP request | Description |
|---|---|
| POST /contact-tags | Create a company contact tag |
You can manage "user tags" using the following API operations.
| HTTP request | Description |
|---|---|
| POST /users/{userId}/contact-tags | Create a member specific contact tag |
| GET /users/{userId}/contact-tags | Get member accessible tags |
You can manage contact tags using the following API operations.
| HTTP request | Description |
|---|---|
| GET /contact-tags | Get contact tags |
| GET /contact-tags/{contactTagId} | Get a contact tag |
| PUT /contact-tags/{contactTagId} | Update a contact tag |
| PATCH /contact-tags/{contactTagId} | Update part of a contact tag |
| DELETE /contact-tags/{contactTagId} | Delete a contact tag |
| ## Manage contact custom properties {#manage-contact-custom-properties} |
A contact custom property is a field, such as a link, that can be additionally assigned to a contact. You can manage contact custom properties using the following API operations.
| HTTP request | Description |
|---|---|
| GET /contacts/custom-properties | Get contact custom properties |
| GET /contacts/custom-properties/{customPropertyId} | Get a contact custom property |
| POST /contacts/custom-properties | Add contact custom properties |
| PATCH /contacts/custom-properties/{customPropertyId} | Update a contact custom property |
| DELETE /contacts/custom-properties/{customPropertyId} | Delete a contact custom property |
You can add up to 5 contact custom properties per domain. If multivalued for a custom property is true, you can add up to 10 values for the property.
Types of custom properties include text and link. You can also specify whether each property can have a single value or multiple values.
You can set or get contact custom properties using the customProperties field of the Contacts API.
{ "contactId" : "12345678-abcd-abcd-abcd-1234567890ab", ... "customProperties": { "string_single": { "content" : "string_single_value" }, "string_multi": [ { "content": "string_multi_value1", "represent": true }, { "content": "string_multi_value2", "represent": false } ], "link_single" : { "text": "NAVER WORKS", "link": "https://woks.do" }, "link_multi" : [ { "text": "NAVER WORKS", "link": "https://works.do", "represent": true }, { "text": "Admin", "link": "https://admin.worksmobile.com", "represent" : false } ] }}