Вы просматриваете старую версию данной страницы. Смотрите текущую версию.

Сравнить с текущим просмотр истории страницы

« Предыдущий Версия 11 Текущий »

There is an endpoint which allows DMPs to submit segment definitions and users and get realtime feedback.

The endpoint is located at this address: https://dmp-api.adhigh.net. It requires HTTP basic authentication (ask GetIntent for access).

Documentation can be found here: https://dmp-api.adhigh.net/docs.

Executing requests

Requires HTTP basic authentication.

All methods accept requests with {dmp} path variable and token query parameter:

  • {dmp} is your DMP ID in GetIntent
  • token is your user API token

The response is a JSON with the following structure:

Response structure
{
  "ok": true,
  "result": {},
  "error": "error description"
}

ok is set to true if the request was successful. If that's the case, result object will contain the request result. Otherwise (in case of unsuccessful request), error will contain error description.

HTTP status codes are:

  • 200 for a successful request
  • 403 if authentication failed
  • 500 in case of an error

Segment definitions endpoint

URL: https://dmp-api.adhigh.net/api/v1/{dmp}/segment?token=token

Content-Type: application/json

Verb: POST


Request and response example
{
  "id": 1000,
  "name": "Mens 18-24",
  "cost_type": "RATE",
  "cost_value": 20,
  "currency": "USD",
  // in order to make the segment available to all advertisers
  // set "advertisers" node to empty array or do not set it at all
  "advertisers": [
    1000,
    2000,
    3000
  ],
  "advertisers_prices_map" : {
		"5495": 0.2,
		"5501": 0.011
  },
  // A value of this field will be ignored, if the "advertisers" node isn't empty, otherwise 
  // a request will be handled like a value of it is false. The default value of the field is false. 
  "available_to_all": false
}


{
  "ok": true,
  "result": {
    "id": 12345
  }
}

See request format description here: DMP Batch API#taxonomy-format.

The result contains segment GetIntent segment ID.

Users batch endpoint

URL: https://dmp-api.adhigh.net/api/v1/{dmp}/batch?token=token&with_header=true

Query parameter with_header must be set to true if the file contains header (optional, defaults to true).

Content-Type: application/gzip

Verb: POST

Users batch file must be sent as a request body.

File format is described here: DMP Batch API#file-format

Response example
{
  "ok": true,
  "result": {
    "status": "PROCESSED",
    "users_added": 0,
    "segments_expired": 0,
    "segments_removed": 0
  }
}

status can be either PROCESSED or QUEUED. If the status is PROCESSED, the file has been processed and additional info is provided in the result object.

Note that the file will be processed in real time if the size does not exceed 5 megabytes.

Endpoint for getting information about segments

URL: https://dmp-api.adhigh.net/api/v1/{dmp}/segments?token=token

Verb: GET

response example
{
	"ok": true,
	"result": [{
		"id": "12345",
		"name": "12345",
		"cost_type": "NONE",
		"cost_value": 0.0,
		"currency": null,
		"advertisers": [123],
		"status": "CREATED",
		"advertisers_prices_map": {
			"5495":0.2,
			"5501":0.011
		},
        "available_to_all": false
	}]
}

Endpoint for getting information about a particular segment

URL: https://dmp-api.adhigh.net//api/v1/{dmp}/segments/{segment_id}?token=token

Verb: GET

response example
{
	"ok": true,
	"result": {
		"id": "12345",
		"name": "12345",
		"cost_type": "NONE",
		"cost_value": 0.0,
		"currency": null,
		"advertisers": [123],
		"status": "CREATED",
        "available_to_all": true
	}
}
  • Нет меток