# Custom API Configurations

This action type lets event organizers configure the verification and rewarding of actions performed on third-party applications. (Example: Get extra 30 points for registering an account on the XYZ application)&#x20;

<figure><img src="https://lh6.googleusercontent.com/SvQ_OkOEGgfiT_tckoSBrrpaKjwne_b5-VWmCOHzvfp2zBkIhQau487v9e0_GDuaxJa-WVkyOb-yVAx5utzpYv9ST49AYgv732pUtMIYg1wNrcb1Egk_59IhZyro3OJAJrX_vsQ_nyrE7sKGTWFvDao" alt=""><figcaption></figcaption></figure>

### How it works?

An organizer has to implement an API (GET or POST HTTP methods) for verifying certain data provided by participants in an event configured in Fyre. The API can then be configured under **"Custom API Configuration"** section.&#x20;

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2F6W93HAzMhs988AKM4jaq%2Ffyre-custom-api-flow.drawio.png?alt=media&#x26;token=f1178670-af86-45b0-b0d0-f8727ea5d7e7" alt=""><figcaption></figcaption></figure>

The process is very simple:&#x20;

1\) Participants provides data (requested by the organizer)&#x20;

2\) Fyre's server call the configured API.

3\) The 3rd party API server verifies the data and responds to the Fyre server.&#x20;

4\) Upon successful verification (as configured in the Fyre dashboard), the user claims the reward/points.&#x20;

### Example

Let's us say for example, an organizer wants to reward participants who have downloaded their app and created an account.  The organizer first develops a GET or POST API (say POST) and enters the API endpoint in the `API Endpoint` field and selects HTTP method as POST.&#x20;

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2FtW7uMvXcawHKVy9nQfNn%2Fimage.png?alt=media&#x26;token=800e95c3-c6c4-4097-bcfd-446d7718922a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Make sure to whitelist origin <https://app.fyre.hypersign.id> in your server
{% endhint %}

Upon selecting HTTP method, `fields` configuration section appears where the organizer has to configure API request body or query params fields. The Fyre server will take participants inputs in its UI and populates these fields while making the API call to the 3rd party app's server.&#x20;

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2FWVS68hGUcxIC18jhqEeu%2Fimage.png?alt=media&#x26;token=b4b39ccc-bc97-4978-99af-2467bf3e406a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Organizers may also request participants to provide blockchain wallet addresses. Currently we support EVM and Cosmos based chains. Click on `type` to see the list of supported blockchains.
{% endhint %}

Optionally, you may also configure Headers in the form of JSON

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2Fx6EzLm378zBpqKQnhswp%2Fimage.png?alt=media&#x26;token=2b081fda-939f-4175-9d2e-ed5b3ebac379" alt=""><figcaption></figcaption></figure>

Now configure the **"Condition"** which you want Fyre's server to verify. Say you want Fyre's server to assert that response is of type `boolean` and the value is `true.`

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2F9ceYly3DmpicnzYEC7j0%2Fimage.png?alt=media&#x26;token=0cd9f74b-5f7b-4880-a43d-80fbfac50454" alt=""><figcaption></figcaption></figure>

You may configure complex condition using regular expression condition.

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2FYFbIUKfQOqad7ZLGLF4I%2Fimage.png?alt=media&#x26;token=f901a027-6a0e-460c-b77f-87f2441be8f8" alt=""><figcaption></figcaption></figure>

Finally enter the **"Error Message"** , you want to show to your participant upon failed verification:&#x20;

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2Fiwe5MNNNV12beh8efw28%2Fimage.png?alt=media&#x26;token=dd627339-9f86-4b46-8d68-3a2b402ac712" alt=""><figcaption></figcaption></figure>

Enter the **Score** and click on **"Add"** to save this configuration.&#x20;

### Participant's View

This is how participants will view this action.&#x20;

<figure><img src="https://1814978555-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FR572GGCGh60OAHZrSofh%2Fuploads%2FBXaCBveHcdxy0ADJLP1D%2Fimage.png?alt=media&#x26;token=f552a309-9f5b-425e-903b-d54af328f498" alt=""><figcaption></figcaption></figure>
