Get last n transactions API

🚧

This is a tenant-specific API that is made available to specific clients. If you want to use this API, please contact your Webex Campaign representative to discuss your requirements. Your additional monthly charges will depend on how many days' transactions you need to have available with this API and your average daily outbound/inbound transactions count.

This API is used to get the last N transactions based on MSISDN or Email or Push ID. The transactions are sorted in ascending order by transaction date.

This API will also return the applicable message preview URLs along with customer transactions (SMS, Email, App Push Channels only). The Preview URLs will be included in the API response (over secure HTTPS protocol). A client will then be able to ingest these responses from this API and display this information within their own into their own Customer Care system. When a client’s customer care staff clicks on the Preview URL, they will be redirected to the Webex Campaign-generated HTTPS URL.

📘

This API will not work if you wish to use an Email id to fetch an SMS or MMS transaction or MSISDN to fetch an Email transaction although the target data contains MSISDN and Email headers.

📘

Know your endpoint

Based on the domain you use to log in to Webex Campaign, the endpoint domain for your API varies. For more information, refer to the Know Your API Endpoints section.

Go to the Postman Collection section to learn how to import a Postman collection. Click the below button, If you already know how to import a postman collection.

Run In Postman

Headers

The following table describes the request headers:

Request HeaderDescription
content-Typeapplication/json
authorizationAccess token or API Secret Key in Bearer format

Example: Bearer $(key)

Body Parameters

The following table describes the elements in the request body:

ParameterTypeMandatoryDescription
keyStringConditionallySpecifies MSISDN or Email ID or APP Device ID.
customer-idStringConditionallySpecifies either key or Customer ID.
countStringNoSpecifies the number of transactions to retrieve. A maximum of 50 transactions can be retrieved in a single API call.
from-dateStringNoSpecifies from the date in the format yyyy-MM-dd.
to-dateStringNoSpecifies to date in the format yyyy-MM-dd.
channelStringNoSpecifies the channel. The options are:

SMS
MMS
USSD
OBD
EMAIL
APP
message_previewStringNoThis parameter is used to get the URL of the preview message. To get the URL in the response, set this parameter to true (message_preview=true).

Request Example

https://<yourdomain>/campaignapi/resources/v3/[email protected]&customer-id=CID100&count=2&message_preview=true

Response Parameters

This API will return the following response parameters:

ParameterDescription
campaign-idReturns the Campaign ID.
campaign-nameReturns the Campaign Name.
deployment-idReturns the Deployment ID.
deployment-nameReturns the Deployment Name.
deployment-dateReturns the Transaction date. The date format will be in yyyy-MM-dd HH:mm:ss format and Time Zone will be in server’s time zone.
keyReturns the MSISDN or Email ID or APP Device ID.
customer-idReturns the customer ID.
transaction-statusReturns one of the following status values:

Successfully delivered to the Customer
Failed to deliver to the Customer
Attempted Send
Expired
Duplicate
Invalid
Partial Delivery
Notpushed, InternalException
Attempted Send successfully
Pushed to Gateways
Notpushed, GlobalDND
Notpushed, ChannelDND
Notpushed, CategoryDND
Notpushed, CampaignDND
Notpushed, DeploymentBlackListDND
Notpushed, Controlgroup
Notpushed, PolicyBreached
Notpushed, Filtersapplied
Notpushed, Abandoned
Notpushed, DeploymentStopped
Notpushed, Calendartimedout
Notpushed, Others
Notpushed, Limit reached
Notpushed, Runtimefilter
Email, hardbounced
EmailSoftbounced
Email, Mailblocks
Email, ISPcomplaints
DNDAddition
DNDRemoval
Email Unsubscribe
MSISDN Unsubscribe
EventProcessedSuccess
EventProcessedFailed
MOProcessedSuccess
MOProcessedFailed
Email,Opened
Email, LinkClicked
ActionProcessedSuccess
ActionProcessedFailed
SMS, LinkClicked
USSD, DTMF Click Transaction
MMS, LinkClicked
OBD Success-Completed
OBD Success-In Complete
OBD Failed -NotAnswered
OBD Failed -Rejected
OBD Failed -Dropped
OBD Failed -Busy
OBD Failed - Out of Reach
OBD Failed - Switched Off
OBD Failed - Others
OBD Failed-Number not obtainable
OBD Failed-Number not in service
App notification, Opened
Landing Page Open
* Landing Page Submit
error-codeReturns the error code of the transaction.
channelReturns the channel name.

0-SMS
1-MMS
3-USSD
6-OBD
7-EMAIL
8-APP
descriptionReturns the description of the response.
transaction-idReturns the unique Transaction ID of the operation.
link-transaction-idReturns the pushed transaction id for the responses.
codeReturns the response code.
msg_preview_urlReturns the URL to preview the message.

Failure Response Codes

The API will return code within the response as per the following table in case of failure scenarios.

HTTP Status CodeCode within API ResponseDescription
2001010The request was not processed.
401430Authorization failed. This resource is not allowed to access using this TOKEN or KEY
498Invalid token or Access token expired
405405Method not supported
429429Too many requests. Throttle limit reached for the time window.
499499Request failed. Check the exact reason of failure in application code and description of error stream.
500500Internal server error
1001Invalid input JSON
1002Mandatory field missing such as key _or _customer id.
Language