| Отображение дочерних элементов |
|---|
|
...
For API Access
To receive API access, please reach out to Getintent sales team – us-sales@getintent.com.
Change log
| Date | API version | Change |
|---|
| 4 September 2015 | v1.33 | Added authentication reference |
| 24 September 2015 | v1.35 | Add "last-modified" support |
| 10 October 2015 | v1.36 | Added object "forecast" for advertiser |
| 5 November 2015 | v1.37 | Campaigns, campaign_groups, creatives, sites added to common objects |
| 23 March 2017 | v2.00 | API v2 documentation release |
Introduction
This document describes the API of GetIntent DSPGetintent platform. The API consists of two three major partsservices:
- Campaign management API. This API Common API service: allows to create and edit common RTB entities
- Advertiser API service: allows to manage advertiser advertising campaigns along with related entities (creatives, segments and etc)
- Reporting API . This part of API service: allows to get statistical information about campaign that are already running
...
- available reporting information campaign performance, available inventory, etc.
General approach
...
API is build built as JSON RESTful service . Each object has it’s JSON representation and could be retrieved using get method. Also list, update and new are available.
Each type of JSON object has name and id. The structure is as follows:\and support standard GET/PUT/DELETE methods over HTTP 1.1 protocol.
GET | read/retrieve |
PUT | create/add/update/modify |
DELETE | delete |
API endpoints
API URLs have the following pattern:
| Блок кода |
|---|
|
http://ui.getintent.com/api/v2/<object_type>/<action>(/<id>)?token=<token> |
API response codes
API always returns valid JSON as output, the following HTTP response codes are supported:
| Response code | Description |
|---|
| 200 | Success |
| 400 | Validation error |
| 403 | API not found |
| 404 | Object not found |
| 500 | Server error |
API error example:
| Блок кода |
|---|
|
{
"error": 1,
"code": 403,
"msg": "Unavailable AdData object 'aadvertisers'"
} |
JSON data model
RTB data model contains several entities, each entity has it’s own JSON representation with name and id:
| Блок кода |
|---|
|
{
id: 1,
name: "<name>",
...
} |
Also some object objects may belong to a specific advertiser, in this case advertiser_id field would be required
| Блок кода |
|---|
|
{
id: 1,
name: "<name>",
advertiser_id: 6
...
} |
The general URL API pattern is:
| Блок кода |
|---|
|
http://ui.getintent.com/api/v1/<object_type>/<action>(/<id>)?token=<token> |
Where token is authentication token (it could be obtained through user settings in UI)
Common and System Objects
Here you'll find API examples for work with Common and System objects.
Also those methods should be used for Advertiser's settings management.
Important! All variables are required.
Variables
| Variable | Description |
|---|
| <entity> | Object type (reference_tables, segment_definitions и тд) |
| <entity_id> | Object's ID |
| <token> | Token for API access. Its value can be found at "my settings" user's menu. Important: token has to belong to Admin user. |
Available Entities
| ID | Description |
|---|
| advertisers | Advertiser and its settings. Important: Advertiser's objects have to be managed at Advertiser's level |
| segment_definitions | Common segments |
| reference_tables | Contains additional information and variety settings |
| domains_lists | Common domain lists |
| snippets | Common snippets |
Methods
Entity's objects list
| Блок кода |
|---|
|
GET https://ui.getintent.com/api/v1/<entity>/list?token=<token> |
Returns System and Common <entity> type Objects list.
"id" and "name" fields will be returned for each object by default.
Here is example of such "list" method:
| Блок кода |
|---|
| language | js |
|---|
| title | Code Sample "list" method |
|---|
|
{
"137": {
"id": 137,
"name": "Test campaign!"
},
...
"4452": {
"id": 4452,
"name": "test"
}
} |
If any additional fields are needed at the list just put all of them separated by comma at GET custom_fields parameter.
In case you need to get list of objects with absolutely all existing fields, just use "all" method as below:
| Блок кода |
|---|
|
GET https://ui.getintent.com/api/v1/<entity>/all?token=<token> |
Additional parameters
API output
API output can be controlled by the following additional parameters and headers
| Parameter | Description | Method | Values | Default |
|---|
Parameter | Description | Available at, method | Values | By default | Example |
|---|
mode | Affects on list's view. Old version: all collection will be returned at root (deprecated) New version: all collection will be placed to data node Value recommend to use always: 1 | all, list | 0 - old version (deprecated). 1 - new version. | 0 | ../list?token=<token>&mode=1 |
custom_fields | Includes |
all listed object's output for "list" method output (by default "list" method returns only "id" and "name" fields) | list |
Listed by comma additional . | null | ../list?token=<token>&custom_fields= |
starts,ends<field1>,<field2>,... |
page_limit |
Limits count of items per request.
Realizes pagination.
Items per one page. If "page_limit" parameter is used, then "mode" property's value becomes mode=1 automatically. | all, list |
Count of items per one page.listall?token=<token>&page_limit=10 |
page |
Current page. Works with | Retrieves page [N] output, works only in case "page_limit" |
method together only| parameter is set. | all, list |
Current page in output. | null | integer | null | ../all?token=<token>&page_limit=10&page=2 |
pretty | Controls JSON output format. | all,list | 0 - minimized JSON , 1 - formatted JSON | 0 | ../list?token=<token>&page_limit=10& |
page2| Parameter | Description | Available at, method | Values | By default | Example |
|---|
if-modified-since |
Return header Returns "HTTP 304 Not Modified |
" header without content, if data has not been updated since |
this requested date | list | Date in specify formatD, d M Y H:i:s GMT | null | if-modified-since: Fri, 18 Sep 2015 10:34:37 GMT |
Create an Entity
| Блок кода |
|---|
|
PUT https://ui.getintent.com/api/v1/<entity>/new?token=<token> |
Use PUT request type. At JSON with object's structure have to be at request's body.
Example:
| Блок кода |
|---|
|
curl --data '{"name": "title"}' -X PUT https://ui.getintent.com/api/v1/<entity>/new?token=<token> |
Get an Entity
| Блок кода |
|---|
|
GET https://ui.getintent.com/api/v1/<entity>/get/<entity_id>?token=<token> |
Example:
| Блок кода |
|---|
|
curl -X GET https://ui.getintent.com/api/v1/<entity>/get/<entity_id>?token=<token> |
| Parameter | Description | Available at, method | Values | By default | Example |
|---|
| if-modified-since | Return header HTTP 304 Not Modified without content, if data has not updated since this date | get | Date in specify formatD, d M Y H:i:s GMT | null | if-modified-since: Fri, 18 Sep 2015 10:34:37 GMT |
Update an Entity
| Блок кода |
|---|
|
PUT https://ui.getintent.com/api/v1/<entity>/edit/<entity_id>?token=<token> |
Use PUT request type. At JSON with object's structure have to be at request's body.
Example:
| Блок кода |
|---|
|
curl --data '{"name": "new title"}' -X PUT https://ui.getintent.com/api/v1/<entity>/edit/<entity_id>?token=<token> |
Delete an Entity
| Блок кода |
|---|
|
DELETE https://ui.getintent.com/api/v1/<entity>/delete/<entity_id>?token=<token> |
Example:
| js | | title | Example of API JSON output in case pagination mode |
|---|
|
{
"data": {
"921": {
"id": "921",
"name": "test_campaign"
},
"1400": {
"id": "1400",
"name": "1"
}
},
"pages": {
"total_elements": "6",
"total_pages": 3,
"current_page": 1,
"previous_page": false,
"next_page": 2,
"page_size": 2,
"offset": 0
}
} |
| Блок кода |
|---|
|
curl -X DELETE https://ui.getintent.com/api/v1/<entity>/delete/<entity_id>?token=<token> |