How to Retrieve Messages by States and Date

 

The SCG messaging API allows to retrieve selected messages by state and creation date, using query parameters. Messages can be filtered by a single state or multiple states.

This document provides examples of how to retrieve messages by state and creation date, using the SCG messaging API.

 

Example #1: Retrieving messages created in a time range and by multiple states.

The following example shows how to retrieve all the SENT or DELIVERED messages, between Sep 27, 2022, and Sep 28, 2022. ISO timestamp URL-encoded format must be used, see format details here.

curl -L -X GET "https://api.syniverse.com/scg-external-api/api/v1/messaging/messages?\
offset=0&limit=20&\
sort=-created_date&\
created_date=%5B2022-09-27T00%3A00%3A00.000Z%2C2022-09-28T23%3A59%3A59.999Z%5D&\
state=SENT,DELIVERED" \
-H "Authorization: Bearer [TOKEN]"

 

Example #2: Retrieving messages created in a time range and by single state.

The following example shows how to retrieve all the DELIVERED messages, between July 27, 2022, and July 28, 2022.

curl -L -X GET "https://api.syniverse.com/scg-external-api/api/v1/messaging/messages?\
offset=0&\
limit=20&\
sort=-created_date&\
created_date=%5B2022-07-27T00%3A00%3A00.000Z%2C2022-07-28T23%3A59%3A59.999Z%5D&\
state=DELIVERED" \
-H "Authorization: Bearer [TOKEN]"

 

Additional resources

Resource

Description

https://www.urlencoder.org/

An online tool that allows you to Encode to URL-encoded format

https://www.urldecoder.org/

An online tool that allows you to Decode from URL-encoded format

https://www.epochconverter.com/

Epoch & Unix Timestamp Conversion Tools

 

 

Was this article helpful?
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.