跳到主要内容

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
}
NoParameterTypeNote
1vgp_idlong (bigint)VGP identification
2server_idStringServer identification
3role_idStringRole ID
4timestamplong (bigint)Unix time
5transaction_idStringUnique transaction id
6item_id_xStringItem id
7count_xStringNumber of items
8checksumStringCheck 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

NoVariableTypeNote
1codeIntegerResult. 0 if successful. Otherwise, error
2error messangeStringError detail

Example

Request

POST http://fakeserver/get-role

Response

{
"code": 0,
"message": "OK"
}
{
"code": 1,
"message": "invalid giftcode"
}