Get messages
Post /statistics/messages
Parameters:
Name | Description | Type | Mandatory |
---|---|---|---|
page | Page number | Int | No |
pageSize | Number of item returned | Int | No |
dateBegin | Date begin yyyy-MM-ddThh:mm:ssZ | Int | No |
dateEnd | Date end yyyy-MM-ddThh:mm:ssZ | Int | No |
froms | Array of Senders email | Array | No |
apiKeys | Array of api keys | Array | No |
tags | Array of tags | Array | No |
Response:
Name | Description | Type | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | Message Id | String | |||||||||||||||
apiKey | Api key used to send the email | String | |||||||||||||||
createdDate | Date on timestamp | Int | |||||||||||||||
lastStateDate | Last status date on timestamp | Int | |||||||||||||||
msg |
|
Object | |||||||||||||||
tags |
|
Array | |||||||||||||||
lastState | Last status of the email | Int | |||||||||||||||
meta |
|
Object | |||||||||||||||
reason | reason | null | |||||||||||||||
open | Open | INT | |||||||||||||||
click | click | INT | |||||||||||||||
openDetails |
|
Array | |||||||||||||||
ClickDetails |
|
Array |
Programming language:
Request exemple:
{ "dateBegin":"2019-06-10T12:50:04", "dateEnd":"2019-06-12T12:50:04", "tags":["welcome"] }
Response exemple:
{ "messages": [ { "id": "5d00f65e99321602e57d89ae", "apiKey": "YOUR_API_KEY", "createdDate": "2019-06-12T12:55:54.306+0000", "lastStateDate": "2019-06-12T12:55:55.829+0000", "msg": { "from": "tipimail@tipimail.com", "email": "recipient@tipimail.com", "subject": "email subject", "size": 7070 }, "tags": [ "documentation", "support" ], "lastState": "delivered", "meta": {}, "reason": null, "open": 0, "click": 0, "openDetails": [], "clickDetails": [] }, { "id": "5d00f4fc9932583ad076d962", "apiKey": "YOUR_API_KEY", "createdDate": "2019-06-12T12:50:02.345+0000", "lastStateDate": "2019-06-12T12:50:04.111+0000", "msg": { "from": "checker@tipimail.com", "email": "recipient@tipimail.com", "subject": "email subject", "size": 435 }, "tags": null, "lastState": "delivered", "meta": null, "reason": null, "open": 0, "click": 0, "openDetails": [], "clickDetails": [] } ], "total": 2 }
Code example:
curl -X POST -d '{"dateBegin":"2019-06-12T12:50:04","tags":["welcome","password"]}' -H "Content-Type: application/json" -H "X-Tipimail-ApiUser:YOUR_SMTP_USERNAME" -H "X-Tipimail-ApiKey:YOUR_SMTP_KEY" https://api.tipimail.com/v1/statistics/messages
require 'vendor/autoload.php'; $tipimail = new Tipimail\Tipimail('YOUR_SMTP_USERNAME', 'YOUR_API_KEY'); try { $page = null; $pageSize = null; $dateBegin = null; $dateEnd = null; $froms = null; $apiKeys = null; $tags = null; $result = $tipimail->getStatisticsService()->getMessages($page, $pageSize, $dateBegin, $dateEnd, $froms, $tags, $apiKeys); var_dump($result); } catch(Tipimail\Exceptions\TipimailException $e) { echo 'Exception received :', $e->getMessage(), "\n"; }
... public class Example { public static void main(String[] args) { Tipimail tipimail = new Tipimail("YOUR_SMTP_USERNAME", "YOUR_API_KEY"); try { nteger page = null; Integer pageSize = null; Integer dateBegin = null; Integer dateEnd = null; ArrayList<String> froms = null; ArrayList<String> tags = null; ArrayList<String> apiKeys = null; StatisticsMessages messages; messages = tipimail.getStatisticsService().getMessages(page, pageSize, dateBegin, dateEnd, froms, tags, apiKeys); } catch (TipimailException e) { } } }