# Get an account's posting times

The account's weekly posting times, the queue that `POST /posts` with `queue. GET /accounts/{accountId}/queue.

`GET https://api.tiktornado.com/api/v1/accounts/{accountId}/queue`

Scope: `accounts:read`.

The account's weekly posting times, the queue that `POST /posts` with `queue: true` fills. Sorted by day, then time. An account with no times answers `{"timeZone": null, "slots": []}`.

## Path parameters

- `accountId` string, required: The account, from `GET /accounts`. Matches `^[A-Za-z0-9]{1,64}$`.

## Examples

```bash
curl 'https://api.tiktornado.com/api/v1/accounts/j971x2c4ajrq0w8sd5e8fxz3a57v2k8m/queue' \
  -H "Authorization: Bearer $TIKTORNADO_API_KEY"
```

```js
const response = await fetch("https://api.tiktornado.com/api/v1/accounts/j971x2c4ajrq0w8sd5e8fxz3a57v2k8m/queue", {
  headers: {
    Authorization: `Bearer ${process.env.TIKTORNADO_API_KEY}`,
  },
});
const data = await response.json();
```

```python
import os

import requests

response = requests.get(
    "https://api.tiktornado.com/api/v1/accounts/j971x2c4ajrq0w8sd5e8fxz3a57v2k8m/queue",
    headers={
        "Authorization": f"Bearer {os.environ['TIKTORNADO_API_KEY']}",
    },
)
data = response.json()
```

## Response 200

The account's posting times.

- `timeZone` string or null, required: The IANA time zone the times are in, or `null` when the account has no posting times.
- `slots` array of objects, required: The posting times, sorted by day, then time.
  - `day` integer, required: 0 for Monday through 6 for Sunday. 0 to 6.
  - `minute` integer, required: Minutes after midnight, for example 540 for 9:00 and 1080 for 18:00. 0 to 1,439.

Monday and Wednesday at 9:00, Friday at 18:00, New York time:

```json
{
  "timeZone": "America/New_York",
  "slots": [
    {
      "day": 0,
      "minute": 540
    },
    {
      "day": 2,
      "minute": 540
    },
    {
      "day": 4,
      "minute": 1080
    }
  ]
}
```

No posting times:

```json
{
  "timeZone": null,
  "slots": []
}
```

## Errors

| Status | Reason | Message |
| --- | --- | --- |
| 401 | `api_key_invalid` | This API key isn't valid. Check it, or create a new one in the app. |
| 403 | `access_locked` | Your subscription isn't active, so this can't be changed right now. Visit Billing to fix it. |
| 403 | `api_scope_missing` | This API key can't do this. Create a key with the access it needs in the app. |
| 404 | `not_found` | We couldn't find this. |
| 429 | `slow_down` | You're going a bit fast. Wait a moment and try again. |
| 500 | `unknown_error` | Something went wrong on our side. We're on it. |
| 503 | `service_unavailable` | Something went wrong on our side. We're on it. |