# Introduction

The API uses the standard HTTP verbs over `HTTP/1.1` and returns JSON (`application/json`) or XML (`application/xml`) responses accompanied by standard HTTP error codes.

The Sway Charts REST API supports only the following **HTTP verbs**:

* <img src="https://api.swaycharts.io/developers/GET.png" alt="GET" data-size="line"> - to retrieve data from the system; this method doesn't change the system in any way and is considered idempotent.
* <img src="https://api.swaycharts.io/developers/POST.png" alt="POST" data-size="line"> - to create new entities or perform actions in the system; this method changes the system state and cannot be repeated without undesired side effects; method is considered not idempotent.
* <img src="https://api.swaycharts.io/developers/PUT.png" alt="PUT" data-size="line"> - to update the complete state of an entity. This method changes system state and is idempotent.
* <img src="https://api.swaycharts.io/developers/DELETE.png" alt="DELETE" data-size="line"> - to delete or discontinue an entity. This method changes the system state and is idempotent.

All the requests are made strictly over HTTPS, calls over HTTP will be rejected. Unless specified, all the requests require authentication - see [Basic Auth](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=basic-auth) and [HMAC auth](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=hmac-auth).

The Sway Charts REST API is a synchronous request-response API. As the API is based on HTTP protocol, no realtime notifications are provided. Push notifications are described in a [separate document](https://api.swaycharts.io/developers/#/DXtrade-Push-API).

The Sway Charts REST API provides functionality for:

* **Non-disclosed integration** when there is a single source of orders which uses the API to trade on behalf of multiple users who are not visible to the Sway Charts platform. All the trades a partner makes are allocated on a single account in the system.
* **"Gateway" disclosed integration** when there is a single source of orders which uses the API to trade on behalf of multiple users who are visible to the platform. All the trades a partner makes are allocated on multiple accounts in the system; there is a record for each account. But the orders and information flows via a single connection; clients are not connected to the system directly but are connected to partner's system.
* **"Direct" disclosed integration** when partner's users are connected directly to the Sway Charts backend; there is a separate connection for each user. The system has a record for each account.

JSON is the default representation and request format. If the `Accept` header sent by the client prohibits both XML and JSON format, the server responds with the _406 Not Acceptable_ status code. See also [error handling](https://api.swaycharts.io/developers/#/DXtrade-REST-API?id=errors).

The Sway Charts REST API supports the standard HTTP `gzip` and `deflate` compression methods. Client's preference is communicated via the `Accept-Encoding` header.
