Campaign Management API
Create Campaign
Creates Campaign.
URL: /rest-api/campaign/create.do
Method: POST
Response format: application/json
Error codes:
- 400 Bad Request – wrong request format. No Campaign or Campaign Pricing is not enabled for the given Campaign.
- 401 Unauthorized – authentication error.
- 403 Forbidden – not enough permissions.
- 404 Not Found – Advertiser with given ID not found.
Request Parameters:
- name – Campaign name as a String.
- advertiserId – ID of the Advertiser.
- description – description of the Campaign as a String.
- active – active status of Campaign as a boolean.
- ctrOptimization – switch for CTR optimization setting of Campaign as a boolean.
- cpaOptimization – switch for I2C Optimization setting for the Campaign as a boolean.
- ecpmOptimization – switch for eCPM Optimization setting for Campaign as a boolean.
- onlyThisCampaignOnPage – switch for 'Only this Campaign on page' setting for the Campaign; boolean.
- onlyOneBannerPerPage – switch for 'Only one Banner per page' setting for the Campaign; boolean.
- weight – Weight of Campaign as an integer.
- priority – sets the Priority group for the Campaign. Available values: STANDARD_HIGH, STANDARD_MEDIUM, STANDARD_LOW, PREMIUM, NON_GUARANTEED, HOUSE_ADS.
- allowNewPlacementsAutolinking – permission for Campaign to allow linking it's Banners to new Placements automatically as boolean.
- labels - Labels; comma-separated.
- autolinkCategories – ID's of Inventory Categories for Auto-linking.
- allowActionPricingUrlOverriding – toggle Action Pricing Overriding (boolean). Enable also activates the Action Pricing pane.
- allowImpressionAndClicksPricingUrlOverriding – toggle Impression and Click Pricing Overriding; boolean.
Response sample:
200 OK
{"success":true} – success
{"error":"permission_denied","success":false} – failure due to insufficient privileges
Parameters:
- hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp – UNIX timestamp in milliseconds used in hash generation.
- username – the given username.
Copy|Move Campaign
Copies or moves the Campaign to a given Advertiser.
URL: /rest-api/campaign/{campaignId}/{operation}/{advertiserId}.do
Method: POST
Response format: application/json
Error codes:
- 400 Bad Request - wrong request format. E.g., wrong types for parameters or no Campaign/Advertiser with such ID exists.
- 401 Unauthorized - authentication error.
- 403 Forbidden - not enough permissions.
Response sample:
200 OK
Parameters:
- hash - a MD5 digest of concatenated username's MD5 password and the given timestamp.
- timestamp - UNIX timestamp in milliseconds used in hash generation.
- username - the given username.
- campaignId - the given Banner ID.
- advertiserId - id of advertiser where to move/copy campaign to.
- operation - operation to perform (literal, either COPY or MOVE).
- copyCount - numbers of copies, not required, defaults to 1.
- keepBannersLinked - boolean, whether or not keep Banners linked to Placements; defaults to false.
Delete Campaign
Deletes Campaign by given ID.
URL: /rest-api/campaign/{campaignId}/delete.do
Method: POST
Response format: application/json
Error codes:
401 Unauthorized – authentication error.
Response sample:
200 OK
{"success":true} – success
{"error":"permission_denied","success":false} – failure due to insufficient privileges
Parameters:
- hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp – UNIX timestamp in milliseconds used in hash generation.
- username – the given username.
- campaignId – the given Campaign ID.
Get Banners For Campaign
Get the list of all Banners for given Campaign.
URL: /rest-api/campaign/{campaignId}/banners.do
Method: GET
Response format: application/json
Error codes:
401 Unauthorized – authentication error.
Response sample:
200 OK
[{"id":1, "name":"banner1"}, ...]
Parameters:
- hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp – UNIX timestamp in milliseconds used in hash generation.
- username – the given username.
Get Campaign
Get the Campaign information by its ID.
URL: /rest-api/campaign/{campaignId}.do
Method: GET
Response format: application/json
Error codes:
- 401 Unauthorized - authentication error.
- 403 Forbidden - not enough permissions.
- 404 Not Found - Campaign with such ID doesn't exist.
Response sample:
200 OK
Parameters:
- hash - an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp - UNIX timestamp in milliseconds used in hash generation.
- username - the given username.
- campaignId - the given Campaign ID.
Get Campaigns
Get the list of all Campaigns for the given ad network.
URL: /rest-api/campaigns.do
Method: GET
Response format: application/json
Error codes:
401 Unauthorized - authentication error
Response sample:
200 OK
Parameters:
- hash - an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp - UNIX timestamp in milliseconds used in hash generation.
- username - the given username.
Update Campaign
Updates Campaign with the given ID.
URL: /rest-api/campaign/{campaignId}/update.do
Method: POST
Response format: application/json
Error codes:
- 401 Unauthorized – authentication error.
- 403 Forbidden – not enough permissions.
- 404 Not Found – Campaign with given ID doesn't exist.
Request Parameters:
- name – Campaign name as a String.
- description – description of the Campaign as a String.
- active – active status of the Campaign as a boolean.
- ctrOptimization – switch for CTR Optimization setting of Campaign as a boolean.
- cpaOptimization – switch for I2C Optimization setting for the Campaign as a boolean.
- ecpmOptimization – switch for eCPM Optimization setting for Campaign as a boolean.
- weight – Weight of Campaign as an integer.
- priority – sets the Priority group for the Campaign. Available values: STANDARD_HIGH, STANDARD_MEDIUM, STANDARD_LOW, PREMIUM, NON_GUARANTEED, HOUSE_ADS.
- allowNewPlacementsAutolinking – permission for Campaign to allow linking it's Banners to new Placements automatically as boolean.
- autolinkCategories – ID's of Inventory Categories for Auto-linking.
- labels - Labels; comma-separated. If labels parameter is passed with no value, existed labels are deleted.
- labelUpdateType - supported values: add, overwrite. Defines whether to add new labels or to overwrite the existing ones.
- allowActionPricingUrlOverriding – toggle Action Pricing Overriding (boolean). Enable also activates the Action Pricing pane.
- allowImpressionAndClicksPricingUrlOverriding – toggle Impression and Click Pricing Overriding (boolean).
- onlyThisCampaignOnPage - switch for 'Only this Campaign on page' setting for the Campaign; boolean.
- onlyOneBannerPerPage - switch for 'Only one Banner per page' setting for the Campaign; boolean.
Response sample:
200 OK
{"success":true} – success
{"error":"permission_denied","success":false} – failure due to insufficient privileges
Parameters:
- hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp – UNIX timestamp in milliseconds used in hash generation.
- username – the given username.
- campaignId – the given Campaign ID.
Get Security Settings for Campaign
Get security settings for the Campaign with given ID.
URL: /rest-api/security-settings/campaign.do
Method: GET
Response format: application/json
Error codes:
- 401 Unauthorized – authentication error.
Response sample:
200 OK
Parameters:
- hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp – UNIX timestamp in milliseconds used in hash generation.
- username – the given username.
- id – campaign ID.
Update Security Settings for Campaign
Update Security Settings for the Campaign with given ID.
URL: /rest-api/security-settings/campaign/save.do
Method: POST
Response format: application/json
Error codes:
- 401 Unauthorized – authentication error.
Request example:
{ "mediaScannerOn": true, "mediaScannerStartDate": "2016-07-27", "mediaScannerEndDate": "2016-08-16", "mediaScannerRate": "24", "forensiqOn": true, "countries": ["UA","US"],"dateFrom": "2016-07-27", "dateTo": "2016-08-16", "trafficQualityFiltering": "ACCEPT_ALL", "trafficShare": "5.0", "trafficQualityMaxRisk": "50" }
Response sample:
200 OK
{ "success" : true }
Parameters:
- hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp – UNIX timestamp in milliseconds used in hash generation.
- username – the given username.
- id – campaign ID.
- mediaScannerOn – (required) enable/disable media scanner settings; boolean.
- mediaScannerStartDate – (required) start date for media scanner in yyyy-MM-dd format.
- mediaScannerEndDate – (required) end date for media scanner in yyyy-MM-dd format.
- mediaScannerRate – (required) media scanner rate.
- forensiqOn – (required) enable/disable forensiq; boolean.
- countries – (optional) array of country codes.
- adEvents – (optional) array of ad events to set. Available values: REQUEST, IMPRESSION, CLICK, ACTION.
- dateFrom – (required) start date for forensiq in yyyy-MM-dd format.
- dateTo – (required) end date for forensiq in yyyy-MM-dd format.
- trafficQualityFiltering – (required) traffic quality filtering. Available values: ACCEPT_ALL, REJECT_HIGH_RISK, REJECT_SUSPICIOUS or REJECT_CUSTOM.
- trafficShare – (required) traffic share as a double.
- trafficQualityMaxRisk – (required) traffic share as integer.
Disable Security Settings for Campaign
Disables all security settings for the Campaign with given ID.
URL: /rest-api/security-settings/campaign/disable.do
Method: POST
Error codes:
- 401 Unauthorized – authentication error.
Response format: application/json
Response sample:
200 OK
{ "success": true }
Parameters:
- hash – an MD5 digest of a concatenated username's MD5 password and a given timestamp.
- timestamp – UNIX timestamp in milliseconds used in hash generation.
- username – the given username.
- id – campaign ID.
Need more help?
Should you require any additional help with our solutions, do not hesitate to contact Epom technical support at support@epom.com. Our support managers are dedicated to resolving any issues and providing you with solutions and support if you face difficulties or have questions.