Use this method to get all the products in a collection.
Field | Type | Returned | Description |
method | String | Yes | "getCollectionProduct" |
id | String | Yes | Unique identifier for Collection. |
app_id | String | Yes | Unique identifier for App. |
reference | String | Optional | Unique identifier echoed from the request. |
Preconditions for API Functionality
The following table outlines the preconditions that must be met for the API to function correctly. Failure to meet these conditions may result in errors or unexpected behavior.
Condition | Description |
API must have "Manage Products" permission | The API needs "Manage Products" permission to manage products within the app. |
Response:
listCollectionsResponse
β
On success, the
getCollectionResponse
method is returned with an echo of the chat
object.Field | Type | Returned | Description |
method | String | Yes | "getCollectionProductResponse" |
app_id | String | Yes | Unique identifier for App. |
products | Array of Products | Yes | Products of the collection Object. |
reference | String | Optional | Unique identifier echoed from the request. |
SDK Mapping β getCollectionProduct
SDK | Request Method | Response Callback |
Java | api.getCollectionProduct(collectionId, appId, reference); | onCollectionProduct(GetProductCollectionResponse collectionProduct) |
JavaScript | api.getCollectionProduct(collectionId, appId, reference); | onCollectionProduct(collectionProduct) |
Python | napi.get_collection_product(collection_id=collection_id, app_id=app_id, reference=reference) | on_collection_product(self, msg_ack) |
Example
Request
json{ "method": "getCollectionProduct", "app_id": "90090684293000559", "id": 5121960361126208, "reference": "123456789" }
javaapi.getCollectionProduct("90092883286354862",Long.valueOf("90090684280184184") , 123456789l);
javascriptapi.getCollectionProduct("90092883286354862","90090684280184184","123456789");
pythonnapi.get_collection_product(collectionId=90092883286354862,app_id=90090684280184184,reference="123456789")
Response
json{ "method": "getCollectionProductResponse", "reference": "123456789", "products": [ { "image": [ { "width": 245, "url": "https:\/\/m1.nandbox.ca\/v1\/AUTH_137b624a8e434c4e88e9be30fa5e7bed\/g\/90090684293000559_e3d97c0341c287f1b7eea0e796aef6b06d6d324970d339723ea04948cbefe7db.jpg?temp_url_sig=48b6b9c06fbd1416e66652d3dbf15469efcb0ade&temp_url_expires=2060023536", "height": 275 } ], "business_channel_id": 90090684293000559, "price": 50.0, "name": "Green T-shirt", "id": 5121228327126172, "created_date": "2024-10-10 10:06:42", "category": "product", "app_id": 90090684293000559, "status": "A" }, { "image": [ { "width": 275, "url": "https:\/\/m1.nandbox.ca\/v1\/AUTH_137b624a8e434c4e88e9be30fa5e7bed\/g\/90090684293000559_d49bf44b803c69e05bf47a97c7928a97f722c5cd2cf2b1d1e7995223b6fbe7e2.jpg?temp_url_sig=7d2fa088e033f4c281a899954ad1614727fda69e&temp_url_expires=2060023381", "height": 275 } ], "business_channel_id": 90090684293000559, "price": 50.0, "name": "Red T-shirt", "id": 5121232097126213, "created_date": "2025-04-02 12:33:25", "category": "product", "app_id": 90090684293000559, "status": "A" }, { "image": [ { "width": 235, "url": "https:\/\/m1.nandbox.ca\/v1\/AUTH_137b624a8e434c4e88e9be30fa5e7bed\/g\/90090684293000559_b7010f02ed0d2a57ace1df2607986f0fa2a9ed3fff30caedcba7fa9c21a6451c.jpg?temp_url_sig=c5c3d17d11b1e5093552242cc62d1ff95c068cea&temp_url_expires=2059844191", "height": 275 } ], "business_channel_id": 90090684293000559, "price": 50.0, "name": "Black T-shirt", "id": 5121419845126176, "created_date": "2025-04-02 13:56:34", "category": "product", "app_id": 90090684293000559, "status": "A" } ] }