API-Verified Quest (RESTFUL)

How to set up custom quest using RESTful API.

Introduction

CARV allows the use of OpenAPI to verify whether a user has completed a quest.

Sequence Digram

Specifications

Request

The API used for verification must be an open API. You can choose to use either email or wallet address as the identifier to verify a user. You can choose optionally to add custom headers to the request, such as an API key. We will also include begin time and end time (timestamp in milliseconds) for a quest in case this information is required for verification.

So a GET Request will look like the followings:

curl https://<domain>/<serverpath>?address=<userAddress>&begin_time=<timestamp>&end_time=<timestamp>

OR

curl https://<domain>/<serverpath>?email=<userEmail>&begin_time=<timestamp>&end_time=<timestamp>

Response Format

{
    "result":{                    //required on success
        "isValid":<true | false>  //boolean: whether the user completed the quest.
    },
    "error":{                      //required on error, this field MUST NOT exist if there was no error triggered during invocation.
        "code":<error code>,       //number
        "message":"<error message>"
    }
}

Last updated