Campaign statistics with the APIs
When a campaign is in the active
, stopped
or archived
phase, you can do view campaign statistics:
curl -X GET https://api.us-east-1.mbedcloud.com/v3/update-campaigns/{campaign_id}/statistics \
-H "Authorization: Bearer <access_key>" \
You get the following information:
{
"object": "list",
"limit": 50,
"after": null,
"order": "ASC",
"has_more": false,
"data": [
{
"id": "fail",
"campaign_id": "0172a385c5490000000000010010014e",
"summary_status": "FAIL",
"count": 1,
"created_at": "2020-06-11T14:57:25.673081Z",
"object": "summary_status"
},
{
"id": "info",
"campaign_id": "0172a385c5490000000000010010014e",
"summary_status": "INFO",
"count": 0,
"created_at": "2020-06-11T14:57:25.673107Z",
"object": "summary_status"
},
{
"id": "skipped",
"campaign_id": "0172a385c5490000000000010010014e",
"summary_status": "SKIPPED",
"count": 0,
"created_at": "2020-06-11T14:57:25.673114Z",
"object": "summary_status"
},
{
"id": "success",
"campaign_id": "0172a385c5490000000000010010014e",
"summary_status": "SUCCESS",
"count": 0,
"created_at": "2020-06-11T14:57:25.673119Z",
"object": "summary_status"
}
]
}
This gives you a summary of the campaign:
- id: ID of the event type description. Possible values are fail, success, info and skipped.
- campaign_id: ID of the associated campaign.
- summary_status: The event type description. Possible values are FAIL, SUCCESS, INFO and SKIPPED. For more information on a device's status, see Event log codes.
- count: How many devices in the campaign have the given summary status.