-
Notifications
You must be signed in to change notification settings - Fork 3
Product Category
Product Category API is to map which product belongs to which category. You need to prepare Category ID
and Product ID
data.
var appierRtCategoryIDs = ["ID3C","IDNotebook"];
var appierRtItemId = "productID1";
In this example, you could map product "productID1" belongs to category "IDNotebook"
For Product Category data, you could:
You can use the API to get all available product-category
resources you can upload product and category mapping info to. The result is the list of URLs with site IDs, for example "URL": "/api_upload/v1/product-category/demo.com.tw"
, that you can upload the product and category mapping info to that site ID, demo.com.tw
.
Name | Value |
---|---|
HTTP Method | GET |
URL | https://${AIXON-API-HOST}/api_upload/v1/product-category |
Example:
Request
curl -k -v "https://${AIXON-API-HOST}/api_upload/v1/product-category" \ -H "x-api-key: ${api-key}" \ -H "Content-Type: application/json; charset=utf-8"Response
{ "message": [ { "DESCRIPTION": "GET all product-category resources", "SUPPORT_METHODS": [ "GET" ], "URL": "/api_upload/v1/product-category" }, { "DESCRIPTION": "Upload product category mapping for demo.com.tw", "SUPPORT_METHODS": [ "PUT" ], "URL": "/api_upload/v1/product-category/demo.com.tw" } ], "status": "success" }
This API will update product and product category relationship based on resourceId
. The resourceId
refers to a tracking website.
Before you start to update product and category mapping, you should have the resourceId
(the siteid provided to you from Appier Technical Support team when you start to implement tracking tag in your website). If you don’t know the resourceId
, please contact your account manager.
Name | Value |
---|---|
HTTP Method | PUT |
URL | https://${AIXON-API-HOST}/api_upload/v1/product-category/${resourceId} |
Example:
Request
curl -k -v "https://${AIXON-API-HOST}/api_upload/v1/product-category/demo.com.tw" \ -H "x-api-key: ${api-key}" \ -H "Content-Type: application/json; charset=utf-8" \ -d '{ "header": ["category_id", "product_id"], "data": [ ["c001", "p001"], ["c002", "p002"], ["c003, 004", "p003"] ] }'Response
{ "message": { "RESOURCE_ID": "demo.com.tw", "STATUS": "RECEIVED" }, "status": "success" }
You can use PUT /product-category/{resouceId}
to update the product and category mapping. AIXON API supports CSV file upload or using JSON data to update product and category mapping. The following columns and orders are mandatory: category_id
, product_id
Here below is the example of a product category mapping for http request body in JSON format:
{
"header": ["category_id", "product_id"],
"data": [
["c001", "p001"],
["c002", "p002"],
["c003, 004", "p003"]
]
}
-
category_id
must be the lowest level of category_id in the resourceId’s category hierarchy. -
product_id
must be unique. -
product_id
can map to multiple category id, use,
to separate those ids and use"
to quote them.
Home | Copyright © 2017 Appier.com