You can use this API to retrieve a paginated list of SMS campaigns available in your account. You can use the response to browse campaigns, obtain campaign IDs, and retrieve basic campaign information before requesting detailed analytics.
Endpoints and Headers
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 |
|---|---|---|---|
page | The page number to return. Defaults to 1. If specified, the value must be greater than or equal to 1. | Integer | No |
perPage | The number of items to return per page. If not specified, the system default is used. Valid values range from 1 to 100. | Integer | No |
Sample Request
The following sample retrieves the first page of SMS campaigns using the default pagination settings.
curl --location 'https://gw.useinsider.com/api/sms/v2/analytics/list' \
--header 'Authorization: Bearer eyJhbGc...' \
--header 'Content-Type: application/json' \
--data '{
"startTime": 1747094400,
"endTime": 1747180800,
}'Sample Responses
200 OK
This status indicates that the request has been completed successfully.
{
"current_page":1,
"data":[
{
"campaignId":12692,
"campaignName":"Sample Campaign 3",
"startTime":1727770020,
"status":"completed"
},
{
"campaignId":12691,
"campaignName":"Sample Campaign 2",
"startTime":1727770260,
"status":"completed"
},
{
"campaignId":12689,
"campaignName":"Sample Campaign 1",
"startTime":1727770356,
"status":"completed"
},
],
"first_page_url":"https://sms.useinsider.com/analytics/v1/list?perPage=10&page=1",
"from":1,
"last_page":160,
"last_page_url":"https://sms.useinsider.com/analytics/v1/list?perPage=10&page=160",
"next_page_url":"https://sms.useinsider.com/analytics/v1/list?perPage=10&page=2",
"per_page":10,
"prev_page_url":null,
"to":10,
"totalCampaign":1596 }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. |