# task verification specification

### Custom task interface verification interface specification

### API Overview

* **API Endpoint**: `/verify/xxxx`
* **HTTP Method**: `GET`
* **Functionality**: Verifies whether a user has completed a task.
* **Use Case**: Third-party projects can use this API to validate user task completion and return the results to the Orbiter platform.

***

### Authentication

* **Is Authentication Required?**: Optional.
* **Authentication Method**: If authentication is required, provide an API key in the request header in the following format:

  ```
  Authorization: Bearer <API_KEY>
  ```

***

### Request Headers

| Header        | Required | Description                                                        |
| ------------- | -------- | ------------------------------------------------------------------ |
| Content-Type  | Yes      | The content type of the request body, fixed as `application/json`. |
| Authorization | No       | API key in the format `Bearer <API_KEY>`.                          |

***

### Request Query

<table><thead><tr><th width="112.93359375">Field Name</th><th width="84.6484375">Type</th><th width="98.4609375">Required</th><th>Description</th></tr></thead><tbody><tr><td>tweetId</td><td>string</td><td>No</td><td><code>tweetId</code></td></tr><tr><td>address</td><td>string</td><td>Yes</td><td>The user's wallet or account address.</td></tr></tbody></table>

#### Example Request

```http
GET /v1/verify?address="0x1234abcd..."

Authorization: Bearer sk_test_abcdef123456
```

***

### Response Body

<table><thead><tr><th width="113.43359375">Field Name</th><th width="139.02734375">Type</th><th>Description</th></tr></thead><tbody><tr><td>isValid</td><td>boolean</td><td>Indicates whether the verification passed (<code>true</code>) or failed (<code>false</code>).</td></tr><tr><td>message</td><td>string</td><td>A human-readable result or error message.</td></tr><tr><td>result</td><td>object</td><td>Optional, strategy-specific return data, e.g., <code>{ "count": 1 }</code>.</td></tr></tbody></table>

#### Example Response

```json
{
  "isValid": true,
  "message": "Verification succeeded",
  "result":null
}
```

***

### Error Response

When a request fails, the API will return an error response with the following fields:

<table><thead><tr><th width="134.57421875">Field Name</th><th width="125.91015625">Type</th><th>Description</th></tr></thead><tbody><tr><td>isValid</td><td>boolean</td><td>Should be <code>false</code>, indicating the verification failed.</td></tr><tr><td>message</td><td>string</td><td>Detailed error description.</td></tr><tr><td>result</td><td>object</td><td>Optional.</td></tr></tbody></table>

#### Example Error Response

```json
{
  "isValid": false,
  "message": "The provided txHash is invalid."
}
```

***

### Notes

1. **Optional Authentication**: If the `Authorization` header is not provided, the API will determine access based on its configuration.
2. **Request Body Validation**:
   * The `input` field must contain valid external data (e.g., `txHash` or `tweetId`).
   * The `address` field must be a valid wallet address.
3. **Response Time**: The API's response time may vary depending on the complexity of the external data validation.

***

### FAQs

#### 1. What happens if the `Authorization` header is not provided?

* If authentication is required, the API will return a `401 Unauthorized` error.
* If authentication is optional, the API will process the request based on default permissions.

#### 2. How should verification failures be handled?

* If `isValid` is `false`, use the information in the `message` field to guide users in correcting their input data.

***

### Contact Us

If you encounter any issues while using the API, please contact us via the following channels:

* **Email**: <techsupport@orbiter.finance>
* **Website**: <https://orbiter.finance>
