You can use this API to retrieve detailed analytics for a specific SMS campaign. You can use the response to analyze delivery, engagement, conversion, unsubscribe, and message status metrics for an individual campaign.
Endpoints and Headers
POST https://gw.useinsider.com/api/sms/v2/analytics/campaign
Visit our Postman collection to test this request.
Headers
Header | Sample Value | Description |
|---|---|---|
Authorization | Bearer | The Bearer access token obtained from the OAuth token endpoint. Required for all authenticated API requests. Refer to Generate an OAuth 2.0 Token for SMS to generate your OAuth 2.0 token. |
Content-Type | application/json | Specifies that the request body is sent in JSON format. |
Body Parameters
Parameter | Description | Data Type | Required |
|---|---|---|---|
campaignId | The numeric ID of an SMS campaign in your account. The value must be greater than or equal to 1 and must correspond to an SMS campaign. IDs belonging to other campaign types are not supported. | Number | Yes |
Sample Request
The following sample retrieves analytics for the SMS campaign with the specified campaign ID.
curl --location 'https://gw.useinsider.com/api/sms/v2/analytics/campaign' \
--header 'Authorization: Bearer eyJhbGc...' \
--header 'Content-Type: application/json' \
--data '{ "campaignId": 12345 }'Sample Responses
200 OK
This status indicates that the request has been completed successfully.
{
"targeted":0,
"messageParts":0,
"sent":0,
"dropped":0,
"delivery":{
"count":{
"delivered":0,
"undelivered":0
},
"rate":"0.00%"
},
"clickThrough":{
"clicks":0,
"rate":"0.00%",
"revenue":"0"
},
"conversion":{
"conversions":0,
"rate":"0.00%"
},
"unsubscribers":{
"count":0,
"rate":"0.00%"
},
"droppedMessages":{
"frequencyCapped":{
"count":0,
"rate":"0.00%"
},
"duplicates":{
"count":0,
"rate":"0.00%"
},
"internalErrors":{
"count":0,
"rate":"0.00%"
},
"countryCodeDrops":{
"count":0,
"rate":"0.00%"
},
"invalidPhoneNumbers":{
"count":0,
"rate":"0.00%"
},
"couponListDrops":{
"count":0,
"rate":"0.00%"
},
"silentHours":{
"count":0,
"rate":"0.00%"
}
},
"undeliveredMessages":{
"carrierViolations":{
"count":0,
"rate":"0.00%",
"details":[
]
},
"hardBounces":{
"count":0,
"rate":"0.00%",
"details":[
]
},
"softBounces":{
"count":0,
"rate":"0.00%",
"details":[
]
},
"deliveryFailures":{
"count":0,
"rate":"0.00%",
"details":[
]
},
"deliveryReportMissing":{
"count":0,
"rate":"0.00%"
}
}
}You can refer to SMS Campaign Analytics Metrics for further details.
422 Unprocessable Entity
Returned when one or more request parameters fail validation.
{
"message": "The given data was invalid.",
"errors": {
"startTime": [
"The startTime parameter must be a valid integer."
],
"endTime": [
"The endTime parameter must be earlier than the current time."
]
}
}Common validation messages:
Trigger | Validation Message |
|---|---|
Missing startTime or endTime | The startTime parameter is required. |
startTime is not a 10-digit integer | The startTime parameter must be exactly 10 digits. |
endTime is in the future | The endTime parameter must be earlier than the current time. |
startTime is older than 1 year | The startTime parameter must be within the last 1 year. |
startTime is later than endTime | The startTime parameter must be earlier than the endTime parameter. |
campaignId does not belong to an SMS campaign | The campaign ID must be a valid SMS campaign. |
perPage is greater than 100 | The perPage parameter must be at most 100. |