Get specific history
Get a single sent message from your history.
Both the messageid returned when sending and the public ID
(lid_...) from Get history are accepted.
Base URL:
GET: https://api.smsgatewayapi.com/v1/message/logging/{messageID}Example:
GET: https://api.smsgatewayapi.com/v1/message/logging/h2md1ewkyzjkuyn9ak7pryw1evtyw3x
| Parameter | Input | Description | |
|---|---|---|---|
| client_id | API client ID | Login and go to 'Developer' - 'API & Webhooks' - 'API-credentials' to find the API keys | Required |
| client_secret | API client secret | Login and go to 'Developer' - 'API & Webhooks' - 'API-credentials' to find the API keys | Required |
| messageID | message ID | The messageid returned when sending, or a public ID (lid_...) | Required |
<?php
//PHP - cURL
$ch = curl_init();
$url = "https://api.smsgatewayapi.com/v1/message/logging/{messageID}";
$client_id = "XXX"; // Your API client ID (required)
$client_secret = "YYY"; // Your API client secret (required)
curl_setopt($ch, CURLOPT_URL, "$url");
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-Client-Id: $client_id",
"X-Client-Secret: $client_secret",
"Content-Type: application/json",
]);
$response = curl_exec($ch);
?>
Example success response:
{
"message": {
"ID": 19951477,
"public_ID": "lid_46f4c0e37652d4149352e1cb54fed50b",
"message_ID": "dhnwkj8adbz646o5b4y3ureut1l6eq",
"message": "Hello World",
"to": "{nr}",
"sender": "YourName",
"customer_reference": null,
"date": "2026-08-01 11:24:02",
"date_iso8601": "2026-08-01T11:24:02+02:00",
"date_utc": "2026-08-01 09:24:02",
"date_utc_iso8601": "2026-08-01T09:24:02+00:00",
"type": "single",
"message_length": 1,
"message_cost": 1,
"message_cost_currency": "credits",
"memo": null,
"unicode": 0,
"status": "DELIVERED",
"status_date": "2026-08-01 11:24:05",
"status_date_iso8601": "2026-08-01T11:24:05+02:00",
"status_date_utc": "2026-08-01 09:24:05",
"status_date_utc_iso8601": "2026-08-01T09:24:05+00:00",
"response": {
"read": true,
"read_date": "2026-08-01 11:27:37",
"response": "Example response"
}
}
}
Invalid response:
Response when the message ID doesn’t exist: http status code 404 (Not Found).