User infomation
1. API name
Test environment: https://up-oauth.pengpengla.com/getUserInfo
Product environment: https://gameopenapi.schirst.com/getUserInfo
2. Parameter description
Request method: GET
Upload parameter
Parameter | Necessary | Description |
---|---|---|
access_token | YES | Voucher for invoking open APIs |
open_id | YES | The unique of Funpepper user in application developed by developer. |
- Response
Parameter | Description |
---|---|
open_id | The unique of Funpepper user in application developed by developer |
username | user name |
gender | The user’s gender |
avatar | The user’s avatar |
country_code | The user’s country, such as CN, IN and US. |
uplive_code | unique id of user on Funpepper |
language | language code, such as zh-CN. the field is no value, so can be ignored. |
3. Request example
https://up-oauth.pengpengla.com/getUserInfo?access_token=ACCESS_TOKEN&open_id=OPENID |
Response:
- request successfully:
{ |
- request failed:
{ |
{ |
Check the number of diamond/gold in user account
Note: diamond is currency in game.
1. API name
diamond:
- Test environment: https://up-oauth.pengpengla.com/getDiamond
- Product environment: https://gameopenapi.schirst.com/getDiamond
gold:
- Test environment: https://up-oauth.pengpengla.com/getGold
- Product environment: https://gameopenapi.schirst.com/getGold
2. Parameter description
Request method:GET
Upload parameter
Parameter | Necessary | Description |
---|---|---|
access_token | YES | Voucher for invoking open APIs |
open_id | YES | The unique of Funpepper user in application developed by developer. |
- Response
Parameter | Description |
---|---|
diamond/gold | the diamond/gold amount of user’s account |
3. Request example
https://up-oauth.pengpengla.com/getDiamond?access_token=ACCESS_TOKEN&open_id=OPENID |
Response:
- Request successfully:
{ |
- Request failed:
{ |
{ |
Plus or minus diamond/gold to user account
1. API name
diamond:
- Test environment: https://up-oauth.pengpengla.com/changeDiamond
- Product environment: https://gameopenapi.schirst.com/changeDiamond
gold:
- Test environment: https://up-oauth.pengpengla.com/changeGold
- Product environment: https://gameopenapi.schirst.com/changeGold
2. Parameter description
- Request method: POST
- Upload parameter:
Parameter | Necessary | Description |
---|---|---|
access_token | YES | Voucher for invoking open APIs |
open_id | YES | The unique of Funpepper user in application developed by developer. |
order_id | YES | The unique order id created by invoker |
amount | YES | The amount of diamond |
op_type | YES | this field determine whether to plus or minus diamond to user. Detial: 1 plus, 2 minus |
game_id | YES | game id |
sign | YES | Transaction signature (letters in lowercase, signature method is shown in the following example) |
- Signature method
The purpose of signing transactions with client_secret is to enhance the security of the interface and prevent forgery transactions caused by access_token leakage.
The method of signature is to convert all parameters and their values in the request into URL format after sorting by parameter names, and then encrypt them with md5.
PHP demo:
$data["access_token"]="REPQYHEHP0GNP1WCLOS4BQ"; |
- Response
Parameter | Description |
---|---|
diamond | the amount of diamond |
3. Request example
Response:
- Request successfully:
{ |
- Request failed:
{ |
{ |
{ |
{ |
{ |
Check diamond/gold transaction order status
1. API name
diamond:
- Test environment: https://up-oauth.pengpengla.com/checkOrder
- Product environment: https://gameopenapi.schirst.com/checkOrder
gold:
- Test environment: https://up-oauth.pengpengla.com/checkGoldOrder
- Product environment: https://gameopenapi.schirst.com/checkGoldOrder
2. Parameter description
- Resquest method: GET
- Upload parameter
Parameter | Necessary | Description |
---|---|---|
access_token | YES | Voucher for invoking open APIs |
open_id | YES | the unique of Funpepper user in application developed by developer. |
order_id | YES | existent transaction order id |
op_type | YES | 1:puls 2:minus |
- Response
Parameter | Description |
---|---|
success | fixed boolean, true: transaction is successful |
3. Request example
Response:
- Request successfully:
{ |
- Request failed:
{ |
Appendix
error code
Code | Description |
---|---|
000001 | Server internal error |
000002 | Parameter error |
000003 | Order number is repeated |
000004 | The balance of diamond is not enough |
000005 | account are frozen and cannot be plused or minused diamond |
000006 | access_token is invalid or expired |
000007 | code is invalid |
000008 | Order number is not existent |
000009 | game api closed |
000010 | diamond amount too large |
error data format
{ |