Skip to main content

DeBox OpenPlatform API All-in-One

DeBox OpenPlatform API All-in-One Guide

TIP

The documentation is a summary of the API documentation, including all interfaces except login authorization, integral payment, and blockchain transfer, and each API can be expanded by clicking the triangle number in the upper left corner.

If you have any questions, feel free to join the DeBox Technical Discussion Group: Click to Join

Message Push

The API will send messages to groups and individuals.

If you are a go language developer ,to download the "sendmessage" SDK below:

POSThttps://open.debox.pro/openapi/messages/group/send

Send text messages to groups
Call example:

  curl -X POST -H "Content-Type: application/json" \
-H "X-API-KEY: t2XJ........lEF6" \
-d '{"group_id":"l3ixp32y","object_name":"text","title":"我是标题","content":"i am 富文本 \
{\"uitag\":\"a\",\"text\":\"点击我\",\"href\":\"https://debox.pro/\"}将跳转"}' \
"https://open.debox.pro/openapi/messages/group/send"

Parameters

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

group_id : String Group ID of a group. Indicates the group to which the message is sent, not empty

to_user_id : String User ID of the user. Indicates the user of the @ who. The value can be blank

object_name : String Indicates the message type. must be "text"

content : String Literal message string, non-empty

Responses

200: OK
{
"code":200,
"data":null,
"message":"success",
"success":false
}

POSThttps://open.debox.pro/openapi/messages/group/send

Rich text,suport text and image.
content contains texts and images
Example:

  curl -X POST -H "Content-Type: application/json" \
-H "X-API-KEY: t2XJ........lEF6" \
-d '{"group_id":"l3ixp32y","object_name":"richtext","title":"我是标题","content":"i am 富文本 \
{\"uitag\":\"a\",\"text\":\"点击我\",\"href\":\"https://debox.pro/\"}将跳转"}' \
"https://open.debox.pro/openapi/messages/group/send"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

group_id : String Group ID of a group. Indicates the group to which the message is sent, not empty

to_user_id : String User ID of the user. Indicates the user of the @ who. The value can be blank

object_name : String The message type. must be richtext

title : String The title of the message

content : String The main part of the richtext message, which can insert hyperlinks and pictures


1、Hyperlink
Example: {"uitag":"a","text":"USDC","href":"https://debox.pro/deswap"}
Convert the following JSON into string and put it in Content. In the Debox APP, a hyperlink will be displayed
var uiA = {
uitag: "a",
text: text,
href: href,
}
"uitag"="a", Indicates a hyperlink.
text, The hyperlink text
href, The website address of the hyperlink

2、Colorful text
Example: {"uitag":"font","text":"15%","bold":"true","italic":"true","color":"#ff0000"}
"uitag"="font", Indicates a Colorful text,support bold(true/false)、italic(true/false)、color(RGB).
Convert the following JSON into string and put it in Content. "15%" will be displayed in bold、italic、blue.
var uiFont = {
Uitag: "font",
Text: "15%",
Color: "#0000ff",
Bold: "true",
Italic: "true",
}
3、Image
Example:{"uitag":"img","src":"https://domain.com/a.png","position":"foot","height":"500","href":""}
Convert the following JSON into string and put it in Content. In the Debox APP, a image hyperlink will be displayed
var uiImg = {
uitag: "img",
src: "<https://domain.com/a.png>",
position: "foot",
href: "<https://debox.pro>",
height: "500",
}
uitag="img" ,Indicates that it is a text image hyperlink
src:The image resource address
position:The position of the image,values are as follows:
head,It means that the picture is displayed at the top, in front of the title
foot,Indicates that the picture is displayed at the bottom
For other values, hide the picture without displaying anything
href,The hyperlink address of the image
When the white list address for DeBox, open it directly
When a non -white address, the bomb prompt warning box
When it is empty, or if there is no definition, display the enlarged picture
height: image height, values are as follows:
height> =0 ,image height is set to the value of height,
height<0、When the number is not configured or configured, the default value is used. The high default value of iOS, Android top picture is 115; the high default value of the bottom picture is 230
height=0, display nothing
3、A sample of the content:
coinName Price \n
{"uitag":"a","text":"USDT","href":"https://debox.pro/deswap"} 96.78k
{"uitag":"a","text":"USDC","href":"https://debox.pro/deswap"} 81.74k
{"uitag":"a","text":"OP_ETH","href":"https://debox.pro/deswap"} 2.55k
{"uitag":"a","text":"BNB","href":"https://debox.pro/deswap"} 3.95
{"uitag":"img","src":"https://domain.com/a.png","position":"head","height":”300”,"href":"https://www..."}
{"uitag":"img","src":"https://domain.com/b.png","position":"foot","height":"500","href":"https://www..."}
Display as follows:

pure text:
Docs Version Dropdown

image top,text bottom
Docs Version Dropdown

text top, image bottom:
Docs Version Dropdown

image top, text middle, image bottom :
Docs Version Dropdown

Responses

200: OK
{
"code":200,
"data":null,
"message":"success",
"success":false
}

POSThttps://open.debox.pro/openapi/messages/private/send

Send message to some user
Call example:


curl -X POST -H "Content-Type: application/json" \
-H "X-API-KEY: t2XAlEF6......" \
-d '{"to_user_id":"uvg2p6ho","object_name":"text","content":"i am message"}' \
"https://open.debox.pro/openapi/messages/private/send"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

to_user_id : String Userid of the user. Indicates the recipient of the message. The value is not empty

object_name : String value is text or richtext

content : String The message content

Responses

200: OK
{
"code":200,
"data":null,
"message":"success",
"success":false
}

Get user information such as user nickname, avatar and wallet address

Get the user's nickname, avatar, and wallet address

API about user information If you want to query information about a user, you can use the following interfaces.

POSThttps://open.debox.pro/openapi/user/info

Get the basic user information,POST Method,use access_token to verify
After the Api combined with the login authorization and authorization, the obtained information is requested to obtain the user's basic information with the obtained access_token and User_id requesting this Api, such as nicknames, avatars, wallet_address.
使用示例:

curl --location --request POST 'https://open.debox.pro/openapi/user/info?user_id=lx....' \
--header 'access_token: eyJhxxCJ9.eyxxJ9.hWxxQ'

Parameters

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

user_id : String The user_id which can be obtained during login authorization

Responses

200: OK
{
"code": 1,
"data": {
"name": "ltx", // nickname
"wallet_address": "0xsadf......34df", // wallet address
"avatar": "https://data.debox.space/nfts/0x67a7f09c/699-1.png",// avatar
"uid": "fxidfef4" // equal to user_id
},
"message": "success",
"success": true
}

GEThttps://open.debox.pro/openapi/user/info

Obtain user base information Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/user/info?user_id=uvg2p6ho"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

user_id : String Userid of the user. The userid of the authorized user, can be obtained during login authorization

Responses

200: OK
{
"code": 1,
"data": {
"name": "ltx", // user name
"wallet_address": "0xsadf......34df", // wallet address
"avatar": "https://data.debox.space/nfts/0x67a7f09c/699-1.png",// user header image
"uid": "fxidfef4" // the same to user_id
},
"message": "success",
"success": true
}

GEThttps://open.debox.pro/openapi/user/followers

To obtain the followers of Debox users bound by the developer account, note that the API can only get the follow-up list of the debox user corresponding to the X-API-Key:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/user/followers?page=1&size=20"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

page : Numeric Number of pages of pagination query

size : Numeric Each page size

Responses

200: OK
{
"code": 1,
"data": [
{
"name": "zhang3",
"wallet_address": "0x22b15300cf8...2562bea2",
"avatar": "https://data.debox.pro/.../headimg.png",
"uid": "0mb...bc"
},
{
"name": "Lee4",
"wallet_address": "0xb63219a8e0d3...f2cd459f",
"avatar": "https://data.debox.pro/.../headimg.png",
"uid": "xq6...pg"
}
],
"message": "success",
"success": true
}

GEThttps://open.debox.pro/openapi/user/is_follow

Verify whether a user is following another user
Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/user/is_follow?\
walletAddress=0x2267......&chain_id=1&followAddress=0xB63219a8E0D367d87BA1c8B0736CbfDbf2cD459F"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

walletAddress : The follower's wallet address

followAddress : The wallet address of the person being followed

Responses

200: OK
{"case3702":false}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}
401: Unauthorized
{"error":"Bad Request","code":401,"message":"Param error"}

Community (group) information

This is a community-related API, such as you can query the basic information of a community, Luckybox sent data and so on.

GEThttps://open.debox.pro/openapi/group/info

Obtain the current group information
Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......"  \
"https://open.debox.pro/openapi/group/info?\
group_invite_url=https://m.debox.pro/group?id=fxi3hqo5"

Parameters

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

group_invite_url : Group sharing URL, on the App side, click group sharing, copy the link to get it

Responses

200: OK
# is_charge          Whether charge or not
# subchannel_number Number of subchannels
# group_name The name of the group
# group_number The number of the group
# group_pic The cover of the group
# create_time the Create time of the group
# maximum the max Number of the group
# mod The array of mod
{
"code": 200,
"data": {
"is_charge": true,
"subchannel_number": 3,
"group_name": "aaa",
"group_number": 29,
"group_pic": "https://data.debox.pro/static/2022/09/19/static/2022/09/19/100009_1435000131.jpg",
"create_time": "2022-04-30 16:03:24",
"maximum": "500",
"mod_info":[{"name":"ChatBot","wallet_address":"0xb63219a8e0d367d87ba1c8b0736cbfdbf2cd459f","avatar":"https://data.debox.pro/static/2024/03/29/uvg2p6ho/1711724284264837135.jpeg","uid":"uvg2p6ho"}]
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

GEThttps://open.debox.pro/openapi/group/is_join

Verify whether the user is in the group
Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/group/is_join?\
walletAddress=0x2267......&url=https://m.debox.pro/group?id=fxi3hqo5"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

walletAddress : The wallet address, which represents the user to be authenticated

url : The URL of the group , represent a group

chain_id : Blockchain network ID, default 1, Ethereum Mainnet

Responses

200: OK
{"case3701":false}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}
401: Unauthorized
{"error":"Bad Request","code":401,"message":"Param error"}

4、Moment, likes, followers between users

The API related to moment

GEThttps://open.debox.pro/openapi/moment/praise_info

Get the like information of all moments posted by the user corresponding to the current address

Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/moment/praise_info?\
wallet_address=0x2267......&chain_id=1"

Parameters

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

wallet_address : Wallet address, representing a user

chain_id : Blockchain network ID, default value 1, Ethereum mainnet

Responses

200: OK
# receive_praise_total  The total number of likes some one has received
# send_praise_total The total number of likes that some one gives to others
{
"code": 1,
"data": {
"receive_praise_total": 46,
"send_praise_total": 208
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

GEThttps://open.debox.pro/openapi/moment/give_praise

Whether a user likes a moment
Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/moment/give_praise?\
wallet_address=0x2267......&chain_id=1&moment_id=oo0epx1p"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

wallet_address : Wallet address, representing a user

chain_id : Blockchain network ID, default value 1, Ethereum mainnet

moment_id : Moment ID: representing a moment

Responses

200: OK
# is_praise  Whether liked
{
"code": 1,
"data": {
"is_praise": false
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

GEThttps://open.debox.pro/openapi/moment/receive_praise

Gets the total number of likes for a Moment
Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/moment/receive_praise?moment_id=oo0epx1p"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

wallet_address : Wallet address, representing a user

chain_id : Blockchain network ID, default value 1, Ethereum mainnet

moment_id : Moment ID: representing a Moment

Responses

200: OK
# receive_praise_total  Number of likes
{
"code": 1,
"data": {
"receive_praise_total": 5
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

Voting & Giveaway

The API related to voting and Giveaway information.

GEThttps://open.debox.pro/openapi/vote/info

Obtain the number of votes cast by the current address user in the current group

Parameters

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

wallet_address : Wallet address, which represents a user

chain_id : Blockchain network ID, default 1, Ethereum Mainnet

group_invite_url : Group share URL, which represents a group

Responses

200: OK
# vote_number   Number of votes
{
"code": 200,
"data": {
"vote_number": 6//Number of votes
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

GEThttps://open.debox.pro/openapi/lucky_draw/info

GET https://open.debox.pro/openapi/group/is_join Get the number of Luckydraws of the current address user in the current group

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

wallet_address : Wallet address, which represents a user

chain_id : Blockchain network ID, default value 1, Ethereum mainnet

group_invite_url : Group share URL, which represents a group

Responses

200: OK
# initiate_luckDraw_total Total number of draws initiated
# luckDraw_total Total number of entries to the draw
# luckDraw_win_total Total number of wins
{
"code": 1,
"data": {
"initiate_luckDraw_total": 3,
"luckDraw_total": 3,
"luckDraw_win_total": 3
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

LuckyBox

The API related to LuckyBox

GEThttps://open.debox.pro/openapi/lucky_box/user222

Get Luckybox information sent/received by address user

Parameters

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

wallet_address : Wallet address, which represents a user

chain_id : Blockchain network ID, default 1, Ethereum Mainnet

Responses

200: OK
# receive_luckyBox_number   Number of LuckyBox received
# receive_luckyBox_total Number of LuckyBox received (amount)
# send_luckyBox_number Number of LuckyBox sent
# send_luckyBox_total Number of LuckyBox sent (amount)
{
"code": 1,
"data": {
"receive_luckyBox_number": 12,
"receive_luckyBox_total": 1235.9,
"send_luckyBox_number": 18,
"send_luckyBox_total": 3199.58
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

GEThttps://open.debox.pro/openapi/lucky_box/user/group

The number of LuckyBox received by a user in a particular group

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

wallet_address : Wallet address, which represents a user

chain_id : Select The blockchain network from which you want to obtain data

group_invite_url : Group share URL, which represents a group

Responses

200: OK
# receive_luckyBox_number  Number of LuckyBox received
{
"code": 1,
"data": {
"receive_luckyBox_number": 8 Number of LuckyBox received
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

GEThttps://open.debox.pro/openapi/lucky_box/group

Get the total amount of LuckyBox sent by the current group
Usage Example:

curl -X GET -H "X-API-KEY: t2XAlEF6......" \
"https://open.debox.pro/openapi/lucky_box/group?\
group_invite_url=https://m.debox.pro/group?id=fxi3hqo5"

Parameters

Header

app_id : String

X-API-KEY : String

nonce : String random number,length is 8

timestamp : String timestamp

signature : String sha1 signature

compute signature like this:

// keep sequence:appsecret -> nonce -> timestamp
signature = SHA1({appsecret}{nonce}{timestamp})
Query

group_invite_url : Group share URL, which represents a group

Responses

200: OK
# sum_amount The total vBOX sended
# total_num The total number sended
{
"code": 200,
"data": {
"sum_amount": 3896,
"total_num": 30
},
"message": "success",
"success": true
}
400: Bad Request
{"error":"Bad Request","code":400,"message":"You X-API-KEY is not available"}

Authorized Login

DeBox Authorized Login is a login system based on OAuth2.0 protocol standards.Details

GEThttps://app.debox.pro/oauth/authorize

In DeBox App,Click the link to jump to the authorization interface, and the user clicks or cancels at the interface. After the user allows authorization, the page will jump to the redirect url and bring Code & Userid & Source

  https://app.debox.pro/oauth/authorize/?
app_id=ohpdAP9W55gyXeJ0&grant_type=authorization_code&scope=userinfo&response_type=code&
pay_info=loginTest&redirect_uri=https://docs.debox.pro/demo/a.html

Parameters

Query

redirect_uri : String Callback url after the authorization is successful. When the user clicks authorization, the App will return the code as a parameter to the url.must be whitelist url,go to config App Domain first

app_id : String App ID on Developer plateform

scope : String Authorization field : payment represents payment authorization and moment represents moment message authorization

grant_type : String Indicates that the authorization mode is the authorization code:authorization_code

GEThttps://open.debox.pro/openapi/oauth2/access_token

Once you have the code from Step 1, request the following link to get it access_token:

  curl --location --request GET
https://open.debox.pro/openapi/oauth2/access_token?
grant_type=authorization_code&code=ZDY5ZTA......FRE5
&app_id=xxxxxx&app_secret=xxxxxx&user_id=xxxxxx

Parameters

Query

grant_type : String Indicates that the authorization mode is:authorization_code


code : String code from Step 1

app_id : String App ID on Developer plateform

app_secret : String App Secret on Developer plateform

user_id : String user_id from Step 1

Responses

200: OK
  {
"code": 1,
"data": {
"access_token":
"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODgzOTQ4MDMsInN1YiI6IjEwMzA1O
CJ9.hbEt8JthQvo85iGkhUiPpTlcII4n3hgOYDErUDS9X2kkOnsNM27pAO_x9WP4KEE_33uFEd6GOgS
A51MlYZakb1",
"expires_in": 1,
"refresh_token": "MDBMOWYZYWYTZMRLYS01ODRHLWJKYTUTZGFIMMU1ZDEZNWM3",
"token_type": ""
},
"message": "success",
"success": true
}
401: Failed
  { 
"code": 401,
"message": "Bad Request",
"success": false
}

GEThttps://open.debox.pro/openapi/oauth2/refresh_token

Refresh access_token

curl --location --request GET
https://open.debox.pro/openapi/oauth2/refresh_token?
grant_type=refresh_token&refresh_token=YTNMYMZJZMY......ZTAH
&app_id=xxxxxx&app_secret=xxxxxx&user_id=xxxxxx

Parameters

Query

grant_type : String Indicates that the authorization mode is:refresh_token


refresh_token : String refresh_token from Step 2

app_id : String App ID on Developer plateform

app_secret : String App Secret on Developer plateform

user_id : String user_id from Step 1

Responses

200: OK
  {
"code": 1,
"data": {
"access_token":
"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2ODgzOTQ4MDMsInN1YiI6IjEwMzA1O
CJ9.hbEt8JthQvo85iGkhUiPpTlcII4n3hgOYDErUDS9X2kkOnsNM27pAO_x9WP4KEE_33uFEd6GOgS
A51MlYZakbg",
"expires_in": 1,
"refresh_token": "MDBMOWYZYWYTZMRLYS01ODRHLWJKYTUTZGFIMMU1ZDEZNWM3",
"token_type": ""
},
"message": "success",
"success": true
}
401: Failed
 {
"code": 401,
"message": "Bad Request",
"success": false
}

Authorized Payment

DeBox provides a payment authorization API based on vBOX to provide a broader application scenario for vBOX.

GEThttps://app.debox.pro/oauth/authorize

The onetime token API is used to generate the order number and token of integral payment, and is combined with the following /payment/transfer API to complete the integral payment function.

https://app.debox.pro/oauth/authorize?
app_id=ohpdAP9W55gyXeJ0&scope=payment&grant_type=onetime_token&amount=0.01&
payer_user_id=ii0k2v5n&receiver_user_id=rqg6g4j1&pay_type=send&pay_info=test&
redirect_uri=https://docs.debox.pro/demo/a.html

Parameters

Query

redirect_uri : String Authorization succeeded callback address, need encodeURIComponent,go to config App Domain first

app_id : String Application unique identification, DeBox developer community application

scope : String Scope of authority(payment)

grant_type : String Type of authority(onetime_token)

amount : Number Amount, two decimal places at most

payer_user_id : String The payer. this param is the user_id of authority

receiver_user_id : String The receiver. this param is user_id of developer

pay_type : String Must be "send" ,means authority is payer

pay_info : String Pay information

Responses

200: OK
{ 
"code": "xxx", //Authorize token, Valid for 5 minutes
"serial_id": "xxx", // Serial number
"source ": "debox" // From where
}

POSThttps://open.debox.pro/openapi/payment/transfer

Transfer API

Parameters

Query

app_id : App ID, apply on platform https://developer.debox.pro/

app_secret : App Secret, apply on platform https://developer.debox.pro/

Body

access_token :String The code from /onetime_token

serial_id :String Serial number

verify_amount :String When the developer is the payer, verify_amount is required and used to check whether the amount of the developer's payment is correct.If verify_amount is not equal to amount, the transfer will fail

Responses

200: OK
{ 
"code": "", // error code, 1 means success
"msg": "",
"source ": "debox" // from where
}
API Error Code

-2001 User login validity problem, you can try to log in again
-2004 Parameter invalid
-2006 The transaction parameters are not valid
-2010 Code expired when access token
-2011 Invalidate code when get access token
-2012 Refresh access token failed
-2013 Access token expired
-2014 System exception, please try again
-2015 Access token Check failure
-2016 Make repeated transfer requests
-2028 System exception, please try again
-2030 System exception, please try again
-7048 The balance is insufficient, the transfer failed
-7052 System exception, please try again