Skip to main content

Q&A

DeBox OpenPlatform API Q&A

Tech Support
  • Open Platform Entrance: Click to Go
  • If you have any questions, feel free to join the DeBox Technical Discussion Group: Click to Join

How to get group_id of a group?

  1. Open the app, enter a group, click the Share button in the upper right corner, and select "Copy link" in the pop-up interface at the bottom. The ID is the group ID
    such as: https://m.debox.pro/group?id=fxi3hqo5, the group_id is fxi3hqo5 .

How to send a "pure text" message to a group?

  1. Developers need to apply for a developer key on the open platform https://developer.debox.pro/ .
  2. Bind the corresponding DeBox user in the developer background .
  3. Download Go-SDK, send bot message through go language, demo download address: https://github.com/debox-pro/debox-chat-go-sdk .
  4. Or send plain text message by http-js, the API is/send_robot_group_message,such as:
curl -X POST -H "Content-Type: application/json" -H "X-API-KEY: t2XAlEF6......"  
-d '{"to_user_id":"uvg2p6ho","group_id":"fxi3hqo5","object_name":"text",
"message":"i am message sent by bot"}'
"https://open.debox.pro/openapi/messages/group/send"

How to send a "image and text" message to a group?

  1. Developers need to apply for a developer key on the open platform https://developer.debox.pro/.
  2. Bind the corresponding DeBox user on the developer background.
  3. Download Go-SDK, send bot message through go language, demo download address: https://github.com/debox-pro/debox-chat-go-sdk .
  4. Or send plain text message by http-js, the API is/send_robot_group_message,such as:
curl -X POST -H "Content-Type: application/json" -H "X-API-KEY: t2XAlEF6......" 
-d '{"to_user_id":"uvg2p6ho","group_id":"fxi3hqo5","object_name":"richtext",
"title":"i am title","content":"i am content","message":"https://data.debox.space/dao/newpic/one.png"}'
"https://open.debox.pro/openapi/messages/group/send"

How to send message to a DeBox user?

  1. Developers need to apply for a developer key on the open platform https://developer.debox.pro/.
  2. Bind the corresponding DeBox user in the developer background.
  3. Download Go-SDK, send bot message through go language, demo download address: https://github.com/debox-pro/debox-chat-go-sdk.
  4. Or send plain text message by http-js, the API is/send_robot_message,such as:
 curl -X POST -H "Content-Type: application/json" -H "X-API-KEY: t2XAlEF6......" 
-d '{"to_user_id":"uvg2p6ho","object_name":"text","message":"i am a message to user from bot"}'
"https://open.debox.pro/openapi/messages/private/send"

After the authorization is successful, why is the redirect uri not redirect to?

  1. Redirect_uri address has some problems,cant not jump to.
  2. The address is right,but contains ?#:% and so on ,you need use encodeURIComponent to encode the uri.
  3. Redirect_uri shoud a https address,otherwise you can't open it on ios(android is available).

After authorization login success, you can access the redirect uri page on the App side. However, on the web side, it is always initialization.

  1. On the web, you must pass the response_type=code, otherwise you can't go into redirect_uri page.

Encounter error code = -2011 during vBOX payment?

  1. Please pass parameters according to the specification, do not pass less, do not pass more, otherwise there will be unexpected errors. For example, if multiple user ID parameters are passed, a code = -2011 error may be reported.

The authorization page don't display the logo of the DApp?

  1. You can confige App logo on the open platform https://developer.debox.pro/.

The authorization page don't display the name of the DApp?

  1. You can confige App name on the open platform https://developer.debox.pro/.

Among the parameters of vBOX payment, who is the payer? Who is the receiver?

  1. Pay type indicates the identity of the authorizer. If the value is send, the authorizer is the payer. If the value is receive, the authorizer is the recipient.
  2. The identity of the developer is a counterparty to the authorizer. If the authorizer is send (payer), the developer is receiver. If the grantor is receive (receiver), the developer is payer.
  3. The value of pay type determines the identity of the authorizer and developer. The pay type is determined first, and then the payer user ID and receiver user ID are determined.
  4. Pay type= authorizer =send|receive, which determines the authorizer identity, and the developer is naturally another identity.
  5. The payer user ID and receiver user ID can only be obtained from the authorizer and developer, and must be correctly filled according to the pay type value. Otherwise, various errors will be reported.

【Lab】【DApp】【Collect】Why is the DApp logo not displayed in my collection?

  1. The logo address of collected DApp is https://your domain/favicon.ico .
  2. Please make sure https://yourdomain/favicon.ico exist, the favicon.ico is the logo of your DApp in collection.

What is an authorized provisional note(code)?

  1. The code is required when a third party obtains an access token through the code. The timeout period of the code is 5 minutes. A code can be exchanged for only one access token. The temporary and one-time nature of the code ensures the security of DeBox authorized logins.

What is authorization scope(scope)?

  1. The authorization scope represents the interface permissions that the user grants to third parties.

All is correct, but why can't pull up the payment page?

  1. The gas price given is less than the base price.
  2. Insufficient assets. The asset balance is less than the total of transfer amount and gas fee.
  3. The network is not good, because some nodes of the blockchain are overseas, there may be no normal transfer due to network impassability, and scientific Internet access.

How to determine whether a browser has a built-in DeBox environment?

The userAgent string contains either "DeBox"

    const isDeBox = !!window?.navigator?.userAgent?.includes('DeBox')