Introduction
Your API Endpoint
https://{your_name}.adglare.net/api/v2/{method_name}
AdGlare's ad server API is organized around JSON, which is returned in all responses. In order to access the API, an API key can be created via the page Settings => API Settings from within your ad server portal.
Your API endpoint URL can be found here at the right.
Authentication
Include your secret API key in the Authorization header when making a request.
# Pass the Authorization header with each request
curl "https://{your_name}.adglare.net/api/v2/{method_name}"
-H "Authorization: Basic {api_key}"
Authenticate your account by including your secret key in API requests. Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username. You do not need to provide a password.
Authorization: Basic {api_key}
Error Handling
Example of an error.
{ "success": "0", "data": [{}], "errormsg": "There was an error.", "uri": "/api/v2/reports" }
If an API request failed, the success
variable will be set to 0
, and errormsg
will contain a description why the request failed.
If a request was successful, success
is set to 1
.
Methods
List Campaigns
curl "https://{your_name}.adglare.net/api/v2/campaigns"
-H "Authorization: Basic {api_key}"
-X POST
-d ""
Example Response:
{ "success": "1", "data": [{ "cID": "501658124", "name": "My Campaign", "type": "Inline Media Ad", "created": "2023-02-01 17:08:00", "status": "active", "impressions": 3116, "clicks": 194, "conversions": 21, "weight": 60, "tier": 3, "assigned_zones": "ALL", "finance": { "pricing_model": "8.50 CPM", "costs": 26.486, "eCPM": 8.5, "eCPC": 0.1365 }, "creatives": [{ "crID": "220382176", "created": "2019-04-11 18:17:45", "name": "My Creative A", "status": "active", "impressions": 2192, "clicks": 112, "conversions": 0, "weight": 60 }, { "crID": "762221038", "created": "2019-04-11 18:19:11", "name": "My Creative B", "status": "onhold", "impressions": 924, "clicks": 82, "conversions": 0, "weight": 40 }] }, { "cID": "663661327", "name": "Video Campaign", "type": "VAST Video Tag", "created": "2023-01-29 10:15:07", "status": "completed", "impressions": 525, "clicks": 34, "conversions": 2, "weight": 80, "tier": 1, "assigned_zones": "189928327#298928317", "finance": { "pricing_model": "1.00 CPC", "costs": 34, "eCPM": 64.7619, "eCPC": 1 }, "creatives": [{ "crID": "382176220", "created": "2019-04-11 11:11:45", "name": "My Creative A", "status": "active", "impressions": 525, "clicks": 34, "conversions": 2, "weight": 60 }] }], "errormsg": "", "uri": "/api/v2/campaigns" }
This endpoint returns a list of your campaigns.
Endpoint
POST https://{your_name}.adglare.net/api/v2/campaigns
Query Parameters
Parameter | Required | Description | Example |
---|---|---|---|
cID | no | Filter for this cID (campaign ID). | 501658124 |
status | no | Filter. Either active , onhold , completed , archived . |
active |
include_finance | no | Either true or false . |
true |
List Zones
curl "https://{your_name}.adglare.net/api/v2/zones"
-H "Authorization: Basic {api_key}"
-X POST
-d ""
Example Response:
{ "success": "1", "data": [{ "zID": "646374028", "name": "My Zone", "type": "Inline Media Ad", "created": "2023-01-29 09:40:51", "status": "active", "ad_requests": 129571, "impressions": 129568, "clicks": 5643, "finance": { "revenue": 1205.2825, "eCPM": 9.3023, "eCPC": 0.2135 } }, { "zID": "185738534", "name": "Another Zone", "type": "VAST Video Tag", "created": "2023-01-27 11:03:32", "status": "onhold", "ad_requests": 7224, "impressions": 7221, "clicks": 840, "finance": { "revenue": 25.2825, "eCPM": 3.5012, "eCPC": 0.0300 } }], "errormsg": "", "uri": "/api/v2/zones" }
This endpoint returns a list of your zones.
Endpoint
POST https://{your_name}.adglare.net/api/v2/zones
Query Parameters
Parameter | Required | Description | Example |
---|---|---|---|
zID | no | Filter for this zID (zone ID). | 646374028 |
status | no | Filter. Either active or onhold . |
active |
include_finance | no | Either true or false . |
true |
Campaign Reports
curl "https://{your_name}.adglare.net/api/v2/reports/campaigns"
-H "Authorization: Basic {api_key}"
-X POST
-d "from=2023-02-01&until=2023-02-08"
Example Response:
{ "success": "1", "data": [{ "cID": 232376497, "campaign_name": "My Campaign", "summary": { "impressions": 7434324, "clicks": 118949, "conversions": 654, "finance": { "pricing_model": "-", "costs": 0, "eCPM": 0, "eCPC": 0 } }, "dataset": { "impressions": { "adsize": { "225x225": 1, "300x250": 7434323 }, "adtype": { "Inline Media Ad": 7434324 }, "browser": { "Chrome": 7434324 }, "cIDs": { "232376497": 7434324 }, "country": { "USA": 7434324 }, "crIDs": { "561719638": 1, "824527143": 1, "683828157": 7434322 }, "day": { "2020-03-01": 2738383, "2020-03-02": 4695941 }, "dayhour": { "2020-03-01 10": 2738383, "2020-03-02 15": 4695941 }, "device": { "Desktop": 7434303, "Mobile": 20, "Tablet": 1 }, "domain": { "exampledomain.com": 7434316, "anotherdomain.com": 8 }, "isbot": { "no": 7434022, "yes": 302 }, "language": { "en": 7434324 }, "os": { "Windows": 7434324 }, "ssl": { "yes": 7434323, "no": 1 }, "weekday": { "Sun": 2738383, "Mon": 4695941 }, "zIDs": { "492837463": 7434324 } }, "clicks": { "adsize": [], "adtype": [], "browser": [], "cIDs": [], "country": [], "crIDs": [], "day": [], "dayhour": [], "device": [], "domain": [], "isbot": [], "language": [], "os": [], "ssl": [], "weekday": [], "zIDs": [] }, "conversions": {} } },{ "cID": 501658124, "campaign_name": "Another Campaign", "summary": { "impressions": 166439, "clicks": 3828, "conversions": 12, "finance": { "pricing_model": "8.50 CPM", "costs": 1414.73, "eCPM": 8.50, "eCPC": 0.3695 } }, "dataset": {} }], "errormsg": "", "uri": "/api/v2/reports/campaigns" }
This endpoint returns statistical data about your campaigns.
Endpoint
POST https://{your_name}.adglare.net/api/v2/reports/campaigns
Query Parameters
Parameter | Required | Description | Example |
---|---|---|---|
from | yes | The start date of the result set in YYYY-MM-DD. | 2023-02-01 |
until | yes | The end date of the result set in YYYY-MM-DD. | 2023-02-08 |
cID | no | Filter for this cID (campaign ID). | 501658124 |
include_dataset | no | Either true or false . |
true |
Zone Reports
curl "https://{your_name}.adglare.net/api/v2/reports/zones"
-H "Authorization: Basic {api_key}"
-X POST
-d "from=2023-02-01&until=2023-02-08"
Example Response:
{ "success": "1", "data": [{ "zID": 651128504, "zone_name": "My Zone", "summary": { "adrequests": 7434324, "impressions": 7434324, "clicks": 118949, "finance": { "revenue": 0, "eCPM": 0, "eCPC": 0 } }, "dataset": { "adrequests": {}, "impressions": { "adsize": { "225x225": 1, "300x250": 7434323 }, "adtype": { "Inline Media Ad": 7434324 }, "browser": { "Chrome": 7434324 }, "cIDs": { "608678224": 7434324 }, "country": { "USA": 7434324 }, "crIDs": { "561719638": 1, "824527143": 1, "683828157": 7434322 }, "day": { "2020-03-03": 7434324 }, "dayhour": { "2020-03-03 15": 7434324 }, "device": { "Desktop": 7434303, "Mobile": 20, "Tablet": 1 }, "domain": { "exampledomain.com": 7434316, "anotherdomain.com": 8 }, "isbot": { "no": 7434022, "yes": 302 }, "language": { "en": 7434324 }, "os": { "Windows": 7434324 }, "ssl": { "yes": 7434323, "no": 1 }, "weekday": { "Tue": 7434324 }, "zIDs": { "651128504": 7434324 } }, "clicks": {} } },{ "zID": 764397223, "zone_name": "Another Zone", "summary": { "adrequests": 166439, "impressions": 166439, "clicks": 3828, "finance": { "revenue": 1414.73, "eCPM": 8.50, "eCPC": 0.3695 } }, "dataset": {} }], "errormsg": "", "uri": "/api/v2/reports/zones" }
This endpoint returns statistical data about your zones.
Endpoint
POST https://{your_name}.adglare.net/api/v2/reports/zones
Query Parameters
Parameter | Required | Description | Example |
---|---|---|---|
from | yes | The start date of the result set in YYYY-MM-DD. | 2023-02-01 |
until | yes | The end date of the result set in YYYY-MM-DD. | 2023-02-08 |
zID | no | Filter for this zID (zone ID). | 764397223 |
include_dataset | no | Either true or false . |
true |
All rights reserved. Copyright © 2013 - 2023 AdGlare Ad Server.