Skip to main content

List Collections

Method#

/catalogs/collection#

GET https://api.z-api.io/instances/{{instanceId}}/token/{{instanceToken}}/catalogs/collection

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

Using this method, you will be able to list the collections in your catalog.


Attributes#

Optional#

AttributesTypeDescription
nextCursorstringToken used for pagination of records

Request Params#

Example URL#

Method

GET https://api.z-api.io/instances/{{instanceId}}/token/{{instanceToken}}/catalogs/collection?nextCursor=CURSOR_VALUE


Response#

200#

AttributesTypeDescription
collectionsarray objectList with collection data
nextCursorstring or nullToken that defines the records of the next request

Object (collections)

AttributesTypeDescription
idstringCollection ID
namestringCollection name
statusstringCollection status (PENDING, APPROVED)

Example

{
"nextCursor": "AQHRi6eu3NyRTR30t5Sr2CtkURU7rMF_e2K7NPbELxJFAa-K_HI1I6v8_C3o2j6d4wve",
"collections": [
{
"id": "1072603710847740",
"name": "Collection Name",
"status": "PENDING"
},
{
"id": "902834786123343",
"name": "Collection Name 2",
"status": "APPROVED"
}
]
}

405#

In this case, ensure that you are sending the method specification correctly, i.e., check if you sent the POST or GET as specified at the beginning of this topic.

415#

If you receive a 415 error, make sure to add the "Content-Type" of the object you are sending in the request headers; in most cases, it should be "application/json".


Code#