Add Items API
*Add items API (Optional)
Description
Allow adding items for user by API
Request
Protocol
POST
URL
Partner sends to VGP this url
Content-Type
application/json
Parameter(s)
{
"vgp_id": vgp_id,
"server_id": server_id,
"role_id": role_id,
"timestamp" : timestamp,
"*transaction_id": transaction_id,
"items" :[
{"item_id": item_id_1, "quality": count_1},
{"item_id": item_id_2, "quality": count_2},
....
],
"checksum": checksum
}
| No | Parameter | Type | Note |
|---|---|---|---|
| 1 | vgp_id | long (bigint) | VGP identification |
| 2 | server_id | String | Server identification |
| 3 | role_id | String | Role ID |
| 4 | timestamp | long (bigint) | Unix time |
| 5 | transaction_id | String | Unique transaction id |
| 6 | item_id_x | String | Item id |
| 7 | count_x | String | Number of items |
| 8 | checksum | String | Check sum is calculated as below. |
md5 of below value {token}vgpid{vgp_id}server_id{server_id}role_id{role_id}transaction_id{transaction_id}tstamp{timestamp}
Response
Content-Type
application/json
Format
{
"code": [code],
"message": [error message]
}
in which
| No | Variable | Type | Note |
|---|---|---|---|
| 1 | code | Integer | Result. 0 if successful. Otherwise, error |
| 2 | error messange | String | Error detail |
Example
Request
POST http://fakeserver/get-role
Response
{
"code": 0,
"message": "OK"
}
{
"code": 1,
"message": "invalid giftcode"
}