v2.product.get_attribute_tree
GET /api/v2/product/get_attribute_tree
Get the attribute tree for categories
Đường dẫn Endpoint
URL: https://partner.shopeemobile.com/api/v2/product/get_attribute_tree
Tham số chung
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| partner_id | int | 1 | Partner ID được gán khi đăng ký thành công. Bắt buộc cho tất cả các yêu cầu. |
| timestamp | timestamp | 1610000000 | Dùng để chỉ định thời gian của yêu cầu. Bắt buộc cho tất cả các yêu cầu. Hết hạn sau 5 phút. |
| access_token | string | c09222e3fc40ffb25fc947f738b1abf1 | Token truy cập API, dùng để xác định quyền của bạn đối với API. Có thể sử dụng nhiều lần và hết hạn sau 4 giờ. |
| shop_id | int | 600000 | Mã định danh duy nhất của Shopee cho một cửa hàng. Tham số bắt buộc cho hầu hết các API. |
| sign | string | e318d3e932719916a9f9ebb57e2011961bd47abfa54a36e040d050d8931596e2 | Signature generated by partner_id, api path, timestamp, access_token, shop_id and partner_key via HMAC-SHA256 hashing algorithm. More details: https://open.shopee.com/documents?module=87&type=2&id=58&version=2 |
Tham số Request
| Tên | Kiểu | Bắt buộc | Mẫu | Mô tả |
|---|---|---|---|---|
| category_id_list | int[] | True | max count is 20 | |
| language | string | False | "en" | Language Support Lanuage: "SG": [ "en", "zh-Hans", "ms" ], "MY": [ "en", "zh-Hans", "ms" ], "PH": [ "en", "zh-Hans" ], "VN": [ "vn", "en" ], "ID": [ "id", "en" ], "TH": [ "th", "en" ], "BR": [ "pt-BR", "en" ], "MX": [ "es-MX", "en" ], "CO": [ "es-CO", "en" ], "CL": [ "es-CL", "en" ], "TW": [ "zh-Hant", "zh-Hans", "en" ], "IN": [ "en", "hi" ] |
Tham số Response
| Tên | Kiểu | Mẫu | Mô tả |
|---|---|---|---|
| error | string | Error | |
| message | string | Message | |
| warning | string | Warning | |
| request_id | string | Request ID | |
| response | object | Resopnse | |
| list | object[] | Each result corresponds to one category in category_ids | |
| attribute_tree | object[] | One category's attribute trees | |
| attribute_id | int | ID thuộc tính | |
| mandatory | boolean | true | Is mandatory or not |
| name | string | Attribute Name | |
| attribute_value_list | object[] | All available values for this attribute | |
| value_id | int | Value ID | |
| name | string | Value name | |
| value_unit | string | Value unit | |
| child_attribute_list | object[] | Child attributes for the value of parent attribute The structure content is the same as attribute_tree | |
| multi_lang | object[] | Translate results for display | |
| language | string | Language | |
| value | string | Translate result | |
| attribute_info | object | Attribute extra info | |
| input_type | int | SINGLE_DROP_DOWN = 1 SINGLE_COMBO_BOX = 2 FREE_TEXT_FILED = 3 MULTI_DROP_DOWN = 4 MULTI_COMBO_BOX = 5 | |
| input_validation_type | int | VALIDATOR_NO_VALIDATE_TYPE = 0 VALIDATOR_INT_TYPE = 1 VALIDATOR_STRING_TYPE = 2 VALIDATOR_FLOAT_TYPE = 3 VALIDATOR_DATE_TYPE = 4 | |
| format_type | int | FORMAT_NORMAL = 1 FORMAT_QUANTITATIVE_WITH_UNIT = 2 | |
| date_format_type | int | YEAR_MONTH_DATE = 0 (DD/MM/YYYY) YEAR_MONTH = 1 (MM/YYYY) | |
| attribute_unit_list | string[] | Attribute's available units list | |
| max_value_count | int | Max selected value count | |
| introduction | string | Introduction for special Attribute | |
| is_oem | boolean | ||
| support_search_value | boolean | Indicates whether this attribute has searchable values. If yes, please call v2.product.search_attribute_value_list to get the default values | |
| multi_lang | object[] | Attribute translate info | |
| language | string | Language | |
| value | string | Translate result | |
| category_id | int | ID danh mục | |
| warning | string | Warning msg |
Unirest.setTimeouts(0, 0); HttpResponse<String> response = Unirest.get("https://open.admin.uat.shopee.io/api/v2/product/get\_attribute\_tree?access\_token=access\_token&category\_ids=1234,5678&language=en&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp") .asString();<?php $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://open.admin.uat.shopee.io/api/v2/product/get\_attribute\_tree?access\_token=access\_token&category\_ids=1234,5678&language=en&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'Content-Type: application/json' ), )); $response = curl_exec($curl); curl_close($curl); echo $response; curl --location --request GET 'https://open.admin.uat.shopee.io/api/v2/product/get\_attribute\_tree?access\_token=access\_token&category\_ids=1234,5678&language=en&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp' import requests url = "https://open.admin.uat.shopee.io/api/v2/product/get\_attribute\_tree?access\_token=access\_token&category\_ids=1234,5678&language=en&partner\_id=partner\_id&shop\_id=shop\_id&sign=sign×tamp=timestamp" payload={} headers = { } response = requests.request("GET",url,headers=headers, data=payload, allow_redirects=False) print(response.text)
], "multi_lang": [ { "language": "-", "value": "-" } ] } ], "attribute_info": { "input_type": 0, "input_validation_type": 0, "format_type": 0, "date_format_type": 0, "attribute_unit_list": [ "-" ], "max_value_count": 0 }, "multi_lang": [ { "language": "-", "value": "-" } ] } ], "category_id": 0 } ] } }