List contacts in a list
client.list.listContacts(stringlistID, ListListContactsParams { limit, offset } query?, RequestOptionsoptions?): ListListContactsResponse { data, object, totalCount }
GET/v1/lists/{listId}/contacts
Returns a paginated list of contacts that belong to the specified list. Results are sorted by when the record was created in Lightfield (createdAt), newest first. Each page holds only the records you can currently read, so a page can contain fewer records than limit, or none, while more remain, and totalCount can include records you can no longer read. To read every record, keep advancing offset by limit until it reaches totalCount; do not stop at a short or empty page.
Required scopes: lists:read and contacts:read
Rate limit category: Search
List contacts in a list
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const listListContactsResponse = await client.list.listContacts('listId');
console.log(listListContactsResponse.data);{
"data": [
{
"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"
}
],
"object": "object",
"totalCount": 0
}Returns Examples
{
"data": [
{
"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"
}
],
"object": "object",
"totalCount": 0
}