ຂໍ້ມູນສິນຄ້າ (Products)
API ນີ້ໃຊ້ເພື່ອດຶງລາຍການສິນຄ້າ ແລະ package ທີ່ສາມາດຈຳໜ່າຍໄດ້.
ເສັ້ນທາງ (Endpoint)
GET https://open-api.q23.co/termgame/{identify}/productsແທນທີ່ {identify} ດ້ວຍລະຫັດຂອງທ່ານ.
Example:
https://open-api.q23.co/termgame/therdy/products
https://open-api.q23.co/termgame/q23/productsHeader
| ຊື່ Header | ຈຳເປັນ | ຄຳອະທິບາຍ |
|---|---|---|
| agent-token | ✅ | ລະຫັດຜ່ານສຳລັບການຢືນຢັນ |
ຕົວຢ່າງ:
agent-token: agent_passwordຄຳຕອບ (Response)
ຖ້າສຳເລັດ ຈະໄດ້ຮັບ JSON ດັ່ງນີ້:
json
[
{
"id": "6822fd3b39f09234a919e348",
"name": "BIGO LIVE",
"payloadField": [
"user_id"
],
"agentPackages": [
{
"id": "6822fd3b39f09234a919e34a",
"name": "20 Diamonds",
"price": 9772
},
// ...more packages...
]
},
{
"id": "6822cea0624c06de72fd64d4",
"name": "Mobile Legends (ເຕີມໄດ້ທຸກເສີບ)",
"payloadField": [
"user_id",
"zone_id"
],
"agentPackages": [
{
"id": "6822cea0624c06de72fd64d6",
"name": "172 💎",
"price": 49999
}
// ...more packages...
]
}
]ລາຍລະອຽດຄ່າທີ່ຕອບກັບ
| ຊື່ຄ່າ | ປະເພດ | ຄຳອະທິບາຍ |
|---|---|---|
| id | string | ລະຫັດສິນຄ້າ |
| name | string | ຊື່ສິນຄ້າ |
| payloadField | string[] | ຟິວລທີ່ຕ້ອງໃສ່ເມື່ອສັ່ງຊື້ |
| agentPackages | array | ລາຍການ package ທີ່ສາມາດຈຳໜ່າຍໄດ້ |
agentPackages:
| ຊື່ຄ່າ | ປະເພດ | ຄຳອະທິບາຍ |
|---|---|---|
| id | string | ລະຫັດ package |
| name | string | ຊື່ package |
| price | number | ລາຄາ (ຈຳນວນເງິນ) |
ຕົວຢ່າງການໃຊ້ງານ
cURL
bash
curl -X GET \
'https://open-api.q23.co/termgame/your_identifier_here/products' \
-H 'agent-token: agent_password'JavaScript
javascript
fetch("https://open-api.q23.co/termgame/your_identifier_here/products", {
method: "GET",
headers: {
"agent-token": "agent_password",
},
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));