> For the complete documentation index, see [llms.txt](https://docs.ont.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ont.io/developer-tools/signing-server/api-reference.md).

# API reference

## API endpoint

The signing service is basically a `JSON` `RPC` server that is by default available at:

```
http://localhost:20000/cli
```

{% hint style="info" %}
The signing server only supports `POST`method queries
{% endhint %}

## Request structure

The request sent to the signing server is structured as follows:

```javascript
{
  qid: "XXX",      // Request ID. The response will echo back the same qid
  method: "XXX",   // Requested method name
  account: "XXX",  // Account for sign
  pwd: "XXX",      // Account password
  params: {}       // Input parameters for the requested method
}
```

## Response structure

The response sent by the signing server has the following structure:

```javascript
{
  qid: "XXX",         // Request ID
  method: "XXX",      // Requested method name
  result: {           // Response result
    signed_tx: "XXX"  // Signed transaction
  },
  error_code: 0,      // Error code，zero represents success, non-zero represents failure
  error_info: ""      // Error description
}
```

## Error codes

In case an error occurs, the `error_code` field will contain one of the following error codes:

| Error code | Error description         |
| :--------: | ------------------------- |
|    1001    | Invalid `http` method     |
|    1002    | Invalid `http` request    |
|    1003    | Invalid request parameter |
|    1004    | Unsupported method        |
|    1005    | Account is locked         |
|    1006    | Invalid transactions      |
|    1007    | `ABI` is not found        |
|    1008    | `ABI` is not matched      |
|    9999    | Unknown error             |

Please refer to the following links to find the relevant functions:

|       Library       | Link                                                                              |
| :-----------------: | --------------------------------------------------------------------------------- |
| Account information | <https://dev-docs.ont.io/#/docs-en/SignServer/04-api-account-methods>             |
|   Signing methods   | <https://dev-docs.ont.io/#/docs-en/SignServer/05-api-signing-methods>             |
| Convenience methods | <https://dev-docs.ont.io/#/docs-en/SignServer/06-api-signing-convinience-methods> |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.ont.io/developer-tools/signing-server/api-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
