Enable Targeting

Enables Targeting for the given Campaign.

URL: /rest-api/campaign/{campaignId}/targeting/enable.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – Targeting with the given ID was not found for the given Campaign.

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 Targeting

Get the Campaign Targeting by ID and by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/{targetId}.do
Method: GET
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – Targeting with the given ID was not found for the given Campaign.

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 All Targetings

Get all Campaign Targetings by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targetings.do
Method: GET
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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 Targeting Types

Get the Campaign Targeting types by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/types.do
Method: GET
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – Targeting with the given ID was not found for the given Campaign.

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.

Remove Targeting

Removes Targeting by Targeting ID and Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/{targetId}/delete.do
Method: DELETE
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – Targeting with the given ID was not found for the given Campaign.

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.
  • targetId – the given Targeting ID

Disable Targeting

Disables Targeting for the given Campaign completely.

URL: /rest-api/campaign/{campaignId}/targeting/disable.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – Targeting with the given ID was not found for the given Campaign.

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 Browsers for Browser Targeting

Gets available values for Browser Targeting.

URL: /rest-api/campaign/{campaignId}/targeting/browsers/values.do
Method: GET
Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – Targeting with given ID not found for the given Campaign.

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.

Create Browser Targeting

Creates the Browser Targeting for the given Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/browser/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • rule – EXCLUDE or INCLUDE.
  • browser – user's Browser. To get all available Browsers, please use the Get Browsers for Browser Targeting method.
  • relation – values are LOWER, GREATER, LOWER_EQUAL, GREATER_EQUAL, or EQUAL.
  • browserVersion – version of the user's Browser.

Create Channel Targeting

Creates the Channel Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/channel/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • channel – Targeting Channel name.
  • rule – EXCLUDE or INCLUDE.

Create Cookie Targeting

Creates the Cookie Value Targeting by Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/cookie/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • cookieName – Cookie name.
  • cookieValue – Cookie value.
  • rule – EXCLUDE or INCLUDE.

Create Country Targeting

Creates the Country Targeting by Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/country/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • countryCode – ISO Country code. To pass multiple Country codes use: "UK, US, CA".
  • rule – EXCLUDE or INCLUDE.

Create Custom Parameter Targeting

Creates Custom Parameter Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/custom/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • rule – EXCLUDE or INCLUDE.
  • customType – the type of Custom Targeting: EXPRESSION, VALUE, ONE_OF, SUBSTRING.
  • customValue – the value of Custom Parameter(s).
  • operation – the applied operation: EQUALS, NOT_EQUALS (for VALUE and ONE_OF types), CONTAINS, NON_CONTAINS (for SUBSTRING type only)
  • parameter – Custom Parameter name (for VALUE, ONE_OF and SUBSTRING types)
note Reporting
Note!

Please note that for EXPRESSION type both the name and value of Custom Parameter should be passed via the customValue parameter. The Custom Parameter name should always be preceded by $ symbol. Sample of valid Custom Parameter names and values for EXPRESSION type: ($p1==1 || $p1=='a') && ($p2>=12 && $p2<=22) ).


Create Targeting by Day of the Week

Creates Day of the Week Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/dayofweek/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • rule – EXCLUDE or INCLUDE.
  • dayOfWeek – available values are MONDAY,TUESDAY,WEDNESDAY,THURSDAY,FRIDAY,SATURDAY,SUNDAY.

Create Targeting by Device Format

Creates the Device Type Targeting by Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/deviceformat/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • deviceFormat – device type (DESKTOP, TABLET, MOBILE, SMART_TV).
  • rule – EXCLUDE or INCLUDE.

Create Device Vendor Targeting

Creates the Targeting by device for the given Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/device/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • deviceVendor – Device Vendor.
  • rule – EXCLUDE or INCLUDE.

Create Domain Targeting

Creates the referrer Domain Targeting by Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/domain/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • domain – Domain name.
  • rule – EXCLUDE or INCLUDE.

Create Preset Domain Group Targeting

Creates the Preset Domain Group targeting by Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/preset-domain/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • domainGroupId – ID of the Domain Group.
  • rule – EXCLUDE or INCLUDE.

Create Targeting by IP range

Creates IP range Targeting by Campaign ID.
Params – Valid IP range (Sample: from 194.222.012.001 to 194.223.07.01)

URL: /rest-api/campaign/{campaignId}/targeting/iprange/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • ipFrom – first valid IP from the range.
  • ipTo – last valid IP of the range.
  • rule – EXCLUDE or INCLUDE.

Create Targeting by Location

Creates Location Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/location/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • countryCode – ISO Country code. To pass multiple Country codes use: "UK, US, CA".
  • regionName – State or region name (optional).
  • cityName – City name (optional).
  • rule – EXCLUDE or INCLUDE.

Create Targeting by Language

Creates the Language Targeting by Campaign ID (and enables if it was disabled).

URL: /rest-api/campaign/{campaignId}/targeting/language/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • languageCode – language code.
  • rule – EXCLUDE or INCLUDE.

Create Mobile Carrier Targeting

Creates the Mobile Carrier Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/mobilecarrier/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • rule – EXCLUDE or INCLUDE.
  • mobileCarriers – array of mobile carrier names.

Create Targeting by OS

Creates Operating System Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/os/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • operatingSystem – OS name.
  • rule – EXCLUDE or INCLUDE.
  • version – version value from the list: /rest-api/campaign/{campaignId}/targeting/os/{osName}/versions.do
  • relation – relation, available values: LOWER, GREATER, LOWER_EQUAL, GREATER_EQUAL, EQUAL.

Get available values for OS Targeting

Get available Operating System values for OS Targeting type

URL: /rest-api/targeting/os/values.do

Method: GET

Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – no banner found.

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 for hash generation.
  • username – a given username.

Get OS versions for OS Targeting

Get available values of OS versions for Operating System Targeting type.

URL: /rest-api/targeting/os/{osName}/versions.do

Method: GET

Response format: application/json

Error codes:

  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.
  • 404 Not Found – no banner found.

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 for hash generation.
  • username – a given username.
  • osName – the name of Operation System from list of available OS values.

Create Targeting by Screen Resolution.

Creates the Screen Resolution Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/resolution/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • relation – – available values LOWER, GREATER, LOWER_EQUAL, GREATER_EQUAL, EQUAL.
  • screenWidth
  • screenHeight
  • rule – EXCLUDE or INCLUDE.

Create Targeting by Time Range

Creates Targeting by Time Range for Campaign.

URL: /rest-api/campaign/{campaignId}/targeting/timerange/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • timeFrom – Starting time string in 24h format (hh:MM).
  • timeTo – Ending time string in 24h format (hh:MM).
  • rule – EXCLUDE or INCLUDE.

Create WiFi traffic Targeting

Creates the Campaign WiFi traffic Targeting by Campaign ID.

URL: /rest-api/campaign/{campaignId}/targeting/wifi/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • rule – EXCLUDE or INCLUDE.

Create Protocol Targeting

Creates protocol targeting by campaign id.

URL: /rest-api/campaign/{campaignId}/targeting/protocol/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • rule – EXCLUDE or INCLUDE.
  • protocol – available values are HTTP, HTTPS.

Create Preset IP Ranges Targeting

Creates (and enables if was disabled) the campaign Preset IP-Ranges targeting by campaign id.

URL: /rest-api/campaign/{campaignId}/targeting/preset-ip-ranges/create.do
Method: POST
Response format: application/json

Error codes:

  • 400 Bad Request – wrong request format. E.g., wrong types for parameters or Campaign with such ID doesn't exist.
  • 401 Unauthorized – authentication error.
  • 403 Forbidden – not enough permissions.

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.
  • ipRangesGroupId – ranges group id
  • rule – EXCLUDE or INCLUDE.

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.