Quests

A quest is a collection of tasks to enable a user to achieve a specific objective. A quest is discoverable by all twins in the Fetch.ai mobile app; any twin that discovers the quest can participate in the quest.


List All Quests

Add New Quest

List All of Your Quests

Update Quests

List Details of Specific Quest

Update a Quest - Add an Image to a Quest


§List all Quests Available

If you want to see all of the publicly available quests, created by any twin, that you can access.

curl --location --request GET '<API_URL>/quests/' \ --header 'Content-Type: application/vnd.api+json' \ --header 'X-Organization: <ORG_ID>' \ --header 'X-Twin:<TWIN_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>'

This will return a response similar to the one below:

{ "data": [ { "type": "quests", "id": "<QUEST_ID>", "attributes": { "created": "2022-06-21T16:28:54.652167Z", "modified": "2022-06-21T16:28:54.652167Z", "name": "test3", "description": "this is the description", "summary-image-url": "<IMAGE_URL>", "public": false, "twin-metadata": {}, "original-twin-metadata": null, "task-count": 0, "summary": "this is a test summary" }, "relationships": { "images": { "data": [], "meta": { "count": 0 } }, "summary-image": { "data": { "type": "images", "id": "<IMAGE_ID>" } }, "twin": { "data": { "type": "twins", "id": "<TWIN_ID>" } }, "original": { "data": null } } }, {...} ] }
Query ParametersExpected InputDescription
owned_byID of TwinFilter by twin ID / creator
nameStringFilter tasks by names containing the provided string.
descriptionStringFilter tasks by descriptions containing the provided string.

§Add a New Quest

To create a quest, we need to assign a name. It is best practice to include a summary and a description. Summary will be displayed in the quest thumbnail on the discovery feed; whilst the description is an extended overview of the quest for the user to read.

We recommend you also add an image to the quest so it’s visible on the discovery feed in the mobile app. To add an image, you’d need to access the images endpoint.

curl --location --request POST '<API_URL>/quests/' \ --header 'Content-Type: application/vnd.api+json' \ --header 'X-Organization: <ORG_ID>' \ --header 'X-Twin: <TWIN_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>' \ --data-raw '{ "data": { "type": "quests", "attributes" : { "name" : "test", "summary" : "this is a test summary", "summary-image" : "<IMG_ID>" "description" : "this is the description" } } }'

This will return the following response: \

{ "data": { "type": "quests", "id": "<QUEST_ID>", "attributes": { "created": "2022-06-21T10:16:23.871238Z", "modified": "2022-06-21T10:16:23.871238Z", "name": "test", "description": "this is the description", "summary": "this is a test summary", "public": false }, "relationships": { "images": { "data": [], "meta": { "count": 0 } }, "summary-image": { "data": null } } } }

§List All of Your Quests

This will list all of the quests you have personally created, or you have embarked on

curl --location --request GET '<API_URL>/my/quests/' \ --header 'Content-Type: application/vnd.api+json' \ --header 'X-Organization: <ORG_ID>' \ --header 'X-Twin: <TWIN_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>'

This will return a response like the following:

{ "data": [ { "type": "quests", "id": "<QUEST_ID>", "attributes": { "created": "2022-06-21T12:14:27.559110Z", "modified": "2022-06-21T12:14:27.559110Z", "name": "test", "description": "this is the description", "summary": "this is a test summary", "public": false }, "relationships": { "images": { "data": [], "meta": { "count": 0 } }, "summary-image": { "data": { "type": "images", "id": "<IMG_ID>" } } } }, { ... }, ... ] }
Query ParametersExpected InputDescription
is_originalBooleanFilter on whether quest is original or not
originalID of Original QuestFilter quests by the original they were copied from
owned_byTwin IDFilter by twin ID / creator
nameStringFilter tasks by names containing the provided string.
descriptionStringFilter tasks by descriptions containing the provided string.

§List Details of a Specific Quest

You can find details about a specific quest by querying the specific quest by ID.

curl --location --request GET '<API_URL>/my/quests/<QUEST_ID>' \ --header 'Content-Type: application/vnd.api+json' \ --header 'X-Organization: <ORG_ID>' \ --header 'X-Twin: <TWIN_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>'

§Update a Quest Add an Image to a Quest

If the quest has not been started or activated by anyone, A summary image adds extra contextual information to your quest, making your quest stand out from others quests on the app.

To do this, first you’ll need an image ID obtained from the Images endpoint.

To add an image to an already created quest, we can patch an update to a specific quest.

curl --location --request PATCH '<API_URL>/quests/<QUEST_ID>/' \ --header 'Content-Type: application/vnd.api+json' \ --header 'X-Organization: <ORG_ID>' \ --header 'X-Twin: <TWIN_ID>' \ --header 'Authorization: Token <ACCESS_TOKEN>' \ --data-raw '{ "data" : { "type" : "quests", "id" : "<QUEST_ID>", "attributes" : { "summary-image" : "<IMG_ID>" } } }'