# Campaign statistics

## getCampaignStats

Retrieve statistics of a particular campaign for a specific time period.

`POST` `https://api.pushwoosh.com/json/1.3/getCampaignStats`

##### Request body parameters
| Name    <div style="width:150px"></div>        | Required | Type   | Description                                                                                       |
|------------|----------|--------|---------------------------------------------------------------------------------------------------|
| `auth`     | Yes      | string | [API access token](/developer/api-reference/api-access-token/) from Pushwoosh Control Panel.    |
| `campaign` | Yes      | string | Unique [campaign code](/developer/api-reference/api-identifiers/#campaign-code).                                                                              |
| `datefrom` | Yes      | string | Start of the reporting period (formatted as `Y-m-d H:i:s`).                                      |
| `dateto`   | Yes      | string | End of the reporting period (formatted as `Y-m-d H:i:s`).                                        |

##### Example request

```json
{
  "request": {
    "auth": "yxoPUlwqm…………pIyEX4H",     // required. API access token from Pushwoosh Control Panel
    "campaign": "XXXXX-XXXXX",          // required. Campaign code
    "datefrom": "2024-05-01 00:00:00",  // required. Start of reporting period
    "dateto": "2024-05-10 23:59:59"     // required. End of reporting period
  }
}
```
##### Example response
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "request_id": "a3ef436445abfdef6255cc2f65ce7614"
  }
}
```


#### Retrieving scheduled request results

<Aside type="caution" title="Important">
Like every scheduled request, `/getCampaignStats` requires an additional [`/getResults`](/developer/api-reference/scheduled-requests#getresults) request.
</Aside>


<details>
  <summary>Example getResults response</summary>
```json
{
  "status_code": 200,
  "status_message": "OK",
  "response": {
    "formatter": "hourly",
    "rows": [{
      "count": 0,
      "action": "open",
      "datetime": "2024-05-09 00:00:00",
      "platformid": 14
    }, {
      "count": 0,
      "action": "send",
      "datetime": "2024-05-09 00:00:00",
      "platformid": 14
    }, {
      "count": 0,
      "action": "send",
      "datetime": "2024-05-11 00:00:00",
      "platformid": 14
    }],

    // conversion (if goal tracking is allowed)
    "conversion": {
      "send": 10,
      "open": 5,
      "events": [{
        "uid": 1,
        "event": "event name",
        "hits": 5,
        "conversion": "100%",
        "revenue": 15.34
      }]
    }
  }
}
```
</details>