Complete a quest
Mark a quest as complete for a user or users and distribute any appropriate awards. Calling this endpoint is the same action as a user marking the quest as complete and their entry being reviewed and accepted.
This endpoint only supports external quests. You can not complete a Twitter follow quest, for example.
Request
HTTP POST to /quests with Content-Type: application/json and a JSON body of:
- Example
- Schema
{
"requestId": "876cc0af-8f20-4163-a8cd-e99674c5e0a4",
"description": "Rewards for connecting wallets to our website",
"questId": "0681afdf-97bf-47f3-8569-731aeb6b2dd9",
"addresses": [
"0xd03ea8624C8C5987235048901fB614fDcA89b117",
"0x435Cd3902d1b4f4E842F2C0fd5028EEE71dd099C"
]
}
{
"requestId": "string",
"description": "string",
"questId": "string",
"addresses": "array"
}
Fields
requestId
Used to identify the request and ensures that no duplicates are processed in any subsequent requests. Must be generated by the client and must be unique to any previously sent requests.
| Type | string |
| Required | Yes |
| Limitations | Unique to any previously sent Id. Alphanumeric characters only. No spaces. 128 characters maximum. |
| Examples | "1" "000005" "88736db7-7f2d-44fc-8901-acaff1d95b72" "testing" |
description
Generated by the client and provides context to the request for auditing purposes. Although not required it is recommended to provide a description, as this helps humans identify the request.
| Type | string |
| Required | No but recommended |
| Limitations | 256 characters maximum. |
| Examples | "Our top 10 customers this week." "Our fanart competition winners." "A special bonus for those being kind to others." |
questId
Guid to identify the On3 quest. This quest must already exist, be of type "External", and be currently active (started and not finished).
| Type | string |
| Required | Yes |
| Limitations | Must be a GUID format. |
| Examples | "98cde5fa-d794-4a88-88bf-6622b50aaaa6" |
addresses
An array of wallet addresses only you wish to make this quest as complete for.
| Type | array |
| Required | Yes, must contain at least one address |
| Limitations | A list of valid wallet addresses (0x...) |
| Examples | "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" |
Response
You should appropriately handle any failures when the failedCount is greater than 0. The failures.errors array will detail what went wrong but in 99% of cases it will be because you passed in an invalid questId, we couldn't find an account with that wallet address, or the user has already completed that quest. You should check your data and re-send the request for any failed accounts, if appropriate.
A success response indicates that we were able to complete the quest for at least one account, not all that were passed.
- Success (2XX)
- Failure (4XX)
{
"txId": "string",
"requestId": "string",
"timestamp": "string",
"processedCount": 0,
"failedCount": 0,
"failures": [
{
"address": "string",
"errors": [
"string"
]
}
]
}
{
"requestId": "string",
"errors": [
"string"
]
}
Codes
| Code | Success | Description |
|---|---|---|
| 2XX | Yes | The transaction was successfully processed, with at least one user completing the quest. Any failures to complete quests for a specific user is noted in the response. |
| 4XX | No | The entire transaction failed due to a client-side error. Check the response body for details on what needs changing in the request. If the error continues and the request appears to be valid, please report this to the On3 support team. |
| 5XX | No | The entire transaction failed due to a server-side error. If the error continues after several attempts, please report this to the On3 support team. |