# REST API Action Integration Spec

### Request

When an action needs to be validated, the system will send a GET request to the specified endpoint.

#### Request Configuration

* **Endpoint URL (required)**
  * e.g., <https://api.example.com/validate-quest-action>
* Request Header Values (optional), for authentication purposes. [Use hyphens to separate words, not underscores](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers)
  * e.g., header-key: value
  * e.g., header-key2: value2
* **Query Parameters in the Request (required)**
  * address (mandatory): The address to validate

CURL Example:

```python
curl -X GET \
  'https://api.example.com/validate-quest-action?address=0x5853eD4f26A3fceA565b3FBC698bb19cdF6DEB85' \
  -H 'header-key: value' \
  -H 'header-key2: value2'
 
```

### Response

The endpoint should return a **JSON-formatted** response.

#### Successful Case

If the action is validated successfully, return a 200 status code and the following JSON response:

```python
{
  "status": "success"
}
```

#### Failed Case

If the action validation fails, return a 200 status code and the following JSON response:

```python
{
  "status": "failed"
}
```

#### Error Case

* If the request input is invalid or required parameters are missing, return a 4xx status code.
* If an internal error occurs on the endpoint, return a 5xx status code.

\
The error response may include a `message` key to provide additional error information, but it is not required.

```python
{
  "status": "error",
  "message": "Invalid request parameters"
}
```

By implementing this specification, you can develop a REST endpoint to validate specific actions. The system will send requests to your endpoint, and your endpoint should return the corresponding JSON response and status code based on the validation result for the action.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloud.debank.com/en/official-account/quest/rest-api-action-integration-spec.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
