🔌 API Tasks

This documentation provides detailed instructions on how to create and manage custom API tasks within a project using the Tide platform.

API Task creation

Step 1: Fill API task form

To create a task, you must navigate to Tide Campaign Builder, "Task Step".

Select "API" in the task selector and choose "Verify execution of a task on given API".

Tasks selector

Fill out the form with the following info:

  1. API Endpoint: The URL of the endpoint that will be called to check the task status.

  2. Request Headers (optional): Any headers that are required for the endpoint request, if there are any.

  3. Website URL: The URL that points to the website where the task actions need to be performed.

  4. Description: a detailed description to explain to the users what they should do to be eligible to complete the task.

Step 2: Validation Requirements

Once the form is filled out, the task will indicate the validation status:

The endpoint is under review
The endpoint is not valid
The endpoint is valid

The endpoint and headers must be validated by Tide before the task can be displayed in the campaign.

For an endpoint to be validated, it must meet the following criteria:

  1. User Address Query Parameter:

    • The endpoint must accept a query parameter named userAddress (do not add this parameter in the endpoint field).

    • The userAddress must be the lowercase EVM address of the user attempting to complete the task. This address is the same one used by the user to connect to the Tide platform.

  2. JSON Response Format:

    • The endpoint must return a JSON response with the following structure:

      {
        "eligible": boolean
      }
    • A value of true indicates that the user can complete the task.

    • A value of false indicates that the user cannot complete the task.

  3. If the endpoint meets these criteria, the task will be displayed in the Tide campaign. Otherwise, the task will not be displayed.

Step 3: Task completion

When the endpoint returns a successful result (eligible: true), the user’s task status is set to "completed".

By following the steps outlined in this documentation, projects can successfully create and manage API tasks on their own. Ensure that your endpoint, headers, and website URL are correctly submitted and validated and that the endpoint response adheres to the required format.

This will allow for seamless integration and task management within your Tide campaign.

For any further assistance or questions, please contact the Tide support team.

Last updated