# Usage

## Configuration

The `api_key`following is provided and configured:

```
export API_KEY=<api_key>
export API_HOST=<base_url>
```

> Instructions for using the commands `export`and `curl`are provided when running in terminal on Linux or Mac operating systems. In case you use another environment, please replace them with equivalent operations.

## API Structure

#### Request

A typical API call looks like this:

```bison
curl $BASE_URL.Misc/CurrentAccount \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $API_KEY" \
  -d '{}'
```

All requests use HTTPS protocol, POST method and pass values ​​in body using data format `application/json`. Required headers are `Content-Type`and `Authorization`.

#### Response

The response uses the data format `application/json`set in the header `Content-Type`. If the request is successful, the HTTP status code is `200`. If the request fails, the HTTP status code can be . `4xx`or . `5xx`with a structure similar to the following:

```json
{
  "code": "invalid_argument",
  "msg": "..."
}
```

#### Common errors

**400 Bad Request**

```json
{
  "code": "invalid_argument",
  "msg": "..."
}
```

Please double check the provided values.

**401 Unauthorized**

```json
{
  "code": "unauthenticated",
  "msg": "..."
}
```

Please double check that the request includes the `Authorization:<api_key>`correct headers.

```
{
    "code": "bad_route",
    "msg": "unexpected Content-Type: \"\""
}
```

Please check the path and header again `Content-Type: application/json`.
