This page demonstrates sample queries for the /reports endpoint. You can modify and use these queries for your own purposes. Refer to the [API Reference](https://docs.foursquare.com/developer/reference/api-reference) for information on syntax and variables. You can use the "Report IDs" exposed in this endpoint to query the [/data](https://docs.foursquare.com/developer/reference/mapi-reports-examples-templates#api-reference-1) endpoint for metrics.

## Example Query

The below examples and templates are formatted as a JSON object, which is passed via the request's body.

Here is what a complete query to the Measurement API looks like. Again, notice the JSON contains all the parameters for your query.

### cURL

```curl
curl -X POST "https://mapi.placed.com/report" \
-H "Authorization: Basic <your_base64_encoded_credentials>" \
-H "Content-Type: application/json" \
-d '{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "partner" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER AGENCY OR PARTNER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}'
```

### PHP

```php
$url = "https://mapi.placed.com/report";
$ch = curl_init($url);
$cred = base64_encode("<your username>:<your password>");
$headers = array(
    "Authorization: Basic " . $cred,
    "Content-Type: application/json"
);
$payload = '{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "partner" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER AGENCY OR PARTNER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
$output = curl_exec($ch);
var_dump(json_decode($output));
curl_close($ch);
```

## General

### List All
To list all accessible campaigns, send an empty request body.

### JSON

```json
{}
```

### Reports By Advertiser

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "advertiser" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER ADVERTISER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Reports by Agency/Partner

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "partner" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER AGENCY OR PARTNER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Reports by Date

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "startDate" },\
          "operator": { "name": "BETWEEN" },\
          "values": [\
            "YYYY-MM-DD",\
            "YYYY-MM-DD"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Live Campaigns by Advertiser

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "status" },\
          "operator": { "name": "IN" },\
          "values": ["processing"]\
        },\
        {\
          "dimension": { "name": "advertiser" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER ADVERTISER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Live Campaigns by Agency/Media Partner

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "status" },\
          "operator": { "name": "IN" },\
          "values": ["processing"]\
        },\
        {\
          "dimension": { "name": "partner" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER AGENCY OR PARTNER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Only Overall/Summary Reports
This example returns only overall/summary reports for an advertiser (no custom or partner-level breakouts).

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "type" },\
          "operator": { "name": "IN" },\
          "values": ["overall"]\
        },\
        {\
          "dimension": { "name": "advertiser" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER ADVERTISER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Only Partner-Level Reports
Return partner-level reports from a specific advertiser (no custom or overall reports).

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "type" },\
          "operator": { "name": "IN" },\
          "values": ["partner"]\
        },\
        {\
          "dimension": { "name": "advertiser" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER ADVERTISER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Custom Reports
Return only "custom" reports for an advertiser (no overall or partner-level reports).

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "type" },\
          "operator": { "name": "IN" },\
          "values": ["custom"]\
        },\
        {\
          "dimension": { "name": "advertiser" },\
          "operator": { "name": "IN" },\
          "values": [\
            "ENTER ADVERTISER NAME HERE"\
          ]\
        }\
      ]\
    }\
  ]
}
```

### Reports by Report Name
Return list of reports which have a name similar to the request.

```json
{
  "page": 1,
  "filters": [\
    {\
      "predicates": [\
        {\
          "dimension": { "name": "name" },\
          "operator": { "name": "LIKE" },\
          "values": ["omnichannel"]\
        }\
      ]\
    }\
  ]
}
```
