Get Message Statistics
The Get Message Statistics method allows you to get detailed information about a specific email message by its unique identifier.
Important!
The maximum number of emails that can be checked per request is 100.
Important!
For each email, a maximum of 100 events that the contact has performed with the email are collected.
Request
IMPORTANT: Do not send more than 10 concurrent API requests.
Body Example
{
"ids": [
"YOUR_messageId_1",
"YOUR_messageId_2",
"YOUR_messageId_3"
]
}
Parameters
Title | Type | Default | Description |
---|---|---|---|
ids required
|
array |
List of |
Response
{
"emails":[
{
"id":"5d914c3dd132d5f45a4e3670",
"status":"delivered",
"from":{
"email":"user@senderdomain.com",
"name":"Sender Name"
},
"subject":"Hello subject",
"to":{
"name":"Contact Name",
"email":"user@recepientdomain.com"
},
"headers":{
"X-Additional-Header":"additional-header-value"
},
"text":"",
"html":"",
"events":[
{
"event":"read",
"datetime":"2019-09-30 00:42:54"
}
]
}
],
"result":true
}
Parameters
Title | Type | Description |
---|---|---|
Return value |
object |
You will get a list of successfully fetched messages and related events. |
result |
boolean |
The value indicates that the request was successful:
|
emails.id |
string |
The message unique identification number in the Wooxy system. |
emails.status |
string |
The send status is assigned as soon as Wooxy sends the message, and it is accepted by the recipient ISP server:
|
emails.from |
object |
An array of sender information. |
emails.from.email |
string |
The sender email address name. |
emails.from.name |
string |
Optional from name to be used. |
emails.subject |
string |
The message subject. |
emails.to |
object |
An array of recipient information. |
emails.to.name |
string |
The email address of the recipient. |
emails.to.email |
string |
The optional display name of the recipient. |
emails.headers |
object |
Optional extra headers to add to the message (most headers are allowed). |
emails.text |
string |
Optional plain text content that was sent. |
emails.html |
string |
The full HTML content that was sent. |
emails.events |
array |
Email statistics includes detailed information on each message in the account. |
emails.events.event |
string |
It shows the action that the contact has taken with the email:
|
emails.events.datetime |
string |
It shows the moment in time when the contact has taken an action with the email. |
Method Errors
{
"result": false,
"errors":[
"Error description text"
]
}
Error |
---|
“Argument ids must be an array of strings” |
“Argument ids can not be empty” |
“each id must be a non-empty string” |
“ids count must be less or equal 100” |
“Invalid authorization token!” |
“Internal server error” |
“Bad Request” |
“no matches found for access token {accessToken}” |
“user {id} not enabled” |
“no data found for key {userId}” |
“access token check failed for key\/secret $key\/$accessToken” |
“Argument {argument} required” |
Code Examples
$accessToken = "YOUR_API_KEY";
$url = 'https://api.wooxy.com/v3/sms/info';
$body = json_encode([
'ids' => [
'5bc0a73d19b6051f963023c1',
'5bc0a73d19b6051f963023c2',
'5bc0a73d19b6051f963023c3',
],
]);
/**
* Request Example
*/
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
//curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_INFILESIZE, null);
curl_setopt($ch, CURLOPT_POSTFIELDS, $body);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Access-Token: $accessToken",
'Content-Type: application/json',
'Content-Length: ' . strlen($body),
]);
$result = curl_exec($ch);
if ($result === false) {
echo 'cURL error:' . curl_error($ch) . PHP_EOL;
} else {
echo strval($result) . PHP_EOL;
}
curl_close($ch);