Retrieve Statistics
Endpoint
GET {subdomain}.api.numberly.com/v1/campaigns/{id}/statistics
Parameters
| Location | Name | Required | Type | Description |
|---|---|---|---|---|
| Path | id | Yes | string | The campaign ID (retrievable via /v1/campaigns, see Campaign Information). |
| Query | start_date | No | date-time | Only counts sends started from this date inclusive (RFC3339 UTC format). |
| Query | end_date | No | date-time | Only counts sends started up to this date inclusive (RFC3339 UTC format). |
Note: start_date and end_date filter on the campaign send date. They are typically used to compare the performance of a recurring campaign across different time periods.
Request Example
This example retrieves the statistics for a campaign for the month of November 2024.
curl -X GET "https://{subdomain}.api.numberly.com/v1/campaigns/125/statistics?start_date=2024-11-01T00:00:00Z&end_date=2024-11-30T23:59:59Z" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json"
API Response
The response returns an object containing the campaign ID, its channel, and a statistics object detailing the aggregated volumes.
Key fields of statistics:
sent: Total volume of sent messages.delivered: Volume of successfully delivered messages.undelivered: Breakdown of undelivered messages —total, broken down intosoft_bounces(temporary failure) andhard_bounces(permanent failure).unsubscribed: Number of unsubscribes generated by the campaign.total_opens/unique_opens: Total number of opens and number of unique openers.total_clicks/unique_clicks: Total number of clicks and number of unique clickers.unsubscribed_unique_clicks: Number of unique clickers who used an unsubscribe link.links: The links array provides a breakdown of click volumes for each individual tracked link. Each link has a distinct identifier (id). When a campaign content has multiple versions, the same destination URL may appear several times. You can differentiate between these versions using the idm field, which corresponds to the unique identifier of the specific content version carrying the link
{
"id": 125,
"channel": "email",
"statistics": {
"sent": 1000,
"delivered": 950,
"undelivered": {
"total": 50,
"soft_bounces": 30,
"hard_bounces": 20
},
"unsubscribed": 5,
"total_opens": 500,
"unique_opens": 400,
"total_clicks": 100,
"unique_clicks": 80,
"unsubscribed_unique_clicks": 4,
"links": [
{
"id": 101,
"idm": 4001,
"total_clicks": 60,
"url": "https://example.com/offer"
},
{
"id": 102,
"idm": 4002,
"total_clicks": 40,
"url": "https://example.com/offer"
}
]
}
}
Important note: If the campaign channel does not (yet) support statistics calculation, the API returns a 501 Not Implemented status. If the campaign ID does not exist, it returns 404 Not Found.
Use Cases
- Reporting Dashboard: Aggregate statistics across multiple campaigns to build an overall performance view.
- Derived Rate Calculations: Using raw volumes, calculate metrics such as open rate (
unique_opens / delivered) or click rate (unique_clicks / unique_opens). - Period Comparison: For recurring campaigns, call the endpoint with distinct
start_date/end_datepairs to compare two send waves.
Campaigns informations
The NMP API enables comprehensive management of the campaign lifecycle. Whether created via the interface or programmatically, it is essential to be able to retrieve their technical information (statuses, identifiers, configuration) for monitoring or orchestration.
Create a list
This technical guide details the process of programmatically creating contact lists via the NMP API. Currently, the API supports the management of static lists.