Retrieve a contact
client.contact.retrieve(stringid, RequestOptionsoptions?): ContactRetrieveResponse
GET/v1/contacts/{id}
Retrieves a single contact by its ID. A record you may see by name only is returned as { id, restricted: { name, reason } }, with no fields or relationships; check for restricted before reading them.
Required scope: contacts:read
Rate limit category: Read
Retrieve a contact
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const contactRetrieveResponse = await client.contact.retrieve('id');
console.log(contactRetrieveResponse);{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
],
"directions": {
"asDestination": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
},
"asSource": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
}
}
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"fields": {
"foo": {
"value": "string",
"valueType": "ADDRESS"
}
},
"httpLink": "httpLink",
"relationships": {
"foo": {
"cardinality": "cardinality",
"objectType": "objectType",
"values": [
"string"
],
"directions": {
"asDestination": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
},
"asSource": {
"cardinality": "HAS_ONE",
"values": [
"string"
]
}
}
}
},
"updatedAt": "updatedAt",
"externalId": "externalId"
}