API List

Test environment: https://up-oauth.pengpengla.com/
Production environment: https://gameopenapi.futureliveapp.com/

I. Common APIs

1. Get user information

  • path: /getUserInfo

  • Request method: GET

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
  • Response parameters
Parameter Description
open_id User’s unique identifier
username Username
gender User gender; 1 = male, 2 = female, 0 = unknown
avatar User avatar
country_code User’s two-letter country code
uplive_code User upliveCode, unique
language User client language code, e.g. zh-CN
  • Request example
https://up-oauth.pengpengla.com/getUserInfo?access_token=ACCESS_TOKEN&open_id=OPENID
  • Response:

    • Request successful:

      {
      avatar: "http://p.cdn.upliveapps.com/uplive/p/u/2018/9/11/5038085.jpg",
      country_code: "CN",
      gender: 1,
      language: "",
      open_id: "101015150d5e4e40445b755f5445",
      uplive_code: "zt2a92l6",
      username: "USERNAME"
      }


    • Request failed or processing error

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000006",
      "errmsg":"access_token invalid"
      }

2. Anti-fraud

  • path: /getUserIsPay

  • Request method: GET

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
platform Yes Platform: 1 = Android, 2 = iOS
  • Response parameters
Parameter Description
userIsPay Whether the user has recharged
isShow Whether to show recharge
  • Request example
https://up-oauth.pengpengla.com/getUserIsPay?access_token=ACCESS_TOKEN&open_id=OPENID&platform=1
  • Response:

    • Request successful:

      {
      "userIsPay": true,
      "isShow": true
      },


3. Game redeem gifts

  • path: /sendActivityGift

  • Request method: POST

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
game_id Yes Unique game identifier, assigned by Uplive
order_id Yes Local order ID
giftIdList Yes Reward gift ID list [1,2,3]
sign Yes MD5 of access_token=&client_secret=&game_id=&open_id=&order_id= with the above fields and values
  • Response parameters
Parameter Description
limitGiftIdList List of gifts that have reached the limit
  • Request example
https://up-oauth.pengpengla.com/sendActivityGift?access_token=ACCESS_TOKEN&open_id=OPENID&game_id=GAMEID&order_id=ORDERID&giftIdList=[1]&sign=SIGN
  • Response:

    • Request successful:

      {
      "limitGiftIdList": [2,4]
      },


4. Game redeem gift list

  • path: /getActivityGiftList

  • Request method: GET

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
game_id Yes Unique game identifier, assigned by Uplive
language Yes Language
  • Response parameters
Parameter Description
redeemGiftList Gift list
  • Request example
https://up-oauth.pengpengla.com/getActivityGiftList?access_token=ACCESS_TOKEN&open_id=OPENID&game_id=GAMEID&language=LANGUAGE
  • Response:

    • Request successful:

      {
      "redeemGiftList": [
      {
      "exchangeAllLimit": 0,
      "exchangeSingleLimit": 0,
      "giftCount": 1, // number of gifts to send
      "giftExp": 1, // gift validity in days
      "giftId": 9, // gift ID
      "giftName": "Blue Rose EN", // gift multilingual name
      "giftWorth": 10, // gift value
      "smallUrl": "https://g-cdn.upliveapp.com/oauthgame/9_1_1634885492_small.png" // gift image
      },
      ]
      }


U Diamond mode

1. Get user’s current U Diamond balance

  • path: /getDiamond

  • Request method: GET

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
  • Response parameters
Parameter Description
diamond U Diamond amount
  • Request example *

    https://up-oauth.pengpengla.com/getDiamond?access_token=ACCESS_TOKEN&open_id=OPENID
  • Response:

    • Request successful:

      {
      "diamond" : 300
      }


    • Request failed or processing error

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000006",
      "errmsg":"access_token invalid"
      }

2. Add or deduct U Diamonds

  • path: /changeDiamond

  • Request method: POST

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
order_id Yes Order ID (generated by caller, must be unique); unique transaction identifier
amount Yes Amount of U Diamonds to add or deduct in this transaction
op_type Yes Add or deduct: 1 = add, 2 = deduct
game_id Yes Game ID
sign Yes Transaction signature (lowercase letters; see signing example below)
constitute No When adding diamonds, composition parameters if diamonds are added due to using props (game vouchers) in a bet (see example below)
  • Signing method

    Use client_secret to sign the transaction to improve API security and prevent forged transactions if access_token is leaked.

    Sign by sorting all request parameters and values by parameter name, converting to URL format, then MD5 hashing.

    PHP example:

    $data["access_token"]="REPQYHEHP0GNP1WCLOS4BQ";
    $data["open_id"]="4f4f57524d0607011e1931164c47494345785c4c";
    $data["order_id"] = "5bee7c70ef716";
    $data["amount"]=20;
    $data["op_type"]=1;
    $data["game_id"]=1;
    $data["client_secret"] ="qv5pz3289lgpcqlwho3accb";
    //sort param keys
    ksort($data);
    //form key/value to url format
    $url_param = http_build_query($data);
    //result: $url_param = access_token=REPQYHEHP0GNP1WCLOS4BQ&amount=20&client_secret=qv5pz3289lgpcqlwho3accb&game_id=1&op_type=1&open_id=4f4f57524d0607011e1931164c47494345785c4c&order_id=5bee7c70ef716
    return md5($url_param);
  • constitute example
    flowType 31: add diamonds from bet using voucher
    flowType 1: add diamonds from bet deduction

    [{"flowType":"31","amount":50},{"flowType":"1","amount":50}]
  • Response parameters

Parameter Description
diamond U Diamond balance
  • Request example

  • Response:

    • Request successful:

      {
      "diamond" : 300
      }
    • Request failed

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000003",
      "errmsg":"order no exist"
      }
      {
      "errno":"000004",
      "errmsg":"insufficient money"
      }
      {
      "errno":"000005",
      "errmsg":"user frozen"
      }
      {
      "errno":"000006",
      "errmsg":"access_token invalid"
      }

3. Query diamond order (confirm whether order executed successfully)

  • path: /checkOrder

  • Request method: GET

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
order_id Yes Order ID (generated by caller, must be unique); unique transaction identifier
op_type Yes 1 = add-diamond order, 2 = deduct-diamond order
  • Response parameters
Parameter Description
success Indicates order executed successfully
  • Request example
  • Response:

    • Request successful:

      {
      "success" : true
      }


    • Request failed

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000008",
      "errmsg":"order not exist"
      }

4. Use game voucher

  • path: /packDescProp

  • Request method: POST

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
order_id Yes Order ID (generated by caller, must be unique); unique transaction identifier
game_id Yes Game ID
sign Yes Signature
gifts Yes Gifts / items
  • gifts example

    [{"giftId":PROP_ID,"amount":1}]
  • Response parameters

Parameter Description
success Indicates execution succeeded
  • Request example
  • Response:

    • Request successful:

      {
      "success" : true
      }


    • Request failed

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000008",
      "errmsg":"order not exist"
      }

5. User game voucher list

  • path: /packQueryProp

  • Request method: GET

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
  • Response parameters
Parameter Description
success Indicates execution succeeded
data Voucher list
data[].beginTime No actual value returned; always null
data[].expValue Experience value
data[].expireTime Expiration timestamp in seconds
data[].gridId No actual value returned; always null
data[].privateJson No actual value returned; always null; platform config field
data[].type Prop type; always 0
  • Request example
  • Response:

    • Request successful:

      {
      "data": [{
      "amount": 500,
      "beginTime": null,
      "code": 0,
      "createTime": 1668047861,
      "expValue": 1,
      "expireTime": 1682325542,
      "goodsId": 2211101,
      "gridId": null,
      "intro": "Game voucher (description, English)",
      "name": "Game voucher (English)",
      "privateJson": null,
      "propId": 2211101,
      "resources": null,
      "type": 0,
      "updateTime": 1669174626,
      "valuable": null,
      "valuableDiamond": 100
      }],
      "success": true
      }


    • Request failed

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000008",
      "errmsg":"order not exist"
      }

6. Send gifts — batch

  • path: /gift/send

  • Request method: POST

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
game_id Yes Game ID
order_id Yes Order ID, must be unique
transaction_id Yes Deduct-diamond transaction order ID (order ID from deduct-diamond API); each deduct-diamond order ID can only be used once for send gift and cannot be reused
sign Yes Transaction signature (lowercase letters; see signing example below)
gift_maps Yes JSON key: gift ID, value: gift count; demo: {“12”:1, “101”:1}
  • Signing method

    Use client_secret to sign the transaction to improve API security and prevent forged transactions if access_token is leaked.

    Sign by sorting all request parameters and values by parameter name, converting to URL format, then MD5 hashing.

    PHP example:

    $data["access_token"]="REPQYHEHP0GNP1WCLOS4BQ";
    $data["open_id"]="4f4f57524d0607011e1931164c47494345785c4c";
    $data["order_id"] = "5bee7c70ef716";
    $data["game_id"]=1;
    $data["gift_maps"]='{"1":1}';
    $data["transaction_id"]=1;
    $data["client_secret"] ="qv5pz3289lgpcqlwho3accb";
    //sort param keys
    ksort($data);
    //form key/value to url format
    $url_param = http_build_query($data);
    return md5($url_param);
  • Request example

  • Response:

    • Request successful:

      {
      "success":true
      }
    • Request failed

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000006",
      "errmsg":"access_token invalid"
      }

Gold coin mode

From the player’s perspective, there is only one concept: “gold coins”.
From the platform and game developer’s perspective, gold coins are divided into valid gold coins and free gold coins.
(That is, [user gold coin balance = valid gold coins + free gold coins], but this distinction is invisible to users.)

  • Free gold coins: obtained via claim gold coins / system free gold coin campaigns, and gold coins won from betting with free gold coins

  • Valid gold coins: obtained via U Diamond to gold coin exchange and gold coins won from betting with valid gold coins

  • When betting, free gold coins are consumed first; valid gold coins are used when free gold coins are insufficient
  • On settlement, free and valid gold coins earned are calculated automatically according to the ratio of valid and free gold coins the player bet in that round
  • Each player can claim free gold coins once per day, 1000 free gold coins per claim

1. Get user’s current gold coin balance

  • path: /gold/getBalance

  • Request method: GET

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
  • Response parameters

User gold coin balance = gold + goldFree

Parameter Description
gold Valid gold coin amount
goldFree Free gold coin amount
  • Request example
https://up-oauth.pengpengla.com/gold/getBalance?access_token=ACCESS_TOKEN&open_id=OPENID
  • Response:

    • Request successful:

      {
      "gold" : 300
      }


    • Request failed or processing error

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000006",
      "errmsg":"access_token invalid"
      }

2. Betting (additional bet) (deduct gold coins), settlement (add gold coins / award prizes), grant free gold coins (special rewards / campaign grants / task grants, etc.)

  • path:

    • Betting /gold/betting
    • Settlement /gold/settlement
    • Grant free gold coins /gold/gift
  • Request method: POST

  • Request parameters

Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
order_id Yes Order ID (generated by caller, must be unique); unique transaction identifier
amount Yes Gold coins to deduct (bet) in this transaction
game_id Yes Game ID
sign Yes Transaction signature (lowercase letters; see signing example below)
round Yes Game round number
  • Round number
    Introduces the round concept to represent one “game round”.

    • A round can have one or more players; multiple players in the same round are not strictly linked (e.g. bet/settlement timing, win/loss, etc.)
    • A round represents:
      For each player, one or more bets plus zero or one settlement
      Each player must bet before settlement; no further bets after settlement (after settlement it should be a new round)
    • Maximum duration of a round (from first bet) is 1 hour
    • Settlement of valid and free gold coins

      When betting, free gold coins are consumed first; valid gold coins are used only when free gold coins are insufficient
      On settlement, earned free and valid gold coins are calculated automatically according to the ratio of valid and free gold coins the player bet in that round

    • Grant gold coins
      In scenarios such as game events / game tasks / special levels, you may need to grant gold coins without skipping the bet flow; use the grant gold coins API.
      The grant gold coins API is not limited by bet/settlement flow: grants are allowed for that round whether the user has not bet, not settled, already bet, or round duration exceeds the limit, etc.
  • Signing method

    Use client_secret to sign the transaction to improve API security and prevent forged transactions if access_token is leaked.

    Sign by sorting all request parameters and values by parameter name, converting to URL format, then MD5 hashing.

    PHP example:

    $data["access_token"]="REPQYHEHP0GNP1WCLOS4BQ";
    $data["open_id"]="4f4f57524d0607011e1931164c47494345785c4c";
    $data["order_id"] = "5bee7c70ef716";
    $data["amount"]=20;
    $data["game_id"]=1;
    $data["client_secret"] ="qv5pz3289lgpcqlwho3accb";
    $data["round"] ="fp-123456";

    //sort param keys
    ksort($data);
    //form key/value to url format
    $url_param = http_build_query($data);
    //result: $url_param = access_token=REPQYHEHP0GNP1WCLOS4BQ&amount=20&client_secret=qv5pz3289lgpcqlwho3accb&game_id=1&open_id=4f4f57524d0607011e1931164c47494345785c4c&order_id=5bee7c70ef716&round=fp-123456
    return md5($url_param);
  • Response parameters

Parameter Description
amount Valid gold coins decreased (bet) / increased (settlement)
amountFree Free gold coins decreased (bet) / increased (settlement)
gold Valid gold coin amount
goldFree Free gold coin amount
  • Request example

  • Response:

    • Request successful:

      {
      "amount":20,
      "amountFree":0,
      "gold":20,
      "goldFree":99999998
      }
    • Request failed

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000006",
      "errmsg":"access_token invalid"
      }
      {
      "errno":"000009",
      "errmsg":"order_id already exist"
      }
      {
      "errno":"000001",
      "errmsg":"server error"
      }
      {
      "errno":"000011",
      "errmsg":"game round overtime"
      }
      {
      "errno":"000012",
      "errmsg":"game round Settled"
      }
      {
      "errno":"000003",
      "errmsg":"order_id already exist"
      }
      {
      "errno":"000004",
      "errmsg":"insufficient money"
      }
      {
      "errno":"000005",
      "errmsg":"user frozen"
      }

3. Query gold coin order (confirm whether order executed successfully)

  • path: /gold/checkOrder

  • Request method: GET

  • Request parameters
Parameter name Required Description
access_token Yes Token obtained via the OAuth get access_token API or refresh access_token
open_id Yes User identifier in the third-party application
order_id Yes Order ID (generated by caller, must be unique); unique transaction identifier
  • Response parameters
Parameter Description
success Transaction success flag; not returned in error cases
errno Error code; returned only in error cases
errmsg Error message; returned only in error cases
  • Request example
  • Response:

    • Request successful:

      {
      "success":true
      }


    • Request failed

      {
      "errno":"000002",
      "errmsg":"params error"
      }
      {
      "errno":"000006",
      "errmsg":"access_token invalid"
      }
      {
      "errno":"000001",
      "errmsg":"server error"
      }
      {
      "errno":"000008",
      "errmsg":"order not exist"
      }

Appendix

1. Unified error codes

Error code Description
000001 Internal server error
000002 Parameter error
000003 Duplicate order ID
000004 Insufficient U Diamond / gold coin balance
000005 User frozen; cannot deduct or add diamonds
000006 access_token invalid or expired
000007 code invalid
000008 Order ID does not exist
000009 Game API disabled
000010 U Diamond limit exceeded
000011 round timeout (round duration exceeded)
000012 round already settled (duplicate settlement)

2. Response format

{
"errno": " [error code] ",
"errmsg": "[error message]"
}