# Distribution days

GET `https://app.iteras.dk/api/distributiondays/`

The API key must allow "Distribution days".

Lists the information defined in Iteras for specific distribution days, such as which days a physical product is distributed.

The actual data returned depends on the setup of the distribution integration and related fields inside Iteras.

## Parameters

- `start_date` (date): Optional start date as `YYYY-MM-DD`, inclusive.
- `end_date` (date): Optional end date as `YYYY-MM-DD`, inclusive.

## Return value

The data returned is an object with an array of distribution days (possibly empty array). Each day object may contain the following attributes:

- `date` (date): The distribution day, as `YYYY-MM-DD`, e.g. `2023-05-03`.
- `data` (object): Field definition values set on the day, e.g. `{"publication_day": true}`.

  You can set any custom distribution day field, using its field id (the field name with a colon prepended, or its external identifier).

  [Log in](/login/?next=/api/docs/server/distributiondays.md), or send your API key as a bearer token, to see the custom distribution day fields set up for your account.

  A yes/no field (type `bool`) is `true` or `false`, and has no value when it isn't set. Set it with `true` or `false`, and clear it with `null`.

```http
GET /api/distributiondays/?start_date=2023-05-01&end_date=2023-05-05
```

```json
{
  "distributiondays": [
    {
        "date": "2023-05-03",
        "data": {
            "publication_day": true
        }
    },
    {
        "date": "2023-05-04",
        "data": {
            "publication_day": true,
            "interpreted_as_weekdays": [
                4,
                5
            ]
        }
    },
    {
        "date": "2023-05-05",
        "data": {
            "publication_day": false
        }
    }
  ]
}
```

## Errors

A malformed `start_date` or `end_date` returns a plain text HTTP 400 error that names the parameter.