Introduction
Welcome to the DirectIQ API. You can use our API to access DirectIQ data endpoints, which can get information on contacts, contact lists, templates, campaigns and reports in your account.
We have language bindings in Shell and C#. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
Authentication
Use your DirectiQ user name and API key in headers to authorize:
curl -X GET \
https:/restapi.directiq.com/campaigns \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own campaign id istead of "0101".
var request = new RestRequest("clicks/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
Make sure to replace
your-api-key
with your API key, andyour-user-name
with your DirectIQ user name.
All you need to do is to use your DirectIQ user name and API key and pass them as headers with each call to our API endpoints.
You can access your API key from My Account > Social Media & Integrations > API Integration in your DirectIQ dashboard.
If you are not a registered DirectIQ user, you can register here.
Contacts
Contact info holds the email address and other details like first name, last name and etc.
Get All Contacts
curl -X GET \
https://restapi.directiq.com/contacts/view \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
var request = new RestRequest("contacts/view", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
{
"Data": [
{
"ContactId": 29317401,
"ClientId": 0,
"Email": "email@address.com",
"FirstName": "John",
"LastName": "Smith",
"DateAdded": "2016-12-02T19:02:39",
"Gender": "",
"City": "",
"BirthDate": "",
"Extended1": "",
"Extended2": "",
"Extended3": "",
"Extended4": "",
"Extended5": "",
"Extended6": "",
"Extended7": "",
"Extended8": "",
"Extended9": "",
"Extended10": "",
"Extended11": "",
"Extended12": "",
"Extended13": "",
"Extended14": "",
"Extended15": null,
"IsActive": true,
"IsVisible": true,
"CanBeReactivated": true,
"Permission": null
}
]
}
This endpoint retrieves all of your contacts.
HTTP Request
GET https://restapi.directiq.com/contacts/view
Query Parameters
None
Get Contact by Id
curl -X GET \
https://restapi.directiq.com/contacts/{contactId} \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own contact id instead of "0101".
var request = new RestRequest("contacts/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
{
"Data": [
{
"ContactId": 29317401,
"ClientId": 0,
"Email": "email@address.com",
"FirstName": "John",
"LastName": "Smith",
"DateAdded": "2016-12-02T19:02:39",
"Gender": "",
"City": "",
"BirthDate": "",
"Extended1": "",
"Extended2": "",
"Extended3": "",
"Extended4": "",
"Extended5": "",
"Extended6": "",
"Extended7": "",
"Extended8": "",
"Extended9": "",
"Extended10": "",
"Extended11": "",
"Extended12": "",
"Extended13": "",
"Extended14": "",
"Extended15": null,
"IsActive": true,
"IsVisible": true,
"CanBeReactivated": true,
"Permission": null
}
]
}
This endpoint retrieves a contact info given its id.
HTTP Request
GET https://restapi.directiq.com/contacts/{contactId}
Query Parameters
Parameter | Description |
---|---|
contactId | Contact id as an integer value. |
Get All Contacts by List Id
curl -X GET \
https://restapi.directiq.com/contacts/view/{listId} \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of "0101".
var request = new RestRequest("contacts/view/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
{
"Data": [
{
"ContactId": 29317401,
"ClientId": 0,
"Email": "email@address.com",
"FirstName": "John",
"LastName": "Smith",
"DateAdded": "2016-12-02T19:02:39",
"Gender": "",
"City": "",
"BirthDate": "",
"Extended1": "",
"Extended2": "",
"Extended3": "",
"Extended4": "",
"Extended5": "",
"Extended6": "",
"Extended7": "",
"Extended8": "",
"Extended9": "",
"Extended10": "",
"Extended11": "",
"Extended12": "",
"Extended13": "",
"Extended14": "",
"Extended15": null,
"IsActive": true,
"IsVisible": true,
"CanBeReactivated": true,
"Permission": null
}
]
}
This endpoint retrieves contacts of a specified list.
HTTP Request
GET https://restapi.directiq.com/contacts/view/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Get Active Contacts by List Id
curl -X GET \
https://restapi.directiq.com/contacts/active/view/{listId} \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of "0101".
var request = new RestRequest("contacts/active/view/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"ContactId": 456210,
"ClientId": 0,
"Email": "email@address.com",
"FirstName": null,
"LastName": null,
"DateAdded": "2017-02-24T19:28:11",
"Gender": null,
"City": null,
"BirthDate": null,
"Extended1": null,
"Extended2": null,
"Extended3": null,
"Extended4": null,
"Extended5": null,
"Extended6": null,
"Extended7": null,
"Extended8": null,
"Extended9": null,
"Extended10": null,
"Extended11": null,
"Extended12": null,
"Extended13": null,
"Extended14": null,
"Extended15": null,
"IsActive": false,
"IsVisible": true,
"CanBeReactivated": true,
"Permission": null
}
]
This endpoint retrieves all active contacts of a specified list.
HTTP Request
GET https://restapi.directiq.com/contacts/active/view/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Get Passive Contacts by List Id
curl -X GET \
https://restapi.directiq.com/contacts/passive/view/{listId} \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of "0101".
var request = new RestRequest("contacts/passive/view/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"ContactId": 456210,
"ClientId": 0,
"Email": "email@address.com",
"FirstName": null,
"LastName": null,
"DateAdded": "2017-02-24T19:28:11",
"Gender": null,
"City": null,
"BirthDate": null,
"Extended1": null,
"Extended2": null,
"Extended3": null,
"Extended4": null,
"Extended5": null,
"Extended6": null,
"Extended7": null,
"Extended8": null,
"Extended9": null,
"Extended10": null,
"Extended11": null,
"Extended12": null,
"Extended13": null,
"Extended14": null,
"Extended15": null,
"IsActive": false,
"IsVisible": true,
"CanBeReactivated": true,
"Permission": null
}
]
This endpoint retrieves all passive contacts of a specified list.
HTTP Request
GET https://restapi.directiq.com/contacts/passive/view/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Create a Contact by List Id
curl -X POST \
https://restapi.directiq.com/contacts/{listId} \
-H 'api-key: your-api-key' \
-H 'content-type: application/json' \
-H 'user-name: your-user-name' \
-d '{"Email": "email@address.com", "FirstName" : "John", "LastName" : "Smith"}'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of "0101".
var request = new RestRequest("contacts/0101", Method.POST);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
request.AddParameter("application/json", "{\"Email\": \"email@address.com\",
\"FirstName\" : \"John\", \"LastName\" : \"Smith\"}", ParameterType.RequestBody);
var response = client.Execute(request);
Response:
{
"ContactId": 0,
"ClientId": 0,
"Email": "email@address.com",
"FirstName": "John",
"LastName": "Smith",
"DateAdded": null,
"Gender": null,
"City": null,
"BirthDate": null,
"Extended1": null,
"Extended2": null,
"Extended3": null,
"Extended4": null,
"Extended5": null,
"Extended6": null,
"Extended7": null,
"Extended8": null,
"Extended9": null,
"Extended10": null,
"Extended11": null,
"Extended12": null,
"Extended13": null,
"Extended14": null,
"Extended15": null,
"IsActive": null,
"IsVisible": null,
"CanBeReactivated": null,
"Permission": null
}
This endpoint adds a contact to a specified list.
HTTP Request
POST https://restapi.directiq.com/contacts/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Delete a Contact From a List
curl -X DELETE \
https://restapi.directiq.com/contacts/delete/{listId} \
-H 'api-key: your-api-key' \
-H 'content-type: application/json' \
-H 'user-name: your-user-name' \
-d '{"Email": "email@address.com"}'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of "0101".
var request = new RestRequest("contacts/delete/0101", Method.DELETE);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
request.AddParameter("application/json", "{\"Email\": \"email@address.com\"}",
ParameterType.RequestBody);
var response = client.Execute(request);
Response:
{
"ContactId": 0,
"ClientId": 0,
"Email": "email@address.com",
"FirstName": "null",
"LastName": "null",
"DateAdded": null,
"Gender": null,
"City": null,
"BirthDate": null,
"Extended1": null,
"Extended2": null,
"Extended3": null,
"Extended4": null,
"Extended5": null,
"Extended6": null,
"Extended7": null,
"Extended8": null,
"Extended9": null,
"Extended10": null,
"Extended11": null,
"Extended12": null,
"Extended13": null,
"Extended14": null,
"Extended15": null,
"IsActive": null,
"IsVisible": null,
"CanBeReactivated": null,
"Permission": null
}
This endpoint deletes a contact from a specified list.
HTTP Request
DELETE https://restapi.directiq.com/contacts/delete/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Upload File For Bulk Insert
curl -X POST \
https://restapi.directiq.com/contacts/upload/{listId} \
-H 'api-key: your-api-key' \
-H 'content-type: multipart/form-data' \
-H 'user-name: your-user-name' \
-F FILE_TO_UPLOAD=@csvFile.csv
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of "0101".
var request = new RestRequest("contacts/upload/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
request.AddHeader("content-type", "multipart/form-data");
request.AddParameter("multipart/form-data", "Content-Disposition: form-data;
name=\"FILE_TO_UPLOAD\"; filename=\"csvFile.csv\"\r\nContent-Type: false",
ParameterType.RequestBody);
var response = client.Execute(request);
Response:
200 OK
This endpoint adds contacts to a specified list.
CSV File
Use a csv file containing your contacts info and upload it to the end point. You must provide at least "email" as the header. This field holds the email addresses of your contacts. You can also provide the common "firstname" and "lastname" as headers.
HTTP Request
POST https://restapi.directiq.com/contacts/upload/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Contact Lists
Contact lists are containers which hold contact objects that you use for your campaigns.
Get All Contact Lists
curl -X GET \
https://restapi.directiq.com/contactlists \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
var request = new RestRequest("contactlists", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 587658,
"Name": "777",
"LastUpdate": "2018-04-19T11:23:00",
"Count": 773,
"ClientId": 8765786,
"Active": 0,
"Passive": 0,
"HashId": "00000000-0000-0000-0000-000000000000",
"IsLocked": 0,
"IsVisible": true,
"IsDoubleOptIn": false
}
]
This endpoint retrieves all of your contact lists.
HTTP Request
GET https://restapi.directiq.com/contactlists
Query Parameters
None
Get Contact List by Id
curl -X GET \
https://restapi.directiq.com/contactlists/view/{listId} \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of "65767676"
var request = new RestRequest("contactlists/view/65767676", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
{
"Id": 65767676,
"Name": "777",
"LastUpdate": "2018-04-19T11:23:00",
"Count": 773,
"ClientId": 7437905,
"Active": 0,
"Passive": 0,
"HashId": "00000000-0000-0000-0000-000000000000",
"IsLocked": 0,
"IsVisible": true,
"IsDoubleOptIn": false
}
This endpoint retrieves the specified contact list by its id.
HTTP Request
GET https://restapi.directiq.com/contactlists/view/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Create a Contact List
curl -X POST \
https://restapi.directiq.com/contactlists?name={MyListName} \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list name instead of "your-list-name"
var request = new RestRequest("contactlists?name=your-list-name", Method.POST);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
133718 // integer value of list id.
This endpoint creates a contact list given its name.
HTTP Request
POST https://restapi.directiq.com/contactlists?name={your-list-name}
Query Parameters
Parameter | Description |
---|---|
name | Name as a string value. |
Delete a List
curl -X DELETE \
https://restapi.directiq.com/contactlists/delete/{listId} \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own list id instead of 56353
var request = new RestRequest("contactlists/delete/56353", Method.DELETE);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
56353 // integer value of list id.
This endpoint deletes a contact list given its id.
HTTP Request
DELETE https://restapi.directiq.com/contactlists/delete/{listId}
Query Parameters
Parameter | Description |
---|---|
listId | List id as an integer value. |
Campaigns
Campaigns are the heart of the DirectIQ system. They hold many important information like your email template, delivery email lists and schedules for sending.
Get All Campaigns
curl -X GET \
https:/restapi.directiq.com/campaigns \
-H 'api-key: your-api-key' \
-H 'user-name: your-user-name'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
var request = new RestRequest("campaigns", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 45365632222,
"Name": "Auto Test",
"Subject": "Auto Test",
"TemplateId": 52563563,
"ListIds": null,
"TimeToSend": "2018-04-05T07:00:09",
"SenderEmailId": 0
}
]
This endpoint retrieves all of your campaigns.
HTTP Request
GET https://restapi.directiq.com/campaigns
Query Parameters
None
Create a Campaign
curl -X POST \
https://restapi.directiq.com/campaigns \
-H 'api-key: your-api-key' \
-H 'content-type: application/json' \
-H 'user-name: your-user-name' \
-d '{"Name" : "My Campaign","Subject" : "My Subject","TemplateId" : 534453,
"ListIds" : [132664564576], "TimeToSend" : "4/11/2018 2:00:00 PM",
"SenderEmailId" : 28312378}'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
var request = new RestRequest("campaigns", Method.POST);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
request.AddParameter("application/json", "{\"Name\" : \"My Campaign\",
\"Subject\" : \"My Subject\",\"TemplateId\" : 534453,\"ListIds\" : [132664564576],
\"TimeToSend\" : \"4/11/2018 2:00:00 PM\",\"SenderEmailId\" : 28312378}",
ParameterType.RequestBody);
var response = client.Execute(request);
Response:
{
"Id": 0,
"Name": "My Campaign",
"Subject": "My Subject",
"TemplateId": 534453,
"ListIds": [
132664564576
],
"TimeToSend": "2018-04-11T14:00:00",
"SenderEmailId": 28312378
}
This endpoint creates a campaign.
HTTP Request
POST https://restapi.directiq.com/campaigns
Query Parameters
None
Templates
Templates are the email contents generally in the HTML form that you use in your campaigns.
Get All Templates
curl -X GET \
https:/restapi.directiq.com/templates \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
var request = new RestRequest("templates", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 252534,
"Name": "Test 001",
"Subject": "Test 001",
"Body": "<html>\r\n<head>\r\n\t<title></title>\r\n\t\r\n</head>
\r\n<body>\r\n<p>Template body.</p>\r\n</body>\r\n</html>\r\n",
"TextBody": "\r\n\r\n\t\r\n\t\r\n\r\n\r\nTemplate body.\r\n\r\n\r\n",
"UpdateDate": "2018-04-23T11:31:00"
}
]
This endpoint retrieves all of your templates.
HTTP Request
GET https://restapi.directiq.com/templates
Query Parameters
None
Create a Template
curl -X POST \
https:/restapi.directiq.com/templates \
-H 'api-key: your-api-key' \
-H 'content-type: application/json' \
-H 'user-name: your-user-name' \
-d '{"Name":"Auto Test","Subject":"Auto Test","Body":"<html><body><p>Auto Test</p>
</body></html>","TextBody":"Auto Test","UpdateDate":"4/5/2018 2:00:09 PM"}'
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
var request = new RestRequest("templates", Method.POST);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
request.AddParameter("application/json", "{\"Name\":\"Auto Test\",\"Subject\":\"Auto Test\",
\"Body\":\"<html><body><p>Auto Test</p></body></html>\",
\"TextBody\":\"Auto Test\",\"UpdateDate\":\"4/5/2018 2:00:09 PM\"}",
ParameterType.RequestBody);
var response = client.Execute(request);
Response:
{
"Id": 0,
"Name": "Auto Test",
"Subject": "Auto Test",
"Body": "<html><body><p>Auto Test</p></body></html>",
"TextBody": "Auto Test",
"UpdateDate": "2018-04-05T14:00:09"
}
This endpoint creates a template.
HTTP Request
POST https://restapi.directiq.com/templates
Query Parameters
None
Stats
Stats includes statistics about recepients, bounces, delivers, reads, clicks, spams, unsubscribes, hardbounces, readsUnique, forwards of the specified campaign.
Get Stats
curl -X GET \
https:/restapi.directiq.com/stats/{campaingId} \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own campaign id instead of "0101".
var request = new RestRequest("stats/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"CampaignId": 47312249,
"Recepients": 1183,
"Bounces": 54,
"Delivers": 1129,
"Reads": 451,
"Clicks": 40,
"Spams": 1,
"Unsubscribes": 2,
"Hardbounces": 9,
"ReadsUnique": 165,
"Forwards": 0
}
]
This endpoint retrieves stats of a specified campaign.
HTTP Request
GET https://restapi.directiq.com/stats/{campaignId}
Query Parameters
Parameter | Description |
---|---|
campaignId | Campaign id as an integer value. |
Reads
Every read event is recorded when a campaign email is opened by the reciever.
Get All Reads
curl -X GET \
https:/restapi.directiq.com/reads/{campaingId} \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own campaign id instead of "0101".
var request = new RestRequest("reads/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 197403757,
"ClientId": 55849,
"CampaignId": 54668772,
"ContactId": 11304932758,
"CreatedAt": "2018-03-20T18:13:00",
"IpAddress": "61.101.18.144",
"IpLong": 11131343020,
"CountryCode": "US",
"CountryName": "United States",
"City": "",
"Device": "PC",
"Region": "Florida",
"UserAgent": "Mozilla/5.0 (Windows NT 5.1; rv:11.0)
Gecko Firefox/11.0 (via ggpht.com GoogleImageProxy)"
}
]
This endpoint retrieves all reads of a specified campaign.
HTTP Request
GET https://restapi.directiq.com/reads/{campaignId}
Query Parameters
Parameter | Description |
---|---|
campaignId | Campaign id as an integer value. |
Clicks
Every click event is recorded when a campaign email is opened and the receiver clicks on any link on that email.
Get All Clicks
curl -X GET \
https:/restapi.directiq.com/clicks/{campaingId} \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own campaign id instead of "0101".
var request = new RestRequest("clicks/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 23435670,
"ClientId": 1538491,
"CampaignId": 46873723,
"Link": "http://www.directiq10.com/FORWARD/NDY4NzcyLTExMzA5Mjc1OA==",
"CreatedAt": "2018-03-20T18:14:00",
"IpAddrees": "23.226.128.51",
"IpLong": "400719923",
"CountryCode": "US",
"CountryName": "United States",
"City": "Jacksonville",
"LinkId": 4,
"Region": "Florida",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36",
"Device": "PC"
}
]
This endpoint retrieves all clicks of a specified campaign.
HTTP Request
GET https://restapi.directiq.com/clicks/{campaignId}
Query Parameters
Parameter | Description |
---|---|
campaignId | Campaign id as an integer value. |
Unsubscribes
Every unsubscribe event is recorded when a campaign email is opened by the receiver and "Unsubscribe" link in the footer of the email is clicked.
Get All Unsubscribes
curl -X GET \
https:/restapi.directiq.com/unsubscribes/{campaingId} \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own campaign id instead of "0101".
var request = new RestRequest("unsubscribes/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 23159386,
"ClientId": 1837355,
"CampaignId": 47315229,
"ContactId": 124652349787,
"CreatedAt": "2018-04-10T10:35:00",
"Email": "someone@someaddress.com",
"FirstName": "John",
"LastName": "Smith"
}
]
This endpoint retrieves all unsubscribes of a specified campaign.
HTTP Request
GET https://restapi.directiq.com/unsubscribes/{campaignId}
Query Parameters
Parameter | Description |
---|---|
campaignId | Campaign id as an integer value. |
Spam Complaints
Every spam complaint event is recorded when a campaign email is opened by the receiver and "Report Unsolicited" link in the footer of the email is clicked.
Get All Spam Complaints
curl -X GET \
https:/restapi.directiq.com/spamcomplaints/{campaingId} \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
// Use your own campaign id instead of "0101".
var request = new RestRequest("spamcomplaints/0101", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 53517566,
"ClientId": 1548549,
"ContactId": 11230927558,
"CreatedAt": "2018-04-18T19:40:00",
"CampaignId": 47222553,
"Source": "Footer Link"
}
]
This endpoint retrieves all spam complaints of a specified campaign.
HTTP Request
GET https://restapi.directiq.com/spamcomplaints/{campaignId}
Query Parameters
Parameter | Description |
---|---|
campaignId | Campaign id as an integer value. |
Mail-Froms
Mail-From email addresses are the ones that you use as a sender address in your email campaigns.
Get All Mail-Froms
curl -X GET \
https:/restapi.directiq.com/mailfroms/ \
-H "user-name: your-user-name" \
-H "api-key: your-api-key"
// Simple REST and HTTP API Client for .NET
using RestSharp;
var client = new RestClient("https://restapi.directiq.com/");
var request = new RestRequest("mailfroms", Method.GET);
// Use your own user name instead of "your-user-name"
request.AddHeader("user-name", "your-user-name");
// Use your own api key instead of "your-api-key"
request.AddHeader("api-key", "your-api-key");
var response = client.Execute(request);
Response:
[
{
"Id": 2486258,
"ClientId": 1283755,
"FromEmail": "email@address.com",
"CreatedAt": "2017-04-26T14:35:23.967",
"IsConfirmed": true,
"FromName": "John Smith"
}
]
This endpoint retrieves all mail-froms of your account.
HTTP Request
GET https://restapi.directiq.com/mailfroms
Query Parameters
None