Skip to main content

REST API Management

This article is for Galxe Space Owners managing Quests and Spaces. If you're looking for information as a community member, such as participating in quests & campaigns, please see our Community Member Help section.

The REST API credential allows projects to verify a participant's eligibility for a quest task by querying a custom REST endpoint hosted by the project. This is useful when eligibility data lives outside Galxe and needs to be fetched in real time when participants click Verify.

For developers: This article walks through how to configure the REST API credential inside the Galxe dashboard. To build the REST API endpoint that this credential will call, refer to the REST Credential developer documentation. The example endpoint URL shown in the screenshots below is a placeholder; real endpoints are project-specific.

Follow these steps to configure a REST API credential in your quest:

  1. Select ID Type
    In this example, we are using the EVM address.

    IMAGE1

  2. Select REST as the Credential Source

    IMAGE2

  3. Leave Defaults for Request Type and Dimensions
    In this example, we use GET and Single Dimension, which are appropriate for most setups.

    IMAGE3

  4. Enter the Endpoint Link
    Enter the full URL of your REST API endpoint. The URL must include a parameter for the user's ID type, for example $address.

    IMAGE4

  5. Leave the Header Section Blank
    Normally, you can leave the header section blank, as shown in this example.

    IMAGE5

  6. Test the Endpoint with a Sample EVM Address
    Use the test response feature by entering a sample EVM address to verify that the endpoint returns the expected output.

    IMAGE6

    Example output:

    IMAGE7

  7. Define the Expression for Eligibility
    Enter the code that evaluates the endpoint response and returns 1 (eligible) or 0 (ineligible).

    Example code:

    function (data) { return data.is_ok ? 1 : 0; }

    IMAGE8

  8. Add a Description for the Task
    Provide a description for the task, which will help users understand the requirements.

    IMAGE9

  9. Include the Link for the Action
    If users are required to perform an action on your website or app, include the link here.

    IMAGE10

  10. Specify the Task Deadline
    If there is a deadline to complete the task, you can indicate it here. The 'Participation End Time' might not always align with the quest's end time.

    IMAGE11

This guide covers how to configure a REST API credential within the Galxe dashboard. For details on building the required REST API endpoint, refer to the REST Credential developer documentation.

Did this answer your question?