Deprecation Warning

DSP API v1 will continue to receive critical bug and security fixes, but no new functionality will be added going forward. Next version of DSP API is under development and when ready DSP API v1 will be deprecated.

Activity

Advertising activities belong to clients and are constrained by budgets.

Contact your Delta Projects representative to get your mediaAgencyId!

List Activities

Description: List all activities on given client
Verb: GET
Path: /api/v1/media_agency/<mediaAgencyId>/client/<clientId>/campaign/<campaignId>/activity

Request Parameters

Parameter Type Required Description Example
mediaAgencyId Path Yes Id of media agency 86b35325-794c-11e4-8425-daf437376f87
clientId Path Yes Id of client 86b35326-794c-11e4-8425-daf437376f87
campaignId Path Yes Id of campaign. Must be "default" in v1 default
apikey Query Yes API key for authentication and authorization secretkey123
fetch Query No child entities to attach biddingPlans.creatives

Response JSON Body

Parameter Parameter Type Description Example
top level Array of Activity Activities See below

Activity Object

Parameter Parameter Type Description Example
id String Id of activity 86b35327-794c-11e4-8425-daf437376f87
name String Name of activity Example Activity

Example Request

GET /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/campaign/default/activity?apikey=secret123

Example Response

[
  {
    "id": "86b35327-794c-11e4-8425-daf437376f87",
    "name": "Example Activity"
  }
]

Retrieve Activity

Description: Retrieve given activity
Verb: GET
Path: /api/v1/media_agency/<mediaAgencyId>/client/<clientId>/campaign/<campaignId>/activity/<activityId>

Request Parameters

Parameter Type Required Description Example
mediaAgencyId Path Yes Id of media agency 86b35325-794c-11e4-8425-daf437376f87
clientId Path Yes Id of client 86b35326-794c-11e4-8425-daf437376f87
campaignId Path Yes Id of campaign. Must be "default" in v1. default
activityId Path Yes Id of activity 86b35327-794c-11e4-8425-daf437376f87
apikey Query Yes API key for authentication and authorization. secretkey123

Response JSON Body

Parameter Parameter Type Description Example
id String id of activity 86b35327-794c-11e4-8425-daf437376f87
name String Name of activity Example Activity
flightStart ISO8601 Timestamp Scheduled activity start 2014-12-31T22:00:00.000+0000
flightStop ISO8601 Timestamp Scheduled activity stop 2015-01-10T21:59:59.000+0000
enabled Boolean Activity activation flag false
budget Double Total budget for the activity 100000.0
impressionBudget Integer Activity total impressions if defined 500000

Example Request

GET /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/campaign/default/activity/86b35327-794c-11e4-8425-daf437376f87?apikey=secret123

Example Response

{
  "id": "86b35327-794c-11e4-8425-daf437376f87",
  "name": "Example Activity",
  "flightStart":"2014-12-31T22:00:00.000+0000",
  "flightStop":"2015-01-10T21:59:59.000+0000",
  "enabled":false,
  "budget":100000.0
}

Create Activity From Template

Description: Create a new activity using the given template and its settings
Verb: POST
Path: /api/v1/media_agency/<mediaAgencyId>/client/<clientId>/campaign/<campaignId>/activity/create_from_template

Request Parameters

Parameter Type Required Description Example
mediaAgencyId Path Yes Id of media agency 86b35325-794c-11e4-8425-daf437376f87
clientId Path Yes Id of client 86b35326-794c-11e4-8425-daf437376f87
campaignId Path Yes Id of campaign. Must be "default" in v1 default
apikey Query Yes API key for authentication and authorization secretkey123

Request JSON Body

Parameter Name Parameter Type Required Description Example
templateId String Yes Id of activity template 16b35327-794c-11e4-8425-daf437376f87
activityName String Yes Name of activity to be created Example Activity
flightStart ISO8601 Timestamp Yes Scheduled activity start 2015-01-01T00:00:01.0Z
flightStop ISO8601 Timestamp Yes Scheduled activity stop 2015-02-01T00:00:01.0Z
targetECPM Double No Target eCPM in account currency 2.4
orderId String Yes Order ID GXK-77123
budget Double Yes Activity budget in account currency 100000.0
impressionBudget Integer No Activity total impressions 500000
overrideVariables String (JSON) No Adserver tag variables to override {"fontsize": 24, "color": "red"}
enabled Boolean No Activity activation flag false
geoDetails ArrayList (JSON) No Latitude, longitude, radius for geo targeting [{"lat": 69.0, "long": 22, "radius": 19.77}]
excludeGeo Boolean No Excluded/included geo targets false

Response

HTTP 201 Created with the URL to the created activity in the Location header.

Example Request

POST /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/campaign/default/activity/create_from_template?apikey=secret123

Example Request Body

{
  "templateId": "16b35327-794c-11e4-8425-daf437376f87",
  "activityName": "Example Activity",
  "flightStart": "2015-01-01T00:00:01.0Z",
  "flightStop": "2015-02-01T00:00:01.0Z",
  "targetECPM": 2.4,
  "orderId": "GXK-77123",
  "budget": 100000.0,
  "impressionBudget": 500000,
  "enabled": false,
  "geoDetails": [
  {
  "lat": 69,
  "long": 21,
  "radius": 100
  },
  {
  "lat": 67,
  "long": 19,
  "radius": 34.5
  }
  ],
  "excludeGeo": true
}

Note:

  • Leaving out "targetECPM" in request body will make the activity use the template "targetECPM" presets
  • Leaving out "impressionBudget" in request body will make the activity use the template "impressionBudget" presets
  • Leaving "geoDetails" out will result in using templates geo targeting presets. "geoDetails" can only be included when template already has geo targeting rule. When using "geoDetails", all fields must be set with valid latitude/longitude values and radius cannot be a negative. Multiple "geoDetails" are supported.
  • Leaving "excludeGeo" out sets its value to false and can only be used together with "geoDetails" or will not be used.

Example Response

Location: /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/campaign/default/activity/86b35327-794c-11e4-8425-daf437376f87

Update Activity

Description: Update an existing activity
Verb: POST
Path: /api/v1/media_agency/<mediaAgencyId>/client/<clientId>/campaign/<campaignId>/activity/<activityId>

Request Parameters

Parameter Type Required Description Example
mediaAgencyId Path Yes Id of media agency 86b35325-794c-11e4-8425-daf437376f87
clientId Path Yes Id of client 86b35326-794c-11e4-8425-daf437376f87
campaignId Path Yes Id of campaign. Must be "default" in v1 default
activityId Path Yes Id of activity 86b35327-794c-11e4-8425-daf437376f87
apikey Query Yes API key for authentication and authorization secretkey123

Request JSON Body

Parameter Name Parameter Type Required Description Example
activityName String No Name of activity to be created Example Activity
flightStop ISO8601 Timestamp No Scheduled activity stop 2016-11-01T00:00:00Z
targetECPM Double No Target eCPM in account currency 2.4
orderId String No Order ID GXK-77123
budget Double No Activity budget in account currency 100000.0
impressionBudget Integer No Activity total impressions 500000
overrideVariables String (JSON) No Adserver tag variables to override {"fontsize": 24, "color": "red"}
enabled Boolean No Activity activation flag false
geoDetails ArrayList (JSON) No Latitude, longitude, radius for geo targeting [{"lat": 69.0, "long": 22, "radius": 20}]
excludeGeo Boolean No Excluded/included geo targets false

Response

HTTP 200 Updated with the URL to the updated activity in the Location header.

Example Request

POST /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/campaign/default/activity/86b35327-794c-11e4-8425-daf437376f87?apikey=secret123

Example Request Body

{
  "activityName": "Renamed Activity",
  "flightStop": "2016-11-01T00:00:00Z",
  "targetECPM": 4.2,
  "orderId": "GXK-88123",
  "budget": 200000.0,
  "enabled": true,
  "geoDetails": [
  {
  "lat": 69,
  "long": 21.5,
  "radius": 100
  }],
  "excludeGeo": true
}

Note:

  • Leaving "geoDetails" out will result in using existing geo targeting presets. "geoDetails" can only be included when activity for update already has geo targeting rule. When using "geoDetails", all fields must be set with valid latitude/longitude values and radius cannot be a negative. Multiple "geoDetails" are supported. Latitude/longitude and radius fields can be both integers or decimal numbers.
  • Leaving "excludeGeo" out sets its value to false and can only be used together with "geoDetails" or will not be used.

Example Response

Location: /api/v1/media_agency/86b35325-794c-11e4-8425-daf437376f87/client/86b35326-794c-11e4-8425-daf437376f87/campaign/default/activity/86b35327-794c-11e4-8425-daf437376f87

List Activity Templates

Description: List all activity templates
Verb: GET
Path: /api/v1/activity_templates

Request Parameters

Parameter Type Required Description Example
apikey Query Yes API key for authentication and authorization secretkey123

Response JSON Body

Parameter Parameter Type Description Example
top level Array of Activity Activities See below

Activity Object

Parameter Parameter Type Description Example
id String Id of activity 16b35327-794c-11e4-8425-daf437376f87
name String Name of activity Example Activity Template

Example Request

GET /api/v1/activity_templates?apikey=secret123

Example Response

[
  {
    "id": "16b35327-794c-11e4-8425-daf437376f87",
    "name": "Example Activity Template"
  }
]

Last modified: Tue Aug 14 2018 14:01:26 GMT+0200 (CEST)