# Troubleshooting Notes

1. We will only return data for the past 90 days when requesting days. If you do not specify `days`, `start`, or `end`, it will return lifetime data.

2. Network counts cannot be requested with bulk counts.

3. If `days` and `start`/ `end` are both present in a request (not recommended) `start`/ `end` will take precedence.

## API Fields

### advertisers

- **Type**: array of int32s
- **Description**: IDs of advertisers you want data on.

### campaigns

- **Type**: array of int32s
- **Description**: IDs of campaigns you want data on.

### flights

- **Type**: array of int32s
- **Description**: IDs of flights you want data on.

### ads

- **Type**: array of int32s
- **Description**: IDs of ads you want data on.

### days

- **Type**: string
- **Description**: Request data broken out by day for past number of days (current day is 0).

### start

- **Type**: string
- **Description**: Day you want to start getting data from in YYYY-MM-DD.

### end

- **Type**: string
- **Description**: Day you want to end getting data from in YYYY-MM-DD.

## Example Requests

### Basic Request
```shell
curl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H 'Content-Type:application/json' https://api.kevel.co/v1/instantcounts/bulk -d '{"advertisers": [123,456], "campaigns": [789,123], "flights": [456,789], "ads": [123,456]}'
```

### With Days
```shell
curl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H 'Content-Type:application/json' https://api.kevel.co/v1/instantcounts/bulk -d '{"advertisers": [123,456], "campaigns": [789,123], "flights": [456,789], "ads": [123,456], "days":42}'
```

### With Start/End
```shell
curl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H 'Content-Type:application/json' https://api.kevel.co/v1/instantcounts/bulk -d '{"advertisers": [123], "campaigns": [456], "flights": [789], "ads": [123], "start":"2016-04-20", "end":"2016-04-21"}'
```

## Response Structure
```json
{
  "advertisers": {
    "123": {
      "impressions": 3097,
      "conversions": 12,
      "revenue": 49.11279,
      "clicks": 149
    },
    "456": {
      "impressions": 100,
      "conversions": 0,
      "revenue": 0.011,
      "clicks": 0
    }
  },
  "campaigns": {
    "123": {
      "impressions": 123,
      "conversions": 0,
      "revenue": 0.117,
      "clicks": 0
    },
    "789": {
      "impressions": 100,
      "conversions": 0,
      "revenue": 0.011,
      "clicks": 0
    }
  },
  "flights": {
    "456": {
      "impressions": 0,
      "conversions": 0,
      "revenue": 0,
      "clicks": 0
    },
    "789": {
      "impressions": 106,
      "conversions": 0,
      "revenue": 0.106,
      "clicks": 0
    }
  },
  "ads": {
    "123": {
      "impressions": 0,
      "conversions": 0,
      "revenue": 0,
      "clicks": 0
    },
    "456": {
      "impressions": 106,
      "conversions": 0,
      "revenue": 0.106,
      "clicks": 0
    }
  }
}
```
