PolicyCenter contacts
PolicyCenter provides endpoints that allow you to work directly with contact information.
Retrieve a contact
You can retrieve information for a single contact in PolicyCenter with the following endpoint:
- POST
/common/v1/search/contacts
In the request body, you must include information identifying the person or company contact you want to retrieve. The following attributes are required in the request:
- For a person, provide one the following:
- firstName and lastName
- taxId
- For a company, provide one of the following:
- companyName
- phoneNumber
This example retrieves the user named John Smith:
Command
POST /common/v1/search/contacts
Request
{
"data": {
"attributes": {
"lastName": "Smith",
"firstName": "John"
}
}
}
This example retrieves the company named Wright Construction:
{
"data": {
"attributes": {
"companyName": "Wright Construction"
}
}
}
Retrieve contact addresses
You can retrieve addresses for any contact in PolicyCenter with the following endpoints:
- GET
/common/v1/contacts/{contactId}/addresses
- GET
/common/v1/contacts/{contactId}/addresses/{addressId}
Before retrieving a contact address, you must first look up the contact ID, as shown in the previous section. After retrieving the contact ID, you can use that ID to retrieve addresses for the contact:
Command
GET /common/v1/contacts/pc:111/addresses
Response
{
"count": 1,
"data": [
{
"attributes": {
"CEDEX": "11",
"addressLine1": "1253 Paloma Ave",
"addressLine2": "Floor 0000",
"addressLine3": "Developer Unit Habitation Cube #0000",
"addressType": {
"code": "home",
"name": "Home"
},
"city": "Arcadia",
"country": "US",
"county": "San Mateo",
"description": "Created by the Address Builder with code 0",
"displayName": "1253 Paloma Ave, Floor 0000, Developer Unit Habitation Cube #0000, Arcadia, CA 91007",
"id": "pc:SfTQyhnk3er2MjBtSLIoD",
"postalCode": "91007",
"primary": true,
"state": {
"code": "CA",
"name": "California"
}
},
…
Destroy contact information
Destroying, or purging, is a form of data destruction that completely removes contact data from PolicyCenter. The Common API provides the following endpoints for data destruction actions on a contact:
- POST
/common/v1/contacts/{contactId}/destroy
- POST
/common/v1/contacts/{contactId}/do-not-destroy
For details on using these endpoints and more information on data destruction, see Destroying a contact