Campaigns informations
Listing Campaigns
The list endpoint allows you to retrieve all campaigns accessible by your account.
Endpoint
GET /v1/campaigns
Filtering Parameters (Query Params)
You can refine your search using the following parameters:
- Pagination:
limit: Maximum number of items (Default: 20, Max: 20).page: Page number (Default: 1).
- Filters:
search: Text search on the campaign name.channel: Filter by channel (email,sms,push_notification).status: Filter by state (draft,published,processing,completed,failed,paused).type: Filter by typology (schedulableortransactional).
Request Example
curl -X GET "https://api.nmp.numberly.com/v1/campaigns?status=published&type=transactional&limit=20" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json"
API Response
The response returns a collection of simplified Campaign objects.
{
"objects": [
{
"id": 125,
"name": "Order Confirmation",
"type": "transactional",
"status": "published",
"channel": "email",
"created_at": "2023-10-01T10:00:00Z"
}
],
"pagination": {
"total": 1,
"limit": 20,
"page": 1
}
}
Retrieving a Specific Campaign
To obtain the complete details of a campaign, use its unique identifier (id).
This call is contextual: the JSON response structure adapts dynamically depending on whether the campaign is of type Schedulable (Marketing) or Transactional (Application).
Endpoint
GET /v1/campaigns/{id}
Request Example
curl -X GET "https://api.nmp.numberly.com/v1/campaigns/125" \
-H "Authorization: Bearer <ACCESS_TOKEN>"
API Response
The response contains the full configuration.
Type-Specific Fields:
- For a
transactionalcampaign: The response includes thecodefield. This functional identifier (e.g.,ORDER_CONFIRM_V1) serves as a reference when sending unitary messages. - For a
schedulablecampaign: The response includes thescheduleobject (details of one-shot or recurrent scheduling) and the targeting parameters (target).
Example for a transactional campaign:
{
"id": 125,
"name": "Order Confirmation",
"type": "transactional",
"status": "published",
"channel": "email",
"subject": "Your order is confirmed",
"code": "ORDER_CONFIRM_V1",
"sender": {
"name": "Customer Service",
"email": "no-reply@example.com"
},
"content": {
"id": 456,
"language": "en"
}
}
Track your campaigns
Campaigns on the NMP can be managed via the interface or programmatically. The API provides two dedicated endpoints to track the progress of sending orders in real-time, whether for a specific execution or for the history attached to a campaign.
Retrieve Statistics
This endpoint retrieves the statistics for a campaign based on its ID. Each value is a raw volume, aggregated across all send orders attached to the campaign.