DeBank Cloud
  • Open API
    • Welcome
    • API Reference
      • Chain
      • Protocol
      • Pool
      • Token
      • User
      • Collection
      • Wallet
    • API Models
      • PortfolioItemObject
      • ActionObject
      • TransactionObject
    • Error Code
      • Pre exec error code
    • ChangeLog
    • Auxiliary Feature
      • Units Usage
  • Official Account
    • Business Introduction
    • Service Operation Instructions
    • API Reference
      • Broadcast messages
      • User messages
    • Quest
      • REST API Action Integration Spec
  • DeBank Connect
    • Integration
    • ChangeLog
    • API
      • User Base Data
      • User Chain Data
      • User Social Data
  • Terms Of Service
Powered by GitBook
On this page
  • Request
  • Response
  1. Official Account
  2. Quest

REST API Action Integration Spec

This specification defines how to integrate via REST endpoints to validate the eligibility for specific actions.

PreviousQuestNextDeBank Connect

Last updated 10 months ago

Request

When an action needs to be validated, the system will send a GET request to the specified endpoint.

Request Configuration

  • Endpoint URL (required)

    • e.g.,

  • Request Header Values (optional), for authentication purposes.

    • e.g., header-key: value

    • e.g., header-key2: value2

  • Query Parameters in the Request (required)

    • address (mandatory): The address to validate

CURL Example:

curl -X GET \
  'https://api.example.com/validate-quest-action?address=0x5853eD4f26A3fceA565b3FBC698bb19cdF6DEB85' \
  -H 'header-key: value' \
  -H 'header-key2: value2'
 

Response

The endpoint should return a JSON-formatted response.

Successful Case

If the action is validated successfully, return a 200 status code and the following JSON response:

{
  "status": "success"
}

Failed Case

If the action validation fails, return a 200 status code and the following JSON response:

{
  "status": "failed"
}

Error Case

  • If the request input is invalid or required parameters are missing, return a 4xx status code.

  • If an internal error occurs on the endpoint, return a 5xx status code.

The error response may include a message key to provide additional error information, but it is not required.

{
  "status": "error",
  "message": "Invalid request parameters"
}

By implementing this specification, you can develop a REST endpoint to validate specific actions. The system will send requests to your endpoint, and your endpoint should return the corresponding JSON response and status code based on the validation result for the action.

https://api.example.com/validate-quest-action
Use hyphens to separate words, not underscores