This post is also available in:
By using this API you can get a list of all events related to SMS message processing. You can query for a specific time interval <from,to> when the event should have occurred.
POST
https://api.samba.ai/shop/trackpointId/export-sms-events
header: X-Api-Key: your-api-key
{"from": timestamp, "to": timestamp}
trackpointId
– Trackpoint ID of your eshopyour-api-key
– Samba API key for your eshopfrom, to
– [optional] timestamp of the event in milliseconds- If
from
parameter is omitted, then it is automatically set toto - 90 days
. - If
to
parameter is omitted, then it is automatically set to the minimum ofnow()
andfrom + 90 days
. - If both
to
andfrom
parameters are omitted, request body has to be set to{}
. In this case,to
is automatically set tonow()
andfrom
is set tonow() - 90 days
. - The history of the last 90 days is always available.
- If
RESPONSE
- format: JSON stream, one json object per line (application/json-seq)
{
"smsEvent":{
"trackpoint": trackpointId,
"userId": "user id",
"status": "STATUS",
"date": 1654853160310
},
"source":{
"type":"flow",
"campaign":{
"id": "campaignId",
"name": "campaignName"
},
"node":{
"id": "nodeId",
"name": "nodenName"
},
"sendDate":1654853160010
}
}
trackpoint
: trackpoint ID of the Samba accountuserId
: user ID of the SMS recipientstatus
: one of these events-
DELIVERED, ACCEPTED, EXPIRED, DELETED, UNDELIVERABLE, REJECTED, SKIPPED
-
date
: timestamp in milliseconds when the event occurredsource
: identification of the campaign"type": "one-off"
– One-off SMS campaign- campaign id, name
"type": "flow"
– SMS node in the Flow campaign- campaign id, name
- node id, name
sendDate
: timestamp in milliseconds when the message was sent
EXAMPLE
curl -d '{"from": 1673617501000, "to": 1676380261000}' -H 'X-Api-Key: key' 'https://api.samba.ai/shop/4541245641234564/export-sms-events'
{
"smsEvent":{
"trackpoint": 4541245641234564,
"userId": "123456",
"status": "DELIVERED",
"date": 1673763160310
},
"source":{
"type":"one-off",
"campaign":{
"id": "b2c8c642-ad39-11ed-afa1-0242ac120002",
"name": "Black Friday"
},
"sendDate":1673763160010
}
}
{
"smsEvent":{
"trackpoint": 4541245641234564,
"userId": "123456",
"status": "DELIVERED",
"date": 1673753160310
},
"source":{
"type":"flow",
"campaign":{
"id": "cd434c68-ad39-11ed-afa1-0242ac120002",
"name": "Retention"
},
"node":{
"id": "32411fb4-ad3a-11ed-afa1-0242ac120002",
"name": "Retention VIP SMS"
},
"sendDate":1673753160010
}
}