QUERY v2/EviSMS/Batches
HTTP Method: QUERY
Description:
This endpoint retrieves a list of all bulk SMS batches available for a specific SiteId
. It supports filtering by state, limiting the number of results, and pagination via a cursor.
Input Parameters
OwnerSiteId (Guid)
Unique identifier of the site for which the data is being retrieved.
OwnerEmail (string, optional)
Email of the owner of the batches to filter the results.
State (string, optional)
Filters results by the state of the batches (e.g.,
Draft
,Scheduled
,Completed
).
Cursor (string, optional)
Token representing the state of a previous query. It enables the continuation of result retrieval from where the last query ended.
Limit (int)
Specifies the maximum number of results to return. Must be between
1
and100
.
Order (int, optional)
Determines the sorting order of the results:
0
for ascending order.1
for descending order.
Output Parameters
Cursor (string)
The cursor token for this query, which can be used in subsequent requests to continue retrieving results.
HashMoreResults (boolean):
This field indicates if there are more results that are not shown in the list.
Results (IEnumerable<Batch>)
A collection of batch records matching the query parameters. Each batch has the following properties:
State (string): The current state of the batch (e.g.,
Draft
,Scheduled
).Description (string): A descriptive text identifying the batch.
TotalCount (int): Total number of recipients in the batch.
ScheduledFor (datetime): The date and time the batch is scheduled for processing.
StartedOn (datetime): The date and time the batch started processing.
BatchId (Guid): Unique identifier of the batch.
Submitter (string): User who created the batch.
SubmitterId (Guid): Identifier of the issuing user.
SiteId (Guid): Identifier of the site to which the lot belongs
SiteName (string): Name of the site to which the lot belongs
CreationDate (DateTime): Date of batch creation.
StartedOn (DateTime): Date on which batch processing begins.
ProcessedOn (DateTime): Date on which the batch process was completed.
TotalSent (int): Number of EviSMS sent correctly.
TotalFailed (int): Number of failed EviSMS during the sending process.
Request Example
Basic Query:
GET /v2/EviSMS/Batches?OwnerSiteId=6fda9a24-03c9-4b5b-8721-645cfdc9f4d8&Limit=50
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Query with Filters:
GET /v2/EviSMS/Batches?OwnerSiteId=6fda9a24-03c9-4b5b-8721-645cfdc9f4d8&State=Scheduled&Limit=20&Order=1&OwnerEmail=owner@example.com
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Query with Cursor:
GET /v2/EviSMS/Batches?OwnerSiteId=6fda9a24-03c9-4b5b-8721-645cfdc9f4d8&Cursor=eyJwb3NpdGlvbiI6NTA=&Limit=20
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Response Example
Notes
Cursor for Pagination:
The
Cursor
token returned in the response must be used in subsequent queries to fetch the next set of results.Example: If the first query returns 50 results and a cursor, use the cursor in the next query to fetch the following 50 results.
Limit Validation:
Ensure the
Limit
parameter is between1
and100
. Requests exceeding this range will return an error.
Sorting Order:
Use the
Order
parameter to control sorting:0
for ascending (e.g., oldest to newest).1
for descending (e.g., newest to oldest).
Filtering Flexibility:
Use
OwnerEmail
andState
for granular filtering to retrieve specific records efficiently.