Emailtracking¶
Get a list of emails from Emailtracking¶
POST /project/emailtracking/email/list
This method is used to get a list of emails from emailtracking.
If along with the email data you need detailed information on the visit and deal, then in the request body specify "extend": ["visit", "order"]
.
curl 'https://cloud.roistat.com/api/v1/project/emailtracking/email/list?project=12345' \
--request POST \
--header 'Content-type: application/json' \
--header 'Api-key: {KEY}' \
--data Request body - see below
Request Body:
{
"filters": {
"and": [
[
"date",
">",
"2019-01-01T21:00:00+0000"
],
[
"date",
"<",
"2019-02-01T21:00:00+0000"
]
]
},
"extend": [
"visit",
"order"
],
"sort": [
"date",
"desc"
],
"limit": 100,
"offset": 0
}
{
"data": [
{
"id": "12345",
"date": "2016-06-19T09:31:01+0000",
"email_from": "test@mail.com",
"email_to": "test2@mail.com",
"subject": "Test email",
"body": "Text of email",
"visit_id": "12345",
"order_id": "12345",
"visit": {
"id": 666,
"first_id": 660,
"date": "2016-05-25T19:31:58+0000",
"referrer": "http://site.ru/contact.php",
"host": "site.ru",
"landing_page": "http://test.ru/lp",
"agent": "Mozilla/5.0",
"ip": "47.110.126.72",
"google_client_id": "1818132860.1451606703",
"source": {
"system_name": "direct_search_18000022_2014432344_что такое гугл адвордс",
"display_name": "What is Google Adwords?",
"icon_url": "https://favicon.yandex.net/favicon/direct.yandex.ru",
"utm_source": "direct",
"utm_medium": "cpc",
"utm_campaign": "kampaniya",
"utm_term": "slovo",
"utm_content": "test-message",
"openstat": null,
"referrer": "http://site.ru/contact.php"
}
},
"order": {
"id": 777,
"url": "http://site.ru/order/777",
"source_type": "calltracking",
"creation_date": "2016-05-22T19:32:22+0000",
"update_date": "2016-05-22T19:32:22+0000",
"revenue": 2000,
"cost": 350,
"client_id": 150,
"visit_id": 666,
"page": null,
"status": {
"id": 31,
"type": "paid",
"name": "Paid"
},
"custom_fields": {
"Lead Type": "Phone",
"Designer": "Jon Snow"
}
}
}
],
"total": 1,
"status": "success"
}
Query String:
Parameter | Type | Description | Required |
---|---|---|---|
project | string | Project number | yes |
Request Body:
Parameter | Type | Description | Required |
---|---|---|---|
filters | object | no | |
> and | array[string] | no | |
extend | array[string] | no | |
sort | array[string] | no | |
limit | integer | no | |
offset | integer | no |
Parameter | Type | Description |
---|---|---|
data | array[object] | |
> id | string | |
> date | string | |
> email_from | string | |
> email_to | string | |
> subject | string | |
> body | string | |
> visit_id | string | |
> order_id | string | |
> visit | object | |
>> id | integer | |
>> first_id | integer | |
>> date | string | |
>> referrer | string | |
>> host | string | |
>> landing_page | string | |
>> agent | string | |
>> ip | string | |
>> google_client_id | string | |
>> source | object | |
>>> system_name | string | |
>>> display_name | string | |
>>> icon_url | string | |
>>> utm_source | string | |
>>> utm_medium | string | |
>>> utm_campaign | string | |
>>> utm_term | string | |
>>> utm_content | string | |
>>> openstat | null | |
>>> referrer | string | |
> order | object | |
>> id | integer | |
>> url | string | |
>> source_type | string | |
>> creation_date | string | |
>> update_date | string | |
>> revenue | integer | |
>> cost | integer | |
>> client_id | integer | |
>> visit_id | integer | |
>> page | null | |
>> status | object | |
>>> id | integer | |
>>> type | string | |
>>> name | string | |
>> custom_fields | object | |
>>> Lead type | string | |
>>> Designer | string | |
total | integer | |
status | string |