List custom object records
client.customObject.list(stringentitySlug, CustomObjectListParams { limit, offset } query?, RequestOptionsoptions?): ObjectListResponse { data, object, totalCount }
GET/v1/objects/{entitySlug}
Returns a paginated list of records for the specified custom object type. 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. Use offset and limit to paginate through results, and $field query parameters to filter. See List endpoints for more information about pagination and filtering.
List custom object records
import Lightfield from 'lightfield';
const client = new Lightfield({
apiKey: 'My API Key',
});
const customObjects = await client.customObject.list('entitySlug');
console.log(customObjects.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
}