API Documentation
Messaging
Reporting
- Reports
- Webhooks
Deprecated (EOL Jan 2025)
- Messaging Examples
- Reporting Examples
- Webhook Examples
Reports
Detailed Report
This endpoint creates a filtered message report.
GET
/
v1
/
reporting
/
detail
curl --location 'https://api.sbmg.app/v1/reporting/detail?start_date=2023-06-12&end_date=2023-06-14&metadata_key=myMetdataKey' \
--header 'x-api-key: YOUR_API_KEY'
{
"data": [
{
"account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
"destination_address": "6422999888",
"direction": "OUTBOUND",
"content": "Hello world",
"date": "2023-06-14T09:06:46Z",
"user_metadata": {
"myMetdataKey": "value 3"
}
},
{
"account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
"source_address": "6422999888",
"direction": "INBOUND",
"content": "Boom! Hello!",
"date": "2023-06-14T09:10:56Z",
"user_metadata": {
"myMetdataKey": "value 1"
}
},
]
}
Query
Start date of the report query. Format YYYY-MM-DD
for example: 2023-01-30
End date of the report query. Format YYYY-MM-DD
for example: 2023-01-30
Filter for messages containing a given metadata key.
curl --location 'https://api.sbmg.app/v1/reporting/detail?start_date=2023-06-12&end_date=2023-06-14&metadata_key=myMetdataKey' \
--header 'x-api-key: YOUR_API_KEY'
Response
An array of message log entries containing the following fields
The account ID associated with the message.
The phone number of the message recipient.
The direction of the message (e.g. “OUTBOUND”).
The content of the message.
The timestamp of the message in ISO 8601 format.
Additional metadata associated with the message.
{
"data": [
{
"account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
"destination_address": "6422999888",
"direction": "OUTBOUND",
"content": "Hello world",
"date": "2023-06-14T09:06:46Z",
"user_metadata": {
"myMetdataKey": "value 3"
}
},
{
"account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
"source_address": "6422999888",
"direction": "INBOUND",
"content": "Boom! Hello!",
"date": "2023-06-14T09:10:56Z",
"user_metadata": {
"myMetdataKey": "value 1"
}
},
]
}
curl --location 'https://api.sbmg.app/v1/reporting/detail?start_date=2023-06-12&end_date=2023-06-14&metadata_key=myMetdataKey' \
--header 'x-api-key: YOUR_API_KEY'
{
"data": [
{
"account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
"destination_address": "6422999888",
"direction": "OUTBOUND",
"content": "Hello world",
"date": "2023-06-14T09:06:46Z",
"user_metadata": {
"myMetdataKey": "value 3"
}
},
{
"account_id": "f123bf12-f23b-345d-bddc-5e6789abb0c",
"source_address": "6422999888",
"direction": "INBOUND",
"content": "Boom! Hello!",
"date": "2023-06-14T09:10:56Z",
"user_metadata": {
"myMetdataKey": "value 1"
}
},
]
}