> For the complete documentation index, see [llms.txt](https://docs.antbuddy.us/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.antbuddy.us/integration-document-guide/antring/api-list.md).

# API List

**API List**

**1. Get Authentication Token**\
Used for receiving websocket signals for call events.

* **URL**: `/oapi/v1/voice/auth_token`
* **METHOD**: POST
* **Content Type**: `application/json`

**Headers**:

| Property        | Data Type | Value                     |
| --------------- | --------- | ------------------------- |
| x-auth-app-id   | String    | 3rd party identifier      |
| x-auth-app-hash | String    | sha256(appId + appSecret) |

**Response**:

| Status | Result                                           |
| ------ | ------------------------------------------------ |
| 200    | `{ value: <auth_token>, expire: <expire time> }` |

***

**2. Click to Call**

* **URL**: `/oapi/v1/call/click-to-call/:number`
* **METHOD**: POST
* **Content Type**: `application/json`

**Headers**:

| Property        | Data Type | Value                     |
| --------------- | --------- | ------------------------- |
| x-auth-app-id   | String    | 3rd party identifier      |
| x-auth-app-hash | String    | sha256(appId + appSecret) |

**Parameters**:

| Property    | Data Type | Value                         |
| ----------- | --------- | ----------------------------- |
| sipUser     | String    | Device name for click to call |
| sipPassword | String    | Password                      |

**Response**:

| Status | Result                                  |
| ------ | --------------------------------------- |
| 200    | Device online, click to call successful |
| 400    | Device offline, click to call failed    |

**Note**:\
To receive the call, the SIP device must be registered on the system. Error 400 occurs when the device is not registered.

***

**3. Get Call History**

* **URL**: `/oapi/v1/call/histories`
* **METHOD**: GET
* **Content Type**: `application/json`

**Parameters**:

| Property      | Data Type | Value                                                                  |
| ------------- | --------- | ---------------------------------------------------------------------- |
| appId         | String    | 3rd party identifier                                                   |
| created\_from | String    | Start date                                                             |
| created\_to   | String    | End date                                                               |
| limit         | Number    | Limit of records per page, default 20                                  |
| page          | Number    | Current page, default 1                                                |
| hash          | String    | sha256(appId + created\_from + created\_to + limit + page + appSecret) |

**Notes**:

* Maximum time filter is 31 days.
* Default limit is 20 records, maximum 100.
* Default page is 1.

**Response**:

| Property          | Example                                                        | Description                                                                                |
| ----------------- | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| caller            | `{number: "01693608879", type: "realnumber"}`                  | Caller details, with username if type=user                                                 |
| callee            | `{number: "thutranhtkbee", type: "user", username: "thutran"}` | Callee details, with username if type=user                                                 |
| class             | `trunking`                                                     | Call type: `one_one` for internal, `trunking` for inbound/outbound calls                   |
| did\_number       | `02873019555`                                                  | DID number for the company. Null if internal or outbound                                   |
| direction         | `from_ab`                                                      | `from_ab` for outbound calls, `to_ab` for inbound                                          |
| status\_detail    | `SUCCESS`                                                      | Call status: `IVR` (system call not answered), `SUCCESS`, `CANCELLED`, `BUSY`, `UNSUCCESS` |
| duration\_seconds | 50                                                             | Duration of the call in seconds                                                            |
| unix\_timestamp   | 1519639917                                                     | Call timestamp in Unix format                                                              |
| billing\_seconds  | 43                                                             | Talk time for the call in seconds                                                          |
| recording         | `call_recording_dl5m5j5hfh4n8njj1oor.mp3`                      | File path for the recording, empty if no recording                                         |

**Limit**:\
The call history can only be retrieved for a maximum of 31 days.

***

**4. Get Call Recording**

* **URL**: `/oapi/v1/call/play_recording`
* **METHOD**: GET
* **Content Type**: `application/json`

**Parameters**:

| Property | Data Type | Description                       |
| -------- | --------- | --------------------------------- |
| appId    | String    | 3rd party identifier              |
| media    | String    | Recording file name               |
| hash     | String    | sha256(appId + media + appSecret) |

**Response**:

| Property | Example                                                                                                                                                                                                    | Description                    |
| -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
| media    | `https://abs1.antbuddy.com/nkrecord/call_recording_F5879958-1A1211E8-A55AA457-72574952%40172.16.0.204.mp3?AWSAccessKeyId=E7IPYE4LN28Y4I6T4400&Expires=1519640615&Signature=wXNENYxr0OJR8vA26kvOOwsttzU%3D` | URL link to the recording file |


---

# 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.antbuddy.us/integration-document-guide/antring/api-list.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.
