πŸ§‘β€πŸ’»For Devs

Create your OWN API based template

Intract's team offers enterprises the ability to create, test, and use their own customised API templates.



Getting started with API:

This section is intended for technical individuals.

Summary:

To create a custom API verification task, Intract requires an API developed according by our standards. When a quester interacts with this task, Intract will call the API with the required parameters and check if the task is verified.

This API will first be verified by Intract’s development team to check if all the standards are met

Keys Supported:

When we connect with your projects API for verification we will send some keys in payload body. We support the following keys for verification:

  1. Address

    User’s wallet address.

    🚨 We only support EVM compatible addresses.

  2. Twitter

    User account ID of user’s Twitter account.

  3. Discord

    Discord user name of user’s discord account.

  4. Telegram

    User ID of user’s telegram account.

  5. Email

    User’s email address.

API Signature

  • The API should be a POST request.

    βœ…NOTE:Make sure there are no parameters passed. We do not support query params.

  • URL format:

    https://<domain>/<serverpath>

    βœ…NOTE: We only support https requests.

  • Payload

    The API should support payload with this format.

    {
    	"address": "user's evm address in lowercase",
    	"twitter": "twitter account ID",
    	"discord": "Discord username",
    	"telegram": "Telegram user ID",
    	"email":    "email address"
    }

    βœ…NOTE: We will only include keys in the payload that are defined in the task template. For example, if the task template only mentions "address" as input, then only the "address" key will be present in the payload.

    When the task is recurring in nature two additional keys will be sent along with the above mentioned details. The following keys will be sent: startTimestamp and endTimestamp which are the start and end brackets of when the task is being verified.

    Example payload in this case:

    {
    	"address": "user's evm address in lowercase",
    	"startTimestamp":"2024-03-20T00:00:00.000Z",
    	"endTimestamp":"2024-03-20T23:59:59.000Z"
    }
  • Headers

    We will send security headers if mentioned.

Response Structure

We require the API response structure in a defined format. Failure to return data in this format will result in automatic rejection of the API approval.

Format:

{
    "error": {
        "code": 0,
        "message": "error message"
     },
     "data": { // required, whether success or error
         "result": <true | false> // bool, the user has done the task.
     }
}

Status Code:

The API should always return status code 200.

Performance Requirements

Intract’s campaigns receive a lot of scale. We require that APIs fulfils all performance requirements

These are some of the performance requirements needed for us to verify your API for usage.

  • Uptime: The API should meet 99.5% uptime SLA.

  • Throughput: The API should be able to handle a minimum of 50 req/sec.

  • Response Time: The API should have an average response time on less than 3 seconds. The max response time allowed is 5 seconds. We timeout the verification calls after 5 seconds.

  • Error Rate: The average error rate in an hour should be less than 0.5 percent.

    If in runtime the error rate increases more than the mentioned limit we disable the verification task all together.

βœ… All these performance requirements will be tested by load testing before approval.

Note: Once the API is created please visit here to integrate.

Last updated