### API Documentation for /reports Endpoint

The /reports endpoint allows you to find and retrieve attribution report IDs and associated metadata.

# Formatted Responses

## Format

The default responses for these endpoints are delivered in **JSON** format. To request a CSV formatted response, simply append the format to the URL as shown:

- JSON (default): [https://mapi.placed.com/reports](https://mapi.placed.com/reports)
- CSV: [https://mapi.placed.com/reports.csv](https://mapi.placed.com/reports.csv)

## Pagination

The response from the /reports endpoint is paginated, returning the first page of results with 50 rows per page by default. The result page can be changed using the `page` key, and the result count per page can be increased to up to 100 rows using the `perPage` key. Both keys are described in the [Request](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#request) table below.

# Endpoint

| Endpoint | Verb | Body | Accepts |
| --- | --- | --- | --- |
| `/reports` | `POST` | `Request` | JSON |

## Request

| key | type | description |
| --- | --- | --- |
| `filters` | Array | Array of [`filter`](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#filter) |
| `page` | Integer | Reports page index, default = 1 |
| `perPage` | Integer | Max number of reports per page, default = 50 |
| `options` | Object | [`requestOptions`](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#requestoptions) |

### Filter

| key | type | description |
| --- | --- | --- |
| `predicates` | Array | Array of [Predicate](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#predicate) |

### Predicate

| key | type | description |
| --- | --- | --- |
| `dimension` | Object | [Dimension](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#dimension) |
| `operator` | Object | [Operator](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#operator) |
| `values` | Array | Array of values to be used by the operator function |

### Dimension

| key | type | description |
| --- | --- | --- |
| `name` | String | `name`, `type`, `status`, `startDate`, `endDate`, `campaign`, `advertiser`, `partner` |

### Operator

| key | type | description |
| --- | --- | --- |
| `name` | String | `IN`, `NOT_IN`, `BETWEEN`, `LIKE`, `GREATER_THAN`, `LESS_THAN` |

### Request Options

| key | type | description |
| --- | --- | --- |
| `includeQueryInResponse` | Boolean | Set to `true` if you would like your request/query included in your response. |

## Response

| key | type | description |
| --- | --- | --- |
| `reports` | Array | Array of [report](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#report) |
| `page` | Integer | Page index. |
| `perPage` | Integer | Max number of reports per page, default = 50 |
| `totalPages` | Integer | Number of pages of results that are available |
| `query` | Object | [Request](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#request). Included if original request's includeQueryInRepsonse option is set to "true" |

### Report

| key | type | description |
| --- | --- | --- |
| `id` | String |  |
| `name` | String |  |
| `type` | String | `OVERALL`, `PARTNER`, `CUSTOM` |
| `status` | String | `COMPLETED`, `PENDING`, `PROCESSING` |
| `startDate` | String | Formatted Date, `YYY-MM-DD` |
| `endDate` | String | Formatted Date, `YYY-MM-DD` |
| `lastUpdateDate` | String | Formatted Date, `YYY-MM-DD` |
| `campaign` | Object | [Campaign](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#campaign) |
| `advertiser` | Object | [Advertiser](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#advertiser) |
| `partner` | Object | [Partner](https://docs.foursquare.com/developer/reference/mapi-reports-api-reference#partner) |

### Campaign

| key | type | description |
| --- | --- | --- |
| `name` | String |  |

### Advertiser

| key | type | description |
| --- | --- | --- |
| `name` | String |  |

### Partner

| key | type | description |
| --- | --- | --- |
| `name` | String |  |
