1. Authorization

1.1. Login

This `POST` request will return result login and token

1.1.1. Request Body

Path Type Description Required

email

string

User email

+

password

string

User password

+

1.1.2. HTTP Request

URL

POST api/users/login HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
DATA
{
    "email": "test@example.org",
    "password": "password"
}

1.1.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/users/login' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
    -d '{
    "email": "test@example.org",
    "password": "password"
}'

1.1.4. Response Body

Path Type Description

access_token

string

This token is used in queries. HEADER: "Authorization: Bearer <this token>"

token_type

string

Token type

expires_in

int

Time token live in seconds

1.1.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    X-ratelimit-limit: 10
    X-ratelimit-remaining: 9
    Access-control-allow-origin: *
{
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMvYXBpL3VzZXJzL2xvZ2luIiwiaWF0IjoxNzIxNzQxNzAxLCJleHAiOjE3MjE3NDUzMDEsIm5iZiI6MTcyMTc0MTcwMSwianRpIjoicUpESnluQzhmdVFGV3ZPcyIsInN1YiI6IjIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.LYdyWvb0BdTTyLstUeSVxoyq8XeDytvYrwjqnJgTSQA",
    "token_type": "bearer",
    "expires_in": "60"
}

1.2. Log out

A `POST` request will return result logout

1.2.1. HTTP Request

URL

POST api/logout HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJZVnpwN1VYb1c0ZENPZG12Iiwic3ViIjoiMyIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.1mmW0DrdP8-dHBWBoCB7Q3Ichi6SptoA7l81rWIpmAM
DATA
{}

1.2.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/logout' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJZVnpwN1VYb1c0ZENPZG12Iiwic3ViIjoiMyIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.1mmW0DrdP8-dHBWBoCB7Q3Ichi6SptoA7l81rWIpmAM' \
    -d '{}'

1.2.3. Response Body

Path Type Description

message

string

Result message

1.2.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
{
    "message": "Successfully logged out"
}

2. Statistic

2.1. Statistic

A `POST` request will return statistic.

2.1.1. Request Body

Path Type Description Required

timezone

integer

Timezone
"Etc/GMT+12"…​"Etc/GMT+1", "Etc/GMT", "Etc/GMT-1"…​"Etc/GMT-12" \n"America/Anchorage"…​"Europe/Istanbul", "Asia/Tokyo"

from

date

Start date (yyyy-mm-dd)

+

to

date

End date (yyyy-mm-dd)

+

groupBy

array

Grouping fields:
YMD - Date
YMDH - Date time. Period: 2 days max
campaignId - Campaign
creativeId - Creative
country - Country
connectionType - Connection Type
carrier - Carrier
sspId - Ssp
region - Region
city - City
browser - Browser
os - Device OS
appName - App Name
siteName - Domain Name
source - Source
originalPubId - Publisher Id
sitePage - Site Page
trafficType - Media Type
requestType - Traffic Type
deviceType - Mobile Type
language - Language
size - Width x Height
isPmpReq - Pmp

+

agregatedFields

array

Agregated fields:
bids - Bids
wins - Wins
impressions - Impressions
clicks - Clicks
conversions - Conversions
reach - Reach
dspSpend - Spend
ecpm - eCPM
ecpc - eCPC
ctr - CTR
winrate - Win Rate

+

orderField

string

Sorting field

orderDir

string

Sort order: "asc" or "desc"

page

integer

Pagination: page number

rowsOnPage

integer

Pagination: rows on page (min:10, max:50000)

2.1.2. HTTP Request

URL

POST api/statistic HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJLMmdoZDdsV0RoYlJLREd0Iiwic3ViIjoiNDYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.NEt5D3MM8Qk4pdfrXQtS2AyM3-fYBd-DDBGy_ku-t_Y
DATA
{
    "timezone": "Etc\/GMT+10",
    "from": "2024-07-21",
    "to": "2024-07-23",
    "groupBy": [
        "YMD",
        "campaignId",
        "creativeId"
    ],
    "agregatedFields": [
        "bids",
        "wins",
        "impressions",
        "clicks",
        "dspSpend",
        "winrate",
        "ctr"
    ],
    "orderField": "YMD",
    "orderDir": "desc",
    "page": 1,
    "rowsOnPage": 25
}

2.1.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/statistic' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJLMmdoZDdsV0RoYlJLREd0Iiwic3ViIjoiNDYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.NEt5D3MM8Qk4pdfrXQtS2AyM3-fYBd-DDBGy_ku-t_Y' \
    -d '{
    "timezone": "Etc\/GMT+10",
    "from": "2024-07-21",
    "to": "2024-07-23",
    "groupBy": [
        "YMD",
        "campaignId",
        "creativeId"
    ],
    "agregatedFields": [
        "bids",
        "wins",
        "impressions",
        "clicks",
        "dspSpend",
        "winrate",
        "ctr"
    ],
    "orderField": "YMD",
    "orderDir": "desc",
    "page": 1,
    "rowsOnPage": 25
}'

2.1.4. Response Body

Path Type Description

status

string

Report status

data.*.YMD

date

Date

data.*.campaignId

integer

Campaign id

data.*.campaignId_dict

string

Campaign name

data.*.creativeId

integer

Creative id

data.*.creativeId_dict

string

Creative name

data.*.bids

integer

Bids

data.*.wins

integer

Wins

data.*.impressions

integer

Impressions

data.*.dspSpend

float

Spend, $

data.*.winrate

float

Win Rate, %

data.*.ecpm

integer

eCPM, $

data.*.clicks

integer

Clicks

data.*.conversions

integer

Conversions

data.*.ctr

float

CTR, %

totals.YMD

date

Date

totals.campaignId

integer

Campaign id

totals.campaignId_dict

string

Campaign name

totals.creativeId

integer

Creative id

totals.creativeId_dict

string

Creative name

totals.bids

integer

Bids

totals.wins

integer

Wins

totals.impressions

integer

Impressions

totals.dspSpend

float

Spend, $

totals.winrate

float

Win Rate, %

totals.ecpm

integer

eCPM, $

totals.clicks

integer

Clicks

totals.conversions

integer

Conversions

totals.ctr

float

CTR, %

pagination.page

integer

Pagination: current page number

pagination.per_page

integer

Pagination: items per page

pagination.total

integer

Pagination: total items count

2.1.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "status": "success",
    "data": [
        {
            "YMD": "2024-07-23",
            "campaignId": 1,
            "campaignId_dict": "Rerum aut| id# 1",
            "creativeId": 12,
            "creativeId_dict": "Qui et| id# 12",
            "bids": 808,
            "wins": 511,
            "impressions": 411,
            "dspSpend": 0.38846,
            "winrate": 63.242574257425744,
            "ecpm": 0.9451581508515816,
            "clicks": 18,
            "conversions": 4,
            "ctr": 4.37956204379562
        },
        {
            "YMD": "2024-07-23",
            "campaignId": 2,
            "campaignId_dict": "Consequatur sint| id# 2",
            "creativeId": 11,
            "creativeId_dict": "Alias quae| id# 11",
            "bids": 694,
            "wins": 446,
            "impressions": 376,
            "dspSpend": 0.26164,
            "winrate": 64.26512968299711,
            "ecpm": 0.6958510638297872,
            "clicks": 38,
            "conversions": 45,
            "ctr": 10.106382978723405
        },
        {
            "YMD": "2024-07-23",
            "campaignId": 2,
            "campaignId_dict": "Voluptatem voluptatem| id# 2",
            "creativeId": 12,
            "creativeId_dict": "Harum non| id# 12",
            "bids": 567,
            "wins": 364,
            "impressions": 267,
            "dspSpend": 0.46694,
            "winrate": 64.19753086419753,
            "ecpm": 1.7488389513108613,
            "clicks": 30,
            "conversions": 46,
            "ctr": 11.235955056179776
        },
        {
            "YMD": "2024-07-22",
            "campaignId": 1,
            "campaignId_dict": "Vel eos| id# 1",
            "creativeId": 11,
            "creativeId_dict": "Laboriosam sapiente| id# 11",
            "bids": 812,
            "wins": 347,
            "impressions": 275,
            "dspSpend": 0.24221,
            "winrate": 42.73399014778325,
            "ecpm": 0.8807636363636364,
            "clicks": 39,
            "conversions": 12,
            "ctr": 14.181818181818182
        },
        {
            "YMD": "2024-07-23",
            "campaignId": 1,
            "campaignId_dict": "Hic possimus| id# 1",
            "creativeId": 11,
            "creativeId_dict": "Omnis exercitationem| id# 11",
            "bids": 315,
            "wins": 98,
            "impressions": 74,
            "dspSpend": 0.4392,
            "winrate": 31.11111111111111,
            "ecpm": 5.935135135135135,
            "clicks": 12,
            "conversions": 50,
            "ctr": 16.216216216216218
        },
        {
            "YMD": "2024-07-22",
            "campaignId": 1,
            "campaignId_dict": "Dolorum ad| id# 1",
            "creativeId": 12,
            "creativeId_dict": "Ullam non| id# 12",
            "bids": 888,
            "wins": 434,
            "impressions": 303,
            "dspSpend": 0.30363,
            "winrate": 48.873873873873876,
            "ecpm": 1.002079207920792,
            "clicks": 40,
            "conversions": 21,
            "ctr": 13.201320132013201
        },
        {
            "YMD": "2024-07-22",
            "campaignId": 2,
            "campaignId_dict": "A tempora| id# 2",
            "creativeId": 11,
            "creativeId_dict": "Deserunt nesciunt| id# 11",
            "bids": 942,
            "wins": 450,
            "impressions": 370,
            "dspSpend": 0.2281,
            "winrate": 47.77070063694268,
            "ecpm": 0.6164864864864865,
            "clicks": 22,
            "conversions": 37,
            "ctr": 5.945945945945946
        },
        {
            "YMD": "2024-07-22",
            "campaignId": 2,
            "campaignId_dict": "Officia sunt| id# 2",
            "creativeId": 12,
            "creativeId_dict": "Recusandae est| id# 12",
            "bids": 513,
            "wins": 190,
            "impressions": 151,
            "dspSpend": 0.16237,
            "winrate": 37.03703703703704,
            "ecpm": 1.075298013245033,
            "clicks": 26,
            "conversions": 15,
            "ctr": 17.218543046357617
        },
        {
            "YMD": "2024-07-21",
            "campaignId": 1,
            "campaignId_dict": "Voluptatibus doloribus| id# 1",
            "creativeId": 11,
            "creativeId_dict": "Ut repellendus| id# 11",
            "bids": 514,
            "wins": 337,
            "impressions": 254,
            "dspSpend": 0.36385,
            "winrate": 65.56420233463035,
            "ecpm": 1.43248031496063,
            "clicks": 11,
            "conversions": 16,
            "ctr": 4.330708661417323
        },
        {
            "YMD": "2024-07-21",
            "campaignId": 1,
            "campaignId_dict": "Fuga a| id# 1",
            "creativeId": 12,
            "creativeId_dict": "Nihil ut| id# 12",
            "bids": 113,
            "wins": 56,
            "impressions": 43,
            "dspSpend": 0.39035,
            "winrate": 49.557522123893804,
            "ecpm": 9.077906976744185,
            "clicks": 12,
            "conversions": 33,
            "ctr": 27.906976744186046
        },
        {
            "YMD": "2024-07-21",
            "campaignId": 2,
            "campaignId_dict": "Dicta ut| id# 2",
            "creativeId": 11,
            "creativeId_dict": "Beatae omnis| id# 11",
            "bids": 269,
            "wins": 113,
            "impressions": 94,
            "dspSpend": 0.20993,
            "winrate": 42.00743494423792,
            "ecpm": 2.2332978723404255,
            "clicks": 9,
            "conversions": 17,
            "ctr": 9.574468085106384
        },
        {
            "YMD": "2024-07-21",
            "campaignId": 2,
            "campaignId_dict": "Est ab| id# 2",
            "creativeId": 12,
            "creativeId_dict": "Quis minus| id# 12",
            "bids": 323,
            "wins": 208,
            "impressions": 151,
            "dspSpend": 0.42039,
            "winrate": 64.39628482972137,
            "ecpm": 2.7840397350993378,
            "clicks": 5,
            "conversions": 18,
            "ctr": 3.3112582781456954
        }
    ],
    "totals": {
        "YMD": "",
        "campaignId": 0,
        "campaignId_dict": "",
        "creativeId": 0,
        "creativeId_dict": "",
        "bids": 6758,
        "wins": 3554,
        "impressions": 2769,
        "dspSpend": 3.8770699999999994,
        "winrate": 51.72978265365432,
        "ecpm": 2.3689446286906577,
        "clicks": 262,
        "conversions": 314,
        "ctr": 11.467429614158783
    },
    "pagination": {
        "page": 1,
        "per_page": 25,
        "total": 12
    }
}

2.2. Filtering statistic

A `POST` request will return statistic.

2.2.1. Request Body

Path Type Description Required

timezone

integer

Timezone
"Etc/GMT+12"…​"Etc/GMT+1", "Etc/GMT", "Etc/GMT-1"…​"Etc/GMT-12" \n"America/Anchorage"…​"Europe/Istanbul", "Asia/Tokyo"

from

date

Start date (yyyy-mm-dd)

+

to

date

End date (yyyy-mm-dd)

+

groupBy

array

Grouping fields:
YMD - Date
YMDH - Date time. Period: 2 days max
campaignId - Campaign
creativeId - Creative
country - Country
connectionType - Connection Type
carrier - Carrier
sspId - Ssp
region - Region
city - City
browser - Browser
os - Device OS
appName - App Name
siteName - Domain Name
source - Source
originalPubId - Publisher Id
sitePage - Site Page
trafficType - Media Type
requestType - Traffic Type
deviceType - Mobile Type
language - Language
size - Width x Height
isPmpReq - Pmp

+

agregatedFields

array

Agregated fields:
bids - Bids
wins - Wins
impressions - Impressions
clicks - Clicks
conversions - Conversions
reach - Reach
dspSpend - Spend
ecpm - eCPM
ecpc - eCPC
ctr - CTR
winrate - Win Rate

+

filter.campaignId

integer

Filtering by Campaign Id(cid)

filter.creativeId

integer

Filtering by Creative Id(bid)

orderField

string

Sorting field

orderDir

string

Sort order: "asc" or "desc"

page

integer

Pagination: page number

rowsOnPage

integer

Pagination: rows on page (min:10, max:50000)

2.2.2. HTTP Request

URL

POST api/statistic HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJURUxNREVYa2dRWHB2YUVFIiwic3ViIjoiNDciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.-s59mQ-HoRsrKlEW0ee3wrqkVwqBxvxPWkBWvWpEHqg
DATA
{
    "timezone": "UTC",
    "from": "2024-07-21",
    "to": "2024-07-23",
    "groupBy": [
        "YMD",
        "campaignId",
        "creativeId"
    ],
    "agregatedFields": [
        "bids",
        "wins",
        "impressions",
        "clicks",
        "dspSpend",
        "winrate",
        "ctr"
    ],
    "filter": {
        "campaignId": 1,
        "creativeId": 10
    },
    "orderField": "YMD",
    "orderDir": "desc",
    "page": 1,
    "rowsOnPage": 25
}

2.2.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/statistic' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJURUxNREVYa2dRWHB2YUVFIiwic3ViIjoiNDciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.-s59mQ-HoRsrKlEW0ee3wrqkVwqBxvxPWkBWvWpEHqg' \
    -d '{
    "timezone": "UTC",
    "from": "2024-07-21",
    "to": "2024-07-23",
    "groupBy": [
        "YMD",
        "campaignId",
        "creativeId"
    ],
    "agregatedFields": [
        "bids",
        "wins",
        "impressions",
        "clicks",
        "dspSpend",
        "winrate",
        "ctr"
    ],
    "filter": {
        "campaignId": 1,
        "creativeId": 10
    },
    "orderField": "YMD",
    "orderDir": "desc",
    "page": 1,
    "rowsOnPage": 25
}'

2.2.4. Response Body

Path Type Description

status

string

Report status

data.*.YMD

date

Date

data.*.campaignId

integer

Campaign id

data.*.campaignId_dict

string

Campaign name

data.*.creativeId

integer

Creative id

data.*.creativeId_dict

string

Creative name

data.*.bids

integer

Bids

data.*.wins

integer

Wins

data.*.impressions

integer

Impressions

data.*.dspSpend

float

Spend, $

data.*.winrate

float

Win Rate, %

data.*.ecpm

integer

eCPM, $

data.*.clicks

integer

Clicks

data.*.conversions

integer

Conversions

data.*.ctr

float

CTR, %

totals.YMD

date

Date

totals.campaignId

integer

Campaign id

totals.campaignId_dict

string

Campaign name

totals.creativeId

integer

Creative id

totals.creativeId_dict

string

Creative name

totals.bids

integer

Bids

totals.wins

integer

Wins

totals.impressions

integer

Impressions

totals.dspSpend

float

Spend, $

totals.winrate

float

Win Rate, %

totals.ecpm

integer

eCPM, $

totals.clicks

integer

Clicks

totals.conversions

integer

Conversions

totals.ctr

float

CTR, %

pagination.page

integer

Pagination: current page number

pagination.per_page

integer

Pagination: items per page

pagination.total

integer

Pagination: total items count

2.2.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "status": "success",
    "data": [
        {
            "YMD": "2024-07-22",
            "campaignId": 1,
            "campaignId_dict": "Et consequuntur| id# 1",
            "creativeId": 10,
            "creativeId_dict": "Maiores numquam| id# 10",
            "bids": 273,
            "wins": 189,
            "impressions": 139,
            "dspSpend": 0.39285,
            "winrate": 69.23076923076923,
            "ecpm": 2.826258992805755,
            "clicks": 23,
            "conversions": 1,
            "ctr": 16.546762589928058
        },
        {
            "YMD": "2024-07-23",
            "campaignId": 1,
            "campaignId_dict": "Qui eos| id# 1",
            "creativeId": 10,
            "creativeId_dict": "Facere illum| id# 10",
            "bids": 210,
            "wins": 130,
            "impressions": 93,
            "dspSpend": 0.2715,
            "winrate": 61.904761904761905,
            "ecpm": 2.9193548387096775,
            "clicks": 15,
            "conversions": 42,
            "ctr": 16.129032258064516
        },
        {
            "YMD": "2024-07-21",
            "campaignId": 1,
            "campaignId_dict": "Unde aut| id# 1",
            "creativeId": 10,
            "creativeId_dict": "Qui eos| id# 10",
            "bids": 332,
            "wins": 223,
            "impressions": 164,
            "dspSpend": 0.12519,
            "winrate": 67.16867469879519,
            "ecpm": 0.7633536585365853,
            "clicks": 16,
            "conversions": 20,
            "ctr": 9.75609756097561
        }
    ],
    "totals": {
        "YMD": "",
        "campaignId": 0,
        "campaignId_dict": "",
        "creativeId": 0,
        "creativeId_dict": "",
        "bids": 815,
        "wins": 542,
        "impressions": 396,
        "dspSpend": 0.78954,
        "winrate": 66.10140194477543,
        "ecpm": 2.1696558300173394,
        "clicks": 54,
        "conversions": 63,
        "ctr": 14.14396413632273
    },
    "pagination": {
        "page": 1,
        "per_page": 25,
        "total": 3
    }
}

3. Campaigns

3.1. Campaigns list

A `GET` request will return a list of an campaigns.

3.1.1. HTTP Request

URL

GET api/campaigns HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJncjMwVW9NaDk5cmRQS05IIiwic3ViIjoiNCIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.BQfh5z7UcrgTygi0O-asiTB2r_m55EC6TOmeRrzVvzM
DATA
{}

3.1.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJncjMwVW9NaDk5cmRQS05IIiwic3ViIjoiNCIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.BQfh5z7UcrgTygi0O-asiTB2r_m55EC6TOmeRrzVvzM' \
    -d '{}'

3.1.3. Response Body

Path Type Description

data.*.id

integer

Campaign Id(test)

data.*.userId

integer

User Id

data.*.isActive

boolean

Campaign On/Off

data.*.isRunning

boolean

Campaign running status

data.*.type

string

Campaign type: banner, native, video, audio

data.*.name

string

Campaign name

data.*.isRewarded

integer

Rewarded video (for video creatives)

data.*.isDesktopWeb

boolean

Traffic Type: Desktop Websites

data.*.isMobileApp

boolean

Traffic Type: Mobile Applications

data.*.isMobileWeb

boolean

Traffic Type: Mobile Websites

data.*.isSmartphone

boolean

Traffic Type: Smartphones

data.*.isTablet

boolean

Traffic Type: Tablets

data.*.isCTV

boolean

Traffic Type: CTVs

data.*.isDOOH

boolean

Traffic Type: DOOH

data.*.aDomain

integer

Top level domain

data.*.dateStart

date

Date start

data.*.dateEnd

date

Date end

data.*.geoCountries

array

GEO Targeting: countries list

data.*.geoCountriesIsInclude

boolean

GEO Targeting: countries list type (true: whitelist, false: blacklist)

data.*.geoRegions

array

GEO Targeting: regions list

data.*.geoRegionsIsInclude

boolean

GEO Targeting: regions list type (true: whitelist, false: blacklist)

data.*.geoCities

array

GEO Targeting: cities list

data.*.geoCitiesIsInclude

boolean

GEO Targeting: cities list type (true: whitelist, false: blacklist)

data.*.contentCategories

array

Targeting: IAB Categories list

data.*.contentCategoriesIsInclude

boolean

Targeting: IAB Categories list type (true: whitelist, false: blacklist)

data.*.userAgeMin

integer

Targeting: Age range from

data.*.userAgeMax

integer

Targeting: Age range to

data.*.connectionTypes

array

Targeting: Connection types list

data.*.clickedInventoryCategories

array

Сlicked Inventory Categories

data.*.deviceCarrier

array

Targeting: List of network operators.

data.*.deviceCarrierIsInclude

boolean

Targeting: List of network operators type (true: whitelist, false: blacklist)

data.*.OS

array

Targeting: The operating system of user's device

data.*.OSIsInclude

boolean

Targeting: The operating system of user's device list type (true: whitelist, false: blacklist)

data.*.browser

array

Targeting: The user's browsers list

data.*.browserIsInclude

boolean

Targeting: The user's browsers list type (true: whitelist, false: blacklist)

data.*.deviceLanguage

array

Targeting: The languages of user's browser

data.*.deviceLanguageIsInclude

boolean

Targeting: The languages of user's browser list type (true: whitelist, false: blacklist)

data.*.spentDailyLimit

integer

Daily spent limit

data.*.spentTotalLimit

integer

Total spent limit

data.*.impressionsDailyLimit

integer

Daily impressions limit

data.*.impressionsTotalLimit

integer

Total impressions limit

data.*.clicksDailyLimit

integer

Daily clicks limit

data.*.clicksTotalLimit

integer

Total clicks limit

data.*.budgetUse

integer

Distribution: pacer, fast pacer - Evenly distribution fast - ASAP distribution

data.*.allSources

boolean

Inventory: Use all SSP endpoints

data.*.cpm

float

cpm

data.*.adaptiveCpm

boolean

adaptiveCpm

data.*.useCpm

boolean

use cpm

data.*.extendedStatus

string

Campaign extended status

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

data.*.deletedAt

datetime

Date of deletion

meta.pagination.total

integer

Pagination: total items count

meta.pagination.count

integer

Pagination: page items count

meta.pagination.per_page

integer

Pagination: items per page

meta.pagination.current_page

integer

Pagination: current page number

meta.pagination.total_pages

integer

Pagination: total pages count

meta.pagination.links

array

Pagination: urls to next,prev page

3.1.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": [
        {
            "id": 1,
            "userId": 4,
            "isActive": false,
            "isRunning": false,
            "type": "banner",
            "name": "Odio.",
            "isRewarded": false,
            "isDesktopWeb": true,
            "isMobileApp": true,
            "isMobileWeb": true,
            "isSmartphone": true,
            "isTablet": true,
            "isCTV": true,
            "isDOOH": false,
            "aDomain": "torp.com",
            "dateStart": "2024-02-28",
            "dateEnd": "2025-03-28",
            "geoCountries": [],
            "geoCountriesIsInclude": true,
            "geoRegions": [],
            "geoRegionsIsInclude": true,
            "geoCities": [],
            "geoCitiesIsInclude": true,
            "contentCategories": [],
            "contentCategoriesIsInclude": true,
            "userAgeMin": 0,
            "userAgeMax": 0,
            "connectionTypes": [
                "wifi"
            ],
            "clickedInventoryCategories": [],
            "deviceCarrier": [],
            "deviceCarrierIsInclude": true,
            "OS": [],
            "OSIsInclude": true,
            "browser": [],
            "browserIsInclude": true,
            "deviceLanguage": [],
            "deviceLanguageIsInclude": true,
            "spentDailyLimit": 196,
            "spentTotalLimit": 4930,
            "impressionsDailyLimit": 291568,
            "impressionsTotalLimit": 400000,
            "clicksDailyLimit": 0,
            "clicksTotalLimit": 0,
            "budgetUse": "fast",
            "allSources": true,
            "cpm": 0,
            "adaptiveCpm": false,
            "useCpm": false,
            "extendedStatus": "Campaign is not active",
            "createdAt": "2024-07-23",
            "updatedAt": "2024-07-23",
            "deletedAt": null
        },
        {
            "id": 2,
            "userId": 4,
            "isActive": false,
            "isRunning": false,
            "type": "native",
            "name": "Dolor.",
            "isRewarded": false,
            "isDesktopWeb": true,
            "isMobileApp": true,
            "isMobileWeb": false,
            "isSmartphone": true,
            "isTablet": true,
            "isCTV": false,
            "isDOOH": true,
            "aDomain": "rath.com",
            "dateStart": "2023-05-13",
            "dateEnd": "2025-07-22",
            "geoCountries": [],
            "geoCountriesIsInclude": true,
            "geoRegions": [],
            "geoRegionsIsInclude": true,
            "geoCities": [],
            "geoCitiesIsInclude": true,
            "contentCategories": [],
            "contentCategoriesIsInclude": true,
            "userAgeMin": 0,
            "userAgeMax": 0,
            "connectionTypes": [
                "wifi"
            ],
            "clickedInventoryCategories": [],
            "deviceCarrier": [],
            "deviceCarrierIsInclude": true,
            "OS": [],
            "OSIsInclude": true,
            "browser": [],
            "browserIsInclude": true,
            "deviceLanguage": [],
            "deviceLanguageIsInclude": true,
            "spentDailyLimit": 115,
            "spentTotalLimit": 3468,
            "impressionsDailyLimit": 220169,
            "impressionsTotalLimit": 400000,
            "clicksDailyLimit": 0,
            "clicksTotalLimit": 0,
            "budgetUse": "fast",
            "allSources": true,
            "cpm": 0,
            "adaptiveCpm": false,
            "useCpm": false,
            "extendedStatus": "Campaign is not active",
            "createdAt": "2024-07-23",
            "updatedAt": "2024-07-23",
            "deletedAt": null
        }
    ],
    "meta": {
        "pagination": {
            "total": 2,
            "count": 2,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

3.2. Get by ID

A `GET` request with a path parameter of the id will return the campaign with that id.

3.2.1. HTTP Request

URL

GET api/campaigns/3 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiI5NmNRaGZ1anpacHE2TWtVIiwic3ViIjoiNSIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.Dwsp-Wp7ePJlAoF7WkGFZrEbTvcL8J_IKmJSfLS2Qmc
DATA
{}

3.2.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/3' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiI5NmNRaGZ1anpacHE2TWtVIiwic3ViIjoiNSIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.Dwsp-Wp7ePJlAoF7WkGFZrEbTvcL8J_IKmJSfLS2Qmc' \
    -d '{}'

3.2.3. Response Body

Path Type Description

data.id

integer

Campaign Id

data.userId

integer

User Id

data.isActive

boolean

Campaign On/Off

data.isRunning

boolean

Campaign running status

data.type

string

Campaign type: banner, native, video, audio

data.name

string

Campaign name

data.isRewarded

integer

Rewarded video (for video creatives)

data.isDesktopWeb

boolean

Traffic Type: Desktop Websites

data.isMobileApp

boolean

Traffic Type: Mobile Applications

data.isMobileWeb

boolean

Traffic Type: Mobile Websites

data.isSmartphone

boolean

Traffic Type: Smartphones

data.isTablet

boolean

Traffic Type: Tablets

data.isCTV

boolean

Traffic Type: CTV

data.isDOOH

boolean

Traffic Type: DOOH

data.aDomain

integer

Top level domain

data.dateStart

date

Date start

data.dateEnd

date

Date end

data.geoCountries

array

GEO Targeting: countries list

data.geoCountriesIsInclude

boolean

GEO Targeting: countries list type (true: whitelist, false: blacklist)

data.geoRegions

array

GEO Targeting: regions list

data.geoRegionsIsInclude

boolean

GEO Targeting: regions list type (true: whitelist, false: blacklist)

data.geoCities

array

GEO Targeting: cities list

data.geoCitiesIsInclude

boolean

GEO Targeting: cities list type (true: whitelist, false: blacklist)

data.contentCategories

array

Targeting: IAB Categories list

data.contentCategoriesIsInclude

boolean

Targeting: IAB Categories list type (true: whitelist, false: blacklist)

data.userAgeMin

integer

Targeting: Age range from

data.userAgeMax

integer

Targeting: Age range to

data.connectionTypes

array

Targeting: Connection types list

data.clickedInventoryCategories

array

Сlicked Inventory Categories

data.deviceCarrier

array

Targeting: List of network operators.

data.deviceCarrierIsInclude

boolean

Targeting: List of network operators type (true: whitelist, false: blacklist)

data.OS

array

Targeting: The operating system of user's device

data.OSIsInclude

boolean

Targeting: The operating system of user's device list type (true: whitelist, false: blacklist)

data.browser

array

Targeting: The user's browsers list

data.browserIsInclude

boolean

Targeting: The user's browsers list type (true: whitelist, false: blacklist)

data.deviceLanguage

array

Targeting: The languages of user's browser

data.deviceLanguageIsInclude

boolean

Targeting: The languages of user's browser list type (true: whitelist, false: blacklist)

data.spentDailyLimit

integer

Daily spent limit

data.spentTotalLimit

integer

Total spent limit

data.impressionsDailyLimit

integer

Daily impressions limit

data.impressionsTotalLimit

integer

Total impressions limit

data.clicksDailyLimit

integer

Daily clicks limit

data.clicksTotalLimit

integer

Total clicks limit

data.budgetUse

integer

Distribution: pacer, fast pacer - Evenly distribution fast - ASAP distribution

data.allSources

boolean

Inventory: Use all SSP endpoints

data.classicPush

boolean

Push - PUSH Campaigns

data.inPagePush

string

In-Page Push - PUSH Campaigns

data.pricingModel

string

Pricing model: CPM - PUSH Campaigns

data.cpm

float

cpm

data.adaptiveCpm

boolean

adaptiveCpm

data.useCpm

boolean

use cpm

data.landingPageUrl

string

Landing page URL - PUSH Campaigns

data.googleAnalyticsTrackingCode

string

Google Analytics tracking code - PUSH Campaigns

data.dynamicTargeting

array

SmartCPC: Dynamic targeting - only for CPC Pricing model

data.subscriptionAge

array

Subscription Age - only for CPC Pricing model

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.extendedStatus

string

Campaign extended status

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.deletedAt

datetime

Date of deletion

data.pretarget

int

pretarget

3.2.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 3,
        "userId": 5,
        "isActive": true,
        "isRunning": false,
        "type": "native",
        "name": "Test Campaign #1",
        "isRewarded": false,
        "isDesktopWeb": false,
        "isMobileApp": true,
        "isMobileWeb": false,
        "isSmartphone": true,
        "isTablet": true,
        "isCTV": true,
        "isDOOH": false,
        "aDomain": "carter.net",
        "dateStart": "2022-11-16",
        "dateEnd": "2025-03-26",
        "geoCountries": [],
        "geoCountriesIsInclude": true,
        "geoRegions": [],
        "geoRegionsIsInclude": true,
        "geoCities": [],
        "geoCitiesIsInclude": true,
        "contentCategories": [],
        "contentCategoriesIsInclude": true,
        "userAgeMin": 0,
        "userAgeMax": 0,
        "connectionTypes": [
            "wifi"
        ],
        "clickedInventoryCategories": [],
        "deviceCarrier": [],
        "deviceCarrierIsInclude": true,
        "OS": [],
        "OSIsInclude": true,
        "browser": [],
        "browserIsInclude": true,
        "deviceLanguage": [],
        "deviceLanguageIsInclude": true,
        "spentDailyLimit": 170,
        "spentTotalLimit": 6868,
        "impressionsDailyLimit": 287369,
        "impressionsTotalLimit": 400000,
        "clicksDailyLimit": 0,
        "clicksTotalLimit": 0,
        "budgetUse": "fast",
        "allSources": true,
        "classicPush": true,
        "inPagePush": true,
        "pricingModel": null,
        "cpm": 0,
        "adaptiveCpm": false,
        "useCpm": false,
        "landingPageUrl": "",
        "googleAnalyticsTrackingCode": null,
        "dynamicTargeting": [],
        "subscriptionAge": [],
        "frequencyType": "user",
        "frequency": 0,
        "frequencyCap": 1,
        "frequencyPeriod": 1,
        "extendedStatus": "Low Balance",
        "createdAt": "2024-07-23",
        "updatedAt": "2024-07-23",
        "deletedAt": null,
        "pretarget": null
    }
}

3.3. Create a Custom Banner/Native/Video/Audio Campaigns

A `POST` request will create new campaign.

3.3.1. Request Body

Path Type Description Required

type

string

Campaign type: banner, native, video, audio

+

name

string

Campaign name

+

aDomain

integer

Top level domain

+

isRewarded

integer

Rewarded video (for video creatives)

isDesktopWeb

boolean

Traffic Type: Desktop Websites

isMobileApp

boolean

Traffic Type: Mobile Applications

isMobileWeb

boolean

Traffic Type: Mobile Websites

isSmartphone

boolean

Traffic Type: Smartphones

isTablet

boolean

Traffic Type: Tablets

contentCategories

array

Targeting: IAB Categories list

contentCategoriesIsInclude

boolean

Targeting: IAB Categories list type (true: whitelist, false: blacklist)

userAgeMin

integer

Targeting: Age range from

userAgeMax

integer

Targeting: Age range to

connectionTypes

array

Targeting: Connection types list

deviceCarrier

array

Targeting: List of network operators.

deviceCarrierIsInclude

boolean

Targeting: List of network operators type (true: whitelist, false: blacklist)

OS

array

Targeting: The operating system of user's device

OSIsInclude

boolean

Targeting: The operating system of user's device list type (true: whitelist, false: blacklist)

browser

array

Targeting: The user's browsers list

browserIsInclude

boolean

Targeting: The user's browsers list type (true: whitelist, false: blacklist)

deviceLanguage

array

Targeting: The languages of user's browser

deviceLanguageIsInclude

boolean

Targeting: The languages of user's browser list type (true: whitelist, false: blacklist)

spentDailyLimit

integer

Daily spent limit

spentTotalLimit

integer

Total spent limit

impressionsDailyLimit

integer

Daily impressions limit

impressionsTotalLimit

integer

Total impressions limit

clicksDailyLimit

integer

Daily clicks limit

clicksTotalLimit

integer

Total clicks limit

budgetUse

integer

Distribution: pacer, fast pacer - Evenly distribution fast - ASAP distribution

dateStart

date

Date start

dateEnd

date

Date end

3.3.2. HTTP Request

URL

POST api/campaigns HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJJNEd3eHhuUUdKVE1JcTdmIiwic3ViIjoiNiIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.-xwdJ59aVOVhARsFkY1k3-gO7_c3ihNYKj4yh--c0do
DATA
{
    "type": "banner",
    "name": "New Campaign #2",
    "aDomain": "leffler.com",
    "isRewarded": true,
    "isDesktopWeb": true,
    "isMobileApp": true,
    "isMobileWeb": true,
    "isSmartphone": true,
    "isTablet": true,
    "contentCategories": [
        "IAB1",
        "IAB3"
    ],
    "contentCategoriesIsInclude": false,
    "userAgeMin": 18,
    "userAgeMax": 50,
    "connectionTypes": [
        "ethernet",
        "cellular_all",
        "cellular_3g",
        "cellular_4g",
        "wifi"
    ],
    "deviceCarrier": [
        "ISP Green-Stiedemann",
        "ISP Simonis Inc"
    ],
    "deviceCarrierIsInclude": false,
    "OS": [
        "Android 8.0",
        "Android 8.1",
        "Android 9.0",
        "Android 10.0",
        "Android 11.0",
        "Android 12.0",
        "Android 13.0",
        "iOS"
    ],
    "OSIsInclude": true,
    "browser": [
        "Chrome",
        "IE",
        "Edge"
    ],
    "browserIsInclude": true,
    "deviceLanguage": [
        "ab",
        "aa"
    ],
    "deviceLanguageIsInclude": true,
    "spentDailyLimit": 200,
    "spentTotalLimit": 1000,
    "impressionsDailyLimit": 100000,
    "impressionsTotalLimit": 1000000,
    "clicksDailyLimit": 500,
    "clicksTotalLimit": 1000,
    "budgetUse": "fast",
    "dateStart": "2024-01-08",
    "dateEnd": "2024-10-06"
}

3.3.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJJNEd3eHhuUUdKVE1JcTdmIiwic3ViIjoiNiIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.-xwdJ59aVOVhARsFkY1k3-gO7_c3ihNYKj4yh--c0do' \
    -d '{
    "type": "banner",
    "name": "New Campaign #2",
    "aDomain": "leffler.com",
    "isRewarded": true,
    "isDesktopWeb": true,
    "isMobileApp": true,
    "isMobileWeb": true,
    "isSmartphone": true,
    "isTablet": true,
    "contentCategories": [
        "IAB1",
        "IAB3"
    ],
    "contentCategoriesIsInclude": false,
    "userAgeMin": 18,
    "userAgeMax": 50,
    "connectionTypes": [
        "ethernet",
        "cellular_all",
        "cellular_3g",
        "cellular_4g",
        "wifi"
    ],
    "deviceCarrier": [
        "ISP Green-Stiedemann",
        "ISP Simonis Inc"
    ],
    "deviceCarrierIsInclude": false,
    "OS": [
        "Android 8.0",
        "Android 8.1",
        "Android 9.0",
        "Android 10.0",
        "Android 11.0",
        "Android 12.0",
        "Android 13.0",
        "iOS"
    ],
    "OSIsInclude": true,
    "browser": [
        "Chrome",
        "IE",
        "Edge"
    ],
    "browserIsInclude": true,
    "deviceLanguage": [
        "ab",
        "aa"
    ],
    "deviceLanguageIsInclude": true,
    "spentDailyLimit": 200,
    "spentTotalLimit": 1000,
    "impressionsDailyLimit": 100000,
    "impressionsTotalLimit": 1000000,
    "clicksDailyLimit": 500,
    "clicksTotalLimit": 1000,
    "budgetUse": "fast",
    "dateStart": "2024-01-08",
    "dateEnd": "2024-10-06"
}'

3.3.4. Response Body

Path Type Description

data.id

integer

Campaign Id

data.userId

integer

User Id

data.isActive

boolean

Campaign On/Off

data.isRunning

boolean

Campaign running status

data.type

string

Campaign type: banner, native, video, audio

data.name

string

Campaign name

data.isRewarded

integer

Rewarded video (for video creatives)

data.isDesktopWeb

boolean

Traffic Type: Desktop Websites

data.isMobileApp

boolean

Traffic Type: Mobile Applications

data.isMobileWeb

boolean

Traffic Type: Mobile Websites

data.isSmartphone

boolean

Traffic Type: Smartphones

data.isTablet

boolean

Traffic Type: Tablets

data.isCTV

boolean

Traffic Type: CTV

data.isDOOH

boolean

Traffic Type: DOOH

data.aDomain

integer

Top level domain

data.dateStart

date

Date start

data.dateEnd

date

Date end

data.geoCountries

array

GEO Targeting: countries list

data.geoCountriesIsInclude

boolean

GEO Targeting: countries list type (true: whitelist, false: blacklist)

data.geoRegions

array

GEO Targeting: regions list

data.geoRegionsIsInclude

boolean

GEO Targeting: regions list type (true: whitelist, false: blacklist)

data.geoCities

array

GEO Targeting: cities list

data.geoCitiesIsInclude

boolean

GEO Targeting: cities list type (true: whitelist, false: blacklist)

data.contentCategories

array

Targeting: IAB Categories list

data.contentCategoriesIsInclude

boolean

Targeting: IAB Categories list type (true: whitelist, false: blacklist)

data.userAgeMin

integer

Targeting: Age range from

data.userAgeMax

integer

Targeting: Age range to

data.connectionTypes

array

Targeting: Connection types list

data.clickedInventoryCategories

array

Сlicked Inventory Categories

data.deviceCarrier

array

Targeting: List of network operators.

data.deviceCarrierIsInclude

boolean

Targeting: List of network operators type (true: whitelist, false: blacklist)

data.OS

array

Targeting: The operating system of user's device

data.OSIsInclude

boolean

Targeting: The operating system of user's device list type (true: whitelist, false: blacklist)

data.browser

array

Targeting: The user's browsers list

data.browserIsInclude

boolean

Targeting: The user's browsers list type (true: whitelist, false: blacklist)

data.deviceLanguage

array

Targeting: The languages of user's browser

data.deviceLanguageIsInclude

boolean

Targeting: The languages of user's browser list type (true: whitelist, false: blacklist)

data.spentDailyLimit

integer

Daily spent limit

data.spentTotalLimit

integer

Total spent limit

data.impressionsDailyLimit

integer

Daily impressions limit

data.impressionsTotalLimit

integer

Total impressions limit

data.clicksDailyLimit

integer

Daily clicks limit

data.clicksTotalLimit

integer

Total clicks limit

data.budgetUse

integer

Distribution: pacer, fast pacer - Evenly distribution fast - ASAP distribution

data.allSources

boolean

Inventory: Use all SSP endpoints

data.classicPush

boolean

Push - PUSH Campaigns

data.inPagePush

string

In-Page Push - PUSH Campaigns

data.pricingModel

string

Pricing model: CPM - PUSH Campaigns

data.cpm

float

cpm

data.adaptiveCpm

boolean

adaptiveCpm

data.useCpm

boolean

use cpm

data.landingPageUrl

string

Landing page URL - PUSH Campaigns

data.googleAnalyticsTrackingCode

string

Google Analytics tracking code - PUSH Campaigns

data.dynamicTargeting

array

SmartCPC: Dynamic targeting - only for CPC Pricing model

data.subscriptionAge

array

Subscription Age - only for CPC Pricing model

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.extendedStatus

string

Campaign extended status

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.deletedAt

datetime

Date of deletion

data.pretarget

int

pretarget

3.3.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 4,
        "userId": 6,
        "isActive": null,
        "isRunning": false,
        "type": "banner",
        "name": "New Campaign #2",
        "isRewarded": true,
        "isDesktopWeb": true,
        "isMobileApp": true,
        "isMobileWeb": true,
        "isSmartphone": true,
        "isTablet": true,
        "isCTV": true,
        "isDOOH": true,
        "aDomain": "leffler.com",
        "dateStart": "2024-01-08",
        "dateEnd": "2024-10-06",
        "geoCountries": [],
        "geoCountriesIsInclude": false,
        "geoRegions": [],
        "geoRegionsIsInclude": null,
        "geoCities": [],
        "geoCitiesIsInclude": false,
        "contentCategories": [
            "IAB1",
            "IAB3"
        ],
        "contentCategoriesIsInclude": false,
        "userAgeMin": 18,
        "userAgeMax": 50,
        "connectionTypes": [
            "ethernet",
            "cellular_all",
            "cellular_3g",
            "cellular_4g",
            "wifi"
        ],
        "clickedInventoryCategories": [],
        "deviceCarrier": [
            "ISP Green-Stiedemann",
            "ISP Simonis Inc"
        ],
        "deviceCarrierIsInclude": false,
        "OS": [
            "Android 8.0",
            "Android 8.1",
            "Android 9.0",
            "Android 10.0",
            "Android 11.0",
            "Android 12.0",
            "Android 13.0",
            "iOS"
        ],
        "OSIsInclude": true,
        "browser": [
            "Chrome",
            "IE",
            "Edge"
        ],
        "browserIsInclude": true,
        "deviceLanguage": [
            "ab",
            "aa"
        ],
        "deviceLanguageIsInclude": true,
        "spentDailyLimit": 200,
        "spentTotalLimit": 1000,
        "impressionsDailyLimit": 100000,
        "impressionsTotalLimit": 1000000,
        "clicksDailyLimit": 500,
        "clicksTotalLimit": 1000,
        "budgetUse": "fast",
        "allSources": false,
        "classicPush": false,
        "inPagePush": false,
        "pricingModel": null,
        "cpm": null,
        "adaptiveCpm": null,
        "useCpm": null,
        "landingPageUrl": null,
        "googleAnalyticsTrackingCode": null,
        "dynamicTargeting": [],
        "subscriptionAge": [],
        "frequencyType": null,
        "frequency": null,
        "frequencyCap": 0,
        "frequencyPeriod": 0,
        "extendedStatus": "Campaign is not active",
        "createdAt": "2024-07-23",
        "updatedAt": "2024-07-23",
        "deletedAt": null,
        "pretarget": null
    }
}

3.4. Update a Custom Campaign

A `PATCH` request will update campaign.

3.4.1. Request Body

Path Type Description Required

name

string

Campaign name

3.4.2. HTTP Request

URL

PATCH api/campaigns/5 HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJZa3JTN2VueFc1cmYxc2xWIiwic3ViIjoiNyIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.En93gb7Lr4ARc2OkuKdRdNyGAC1qkV4pEM7786HcsYY
DATA
{
    "name": "Updated Campaign #3"
}

3.4.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/5' -i -X PATCH \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiJZa3JTN2VueFc1cmYxc2xWIiwic3ViIjoiNyIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.En93gb7Lr4ARc2OkuKdRdNyGAC1qkV4pEM7786HcsYY' \
    -d '{
    "name": "Updated Campaign #3"
}'

3.4.4. Response Body

Path Type Description

data.id

integer

Campaign Id

data.userId

integer

User Id

data.isActive

boolean

Campaign On/Off

data.isRunning

boolean

Campaign running status

data.type

string

Campaign type: banner, native, video, audio

data.name

string

Campaign name

data.isRewarded

integer

Rewarded video (for video creatives)

data.isDesktopWeb

boolean

Traffic Type: Desktop Websites

data.isMobileApp

boolean

Traffic Type: Mobile Applications

data.isMobileWeb

boolean

Traffic Type: Mobile Websites

data.isSmartphone

boolean

Traffic Type: Smartphones

data.isTablet

boolean

Traffic Type: Tablets

data.isCTV

boolean

Traffic Type: CTV

data.isDOOH

boolean

Traffic Type: DOOH

data.aDomain

integer

Top level domain

data.dateStart

date

Date start

data.dateEnd

date

Date end

data.geoCountries

array

GEO Targeting: countries list

data.geoCountriesIsInclude

boolean

GEO Targeting: countries list type (true: whitelist, false: blacklist)

data.geoRegions

array

GEO Targeting: regions list

data.geoRegionsIsInclude

boolean

GEO Targeting: regions list type (true: whitelist, false: blacklist)

data.geoCities

array

GEO Targeting: cities list

data.geoCitiesIsInclude

boolean

GEO Targeting: cities list type (true: whitelist, false: blacklist)

data.contentCategories

array

Targeting: IAB Categories list

data.contentCategoriesIsInclude

boolean

Targeting: IAB Categories list type (true: whitelist, false: blacklist)

data.userAgeMin

integer

Targeting: Age range from

data.userAgeMax

integer

Targeting: Age range to

data.connectionTypes

array

Targeting: Connection types list

data.clickedInventoryCategories

array

Сlicked Inventory Categories

data.deviceCarrier

array

Targeting: List of network operators.

data.deviceCarrierIsInclude

boolean

Targeting: List of network operators type (true: whitelist, false: blacklist)

data.OS

array

Targeting: The operating system of user's device

data.OSIsInclude

boolean

Targeting: The operating system of user's device list type (true: whitelist, false: blacklist)

data.browser

array

Targeting: The user's browsers list

data.browserIsInclude

boolean

Targeting: The user's browsers list type (true: whitelist, false: blacklist)

data.deviceLanguage

array

Targeting: The languages of user's browser

data.deviceLanguageIsInclude

boolean

Targeting: The languages of user's browser list type (true: whitelist, false: blacklist)

data.spentDailyLimit

integer

Daily spent limit

data.spentTotalLimit

integer

Total spent limit

data.impressionsDailyLimit

integer

Daily impressions limit

data.impressionsTotalLimit

integer

Total impressions limit

data.clicksDailyLimit

integer

Daily clicks limit

data.clicksTotalLimit

integer

Total clicks limit

data.budgetUse

integer

Distribution: pacer, fast pacer - Evenly distribution fast - ASAP distribution

data.allSources

boolean

Inventory: Use all SSP endpoints

data.classicPush

boolean

Push - PUSH Campaigns

data.inPagePush

string

In-Page Push - PUSH Campaigns

data.pricingModel

string

Pricing model: CPM - PUSH Campaigns

data.cpm

float

cpm

data.adaptiveCpm

boolean

adaptiveCpm

data.useCpm

boolean

use cpm

data.landingPageUrl

string

Landing page URL - PUSH Campaigns

data.googleAnalyticsTrackingCode

string

Google Analytics tracking code - PUSH Campaigns

data.dynamicTargeting

array

SmartCPC: Dynamic targeting - only for CPC Pricing model

data.subscriptionAge

array

Subscription Age - only for CPC Pricing model

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.extendedStatus

string

Campaign extended status

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.deletedAt

datetime

Date of deletion

data.pretarget

int

pretarget

3.4.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 5,
        "userId": 7,
        "isActive": false,
        "isRunning": false,
        "type": "banner",
        "name": "Updated Campaign #3",
        "isRewarded": false,
        "isDesktopWeb": true,
        "isMobileApp": true,
        "isMobileWeb": false,
        "isSmartphone": false,
        "isTablet": false,
        "isCTV": false,
        "isDOOH": true,
        "aDomain": "bechtelar.com",
        "dateStart": "2023-08-25",
        "dateEnd": "2024-08-25",
        "geoCountries": [],
        "geoCountriesIsInclude": true,
        "geoRegions": [],
        "geoRegionsIsInclude": true,
        "geoCities": [],
        "geoCitiesIsInclude": true,
        "contentCategories": [],
        "contentCategoriesIsInclude": true,
        "userAgeMin": 0,
        "userAgeMax": 0,
        "connectionTypes": [
            "wifi"
        ],
        "clickedInventoryCategories": [],
        "deviceCarrier": [],
        "deviceCarrierIsInclude": true,
        "OS": [],
        "OSIsInclude": true,
        "browser": [],
        "browserIsInclude": true,
        "deviceLanguage": [],
        "deviceLanguageIsInclude": true,
        "spentDailyLimit": 460,
        "spentTotalLimit": 8825,
        "impressionsDailyLimit": 298081,
        "impressionsTotalLimit": 400000,
        "clicksDailyLimit": 0,
        "clicksTotalLimit": 0,
        "budgetUse": "fast",
        "allSources": true,
        "classicPush": true,
        "inPagePush": true,
        "pricingModel": null,
        "cpm": 0,
        "adaptiveCpm": false,
        "useCpm": false,
        "landingPageUrl": "",
        "googleAnalyticsTrackingCode": null,
        "dynamicTargeting": [],
        "subscriptionAge": [],
        "frequencyType": "user",
        "frequency": 0,
        "frequencyCap": 1,
        "frequencyPeriod": 1,
        "extendedStatus": "Campaign is not active",
        "createdAt": "2024-07-23",
        "updatedAt": "2024-07-23",
        "deletedAt": null,
        "pretarget": null
    }
}

3.5. Delete a Custom Campaign

A `DELETE` request will delete campaign.

3.5.1. HTTP Request

URL

DELETE api/campaigns/6 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiIzcHJxVnRhTmY1UHVKZ3lGIiwic3ViIjoiOCIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.kZ3DYN1oABUHzhAZNpb3jFl7s3mjaUn1dPGx8dmOHkU
Content-type: application/x-www-form-urlencoded
DATA
{}

3.5.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/6' -i -X DELETE \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDEsImV4cCI6MTcyMTc0NTMwMSwibmJmIjoxNzIxNzQxNzAxLCJqdGkiOiIzcHJxVnRhTmY1UHVKZ3lGIiwic3ViIjoiOCIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.kZ3DYN1oABUHzhAZNpb3jFl7s3mjaUn1dPGx8dmOHkU' \
                -H 'Content-type: application/x-www-form-urlencoded' \
    -d '{}'

3.5.3. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{}

4. Upload media

4.1. Store Image

A `POST` request will upload image

4.1.1. Request Body

Path Type Description Required

media_assets

file

Array of files to upload

+

4.1.2. HTTP Request

URL

POST api/media-asset/upload/image HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJXemR2amJBUFhvb1Z4cWduIiwic3ViIjoiMzciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0._lHHr9mSeB2uOrd2NZpor0BQEmPNH_B0aHT1WwvjzuY
DATA
{
    "media_assets": [
        <Binary file>
    ]
}

4.1.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/media-asset/upload/image' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJXemR2amJBUFhvb1Z4cWduIiwic3ViIjoiMzciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0._lHHr9mSeB2uOrd2NZpor0BQEmPNH_B0aHT1WwvjzuY' \
    -d '{
    "media_assets": [
        <Binary file>
    ]
}'

4.1.4. Response Body

Path Type Description

message

string

Result message

data.*.id

integer

Media id

data.*.userId

integer

User Id

data.*.mediaType

string

Media type (html, image, video)

data.*.originName

string

Original file name

data.*.name

string

Uploaded file name

data.*.extension

string

Uploaded file extension

data.*.url

string

Uploaded file url

data.*.width

integer

Uploaded file image width

data.*.height

integer

Uploaded file image height

data.*.weight

integer

Uploaded file size kB

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

4.1.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "MediaAsset created.",
    "data": [
        {
            "id": 20,
            "userId": 37,
            "mediaType": "image",
            "originName": "test-image.png",
            "name": "test-image.png",
            "extension": "png",
            "url": "\/storage\/test-image.png",
            "width": 10,
            "height": 10,
            "weight": 91,
            "createdAt": "2024-07-23 13:35:04",
            "updatedAt": "2024-07-23 13:35:04"
        }
    ]
}

4.2. Store video

A `POST` request will upload video

4.2.1. Request Body

Path Type Description Required

media_assets

file

Array of files to upload

+

4.2.2. HTTP Request

URL

POST api/media-asset/upload/video HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJEMlVrTkRYZHhUZ1NDMVo2Iiwic3ViIjoiMzgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.7c_dspj7lLenBvAvMo-JfTyvpYBDmo6_83cRO2Ncaxo
DATA
{
    "media_assets": [
        <Binary file>
    ]
}

4.2.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/media-asset/upload/video' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJEMlVrTkRYZHhUZ1NDMVo2Iiwic3ViIjoiMzgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.7c_dspj7lLenBvAvMo-JfTyvpYBDmo6_83cRO2Ncaxo' \
    -d '{
    "media_assets": [
        <Binary file>
    ]
}'

4.2.4. Response Body

Path Type Description

message

string

Result message

data.*.id

integer

Media id

data.*.userId

integer

User Id

data.*.mediaType

string

Media type (html, image, video)

data.*.originName

string

Original file name

data.*.name

string

Uploaded file name

data.*.extension

string

Uploaded file extension

data.*.url

string

Uploaded file url

data.*.width

integer

Uploaded file image width

data.*.height

integer

Uploaded file image height

data.*.weight

integer

Uploaded file size kB

data.*.mimeType

string

Video mime type

data.*.bitrate

integer

Video bitrate

data.*.duration

integer

Video duration (in seconds)

data.*.durationTime

string

Video duration (in text format)

data.*.playtime

integer

Video playtime

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

4.2.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "MediaAsset created.",
    "data": [
        {
            "id": 21,
            "userId": 38,
            "mediaType": "video",
            "originName": "test-video.mp4",
            "name": "test-video.mp4",
            "extension": "mp4",
            "url": "\/storage\/test-video.mp4",
            "width": 320,
            "height": 240,
            "weight": 5312,
            "mimeType": "video\/quicktime",
            "bitrate": 201493,
            "duration": 0,
            "durationTime": "00:00:00",
            "playtime": "00:00:00",
            "createdAt": "2024-07-23 13:35:04",
            "updatedAt": "2024-07-23 13:35:04"
        }
    ]
}

4.3. Store HTML

A `POST` request will upload HTML

4.3.1. Request Body

Path Type Description Required

media_assets

file

Array of files to upload

+

4.3.2. HTTP Request

URL

POST api/media-asset/upload/html HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJ5cllsTDFlTEdLeUpKNW84Iiwic3ViIjoiMzkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.4ctaBP8A5BjBoJfl9HwMJl0ml1abNlXOAWGd85HmQAg
DATA
{
    "media_assets": [
        <Binary file>
    ]
}

4.3.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/media-asset/upload/html' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJ5cllsTDFlTEdLeUpKNW84Iiwic3ViIjoiMzkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.4ctaBP8A5BjBoJfl9HwMJl0ml1abNlXOAWGd85HmQAg' \
    -d '{
    "media_assets": [
        <Binary file>
    ]
}'

4.3.4. Response Body

Path Type Description

message

string

Result message

data.*.id

integer

Media id

data.*.userId

integer

User Id

data.*.mediaType

string

Media type (html, image, video)

data.*.originName

string

Original file name

data.*.name

string

Uploaded file name

data.*.extension

string

Uploaded file extension

data.*.url

string

Uploaded file url

data.*.width

integer

Uploaded file image width

data.*.height

integer

Uploaded file image height

data.*.weight

integer

Uploaded file size kB

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

4.3.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "MediaAsset created.",
    "data": [
        {
            "id": 22,
            "userId": 39,
            "mediaType": "html",
            "originName": "test-html.zip",
            "name": "TEST\/index.html",
            "extension": "zip",
            "url": "\/storage\/TEST\/index.html",
            "width": 0,
            "height": 0,
            "weight": 0,
            "createdAt": "2024-07-23 13:35:05",
            "updatedAt": "2024-07-23 13:35:05"
        }
    ]
}

4.4. Store filter list

A `POST` request will upload video

4.4.1. HTTP Request

URL

POST api/parsefile HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiI4STNNbzUxdXNxdk5UVnR4Iiwic3ViIjoiNDAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.rTeNivKRN0RnZnyKdwg_JBNr9IS1bPBEs9j89vply4I
DATA
{
    "file": <Binary file>
}

4.4.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/parsefile' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiI4STNNbzUxdXNxdk5UVnR4Iiwic3ViIjoiNDAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.rTeNivKRN0RnZnyKdwg_JBNr9IS1bPBEs9j89vply4I' \
    -d '{
    "file": <Binary file>
}'

4.4.3. Response Body

Path Type Description

message

string

Result message

items

array

List array items

fileName

string

File name

countItems

integer

Count items

4.4.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "success",
    "items": [
        "test.com"
    ],
    "fileName": "1721741705_test-filter.csv",
    "countItems": 0
}

5. Creatives

5.1. Creatives list

A `GET` request will return a list of an creatives.

5.1.1. HTTP Request

URL

GET api/creatives HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJpRUlLRHV3Q1UxU0xveWJ1Iiwic3ViIjoiMjAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.Zn3yUBdhiUsaKRcvF86OGE6YT5mNXKoSuwaPCGsyNBg
DATA
{}

5.1.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJpRUlLRHV3Q1UxU0xveWJ1Iiwic3ViIjoiMjAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.Zn3yUBdhiUsaKRcvF86OGE6YT5mNXKoSuwaPCGsyNBg' \
    -d '{}'

5.1.3. Response Body

Path Type Description

data.*.id

integer

Creative Id

data.*.userId

integer

User Id

data.*.isActive

boolean

Creative status

data.*.approved

string

Creative approval status (approved, pending, disapproved)

data.*.creativeType

string

Creative type: banner, native, video, audio

data.*.name

string

Creative name

data.*.frequencyType

string

Identify the user to limit the number of the ad shows for the specific user (user, ip). Required if frequency is on.

data.*.frequency

string

Frequency on/off

data.*.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period". Required if frequency is on.

data.*.frequencyPeriod

integer

Frequency period in days (min-1,max-3). Required if frequency is on.

data.*.bidPrice

float

CPM

data.*.autoresize

boolean

autoresize

data.*.adaptiveCpm

bool

adaptiveCpm

data.*.size

string

Image width and height

data.*.weight

string

File size

data.*.folderId

string

Folder Id

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

data.*.pendingAt

datetime

Date of pending start

data.*.deletedAt

datetime

Date of deletion

data.*.media.id

integer

Media Id

data.*.media.userId

string

User Id

data.*.media.mediaType

string

Media type (html, image, video)

data.*.media.originName

string

Uploaded file original name

data.*.media.name

string

Uploaded file name

data.*.media.extension

string

Uploaded file extention

data.*.media.url

string

Uploaded file URL

data.*.media.width

integer

Uploaded file image width

data.*.media.height

integer

Uploaded file image height

data.*.media.weight

integer

Uploaded file size

data.*.relation.banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

data.*.relation.banner.admBody

string

Third-party tag

data.*.relation.banner.bannerType

String

Banner type (banner,inBannerVideo)

data.*.relation.banner.clickUrl

string

Click URL

data.*.relation.banner.width

integer

Banner width

data.*.relation.banner.height

integer

Banner height

data.*.relation.banner.childrenCreative

string

childrenCreative

data.*.relation.banner.statusChildrenCreative

string

statusChildrenCreative

data.*.relation.banner.main

boolean

Main creative

data.*.relation.native.smallImageId

integer

Logo media id

data.*.relation.native.largeImageId

integer

Image media id

data.*.relation.native.smallImage.id

integer

Logo media id

data.*.relation.native.smallImage.folderId

string

Folder id

data.*.relation.native.smallImage.userId

integer

User id

data.*.relation.native.smallImage.width

string

width

data.*.relation.native.smallImage.height

string

height

data.*.relation.native.smallImage.name

string

name

data.*.relation.native.smallImage.url

string

url

data.*.relation.native.smallImage.href

string

href

data.*.relation.native.smallImage.originName

string

originName

data.*.relation.native.smallImage.path

string

path

data.*.relation.native.smallImage.extension

string

extension

data.*.relation.native.smallImage.mediaType

string

mediaType

data.*.relation.native.smallImage.createdAt

string

createdAt

data.*.relation.native.smallImage.updatedAt

string

updatedAt

data.*.relation.native.smallImage.deletedAt

string

updatedAt

data.*.relation.native.smallImage.weight

string

weight

data.*.relation.native.largeImage.id

integer

Image media id

data.*.relation.native.largeImage.folderId

string

Folder id

data.*.relation.native.largeImage.userId

integer

User id

data.*.relation.native.largeImage.width

string

width

data.*.relation.native.largeImage.height

string

height

data.*.relation.native.largeImage.name

string

name

data.*.relation.native.largeImage.url

string

url

data.*.relation.native.largeImage.href

string

href

data.*.relation.native.largeImage.originName

string

originName

data.*.relation.native.largeImage.path

string

path

data.*.relation.native.largeImage.extension

string

extension

data.*.relation.native.largeImage.mediaType

string

mediaType

data.*.relation.native.largeImage.createdAt

string

createdAt

data.*.relation.native.largeImage.updatedAt

string

updatedAt

data.*.relation.native.largeImage.deletedAt

string

updatedAt

data.*.relation.native.largeImage.weight

string

weight

data.*.relation.native.assetDataDesc

string

Ad text

data.*.relation.native.assetTitle

string

Ad title

data.*.relation.native.assetDataSponsored

string

Brand name

data.*.relation.native.assetCtaText

string

CTA button text

data.*.relation.native.clickUrl

string

Click URL

data.*.relation.native.displayUrl

string

Display URL

data.*.relation.native.impTracker

string

Impression Tracker

data.*.relation.video.sizes

string

Player size

data.*.relation.video.admBody

string

Third-party tag

data.*.relation.video.mimeType

array

MIME types ("[video/mpeg, video/mp4, video/quicktime, video/x-flv, application/x-shockwave-flash, application/javascript, video/x-ms-wmv, video/webm]")

data.*.relation.video.width

integer

Video width

data.*.relation.video.height

integer

Video height

data.*.relation.video.duration

integer

Video duration

data.*.relation.video.clickUrl

string

Click URL

data.*.relation.video.partyTagFormat

integer

3 party tag format (0-NO VPAID, 1-VPAID 1, 2-VPAID 2, 3-ALL VPAID)

meta.pagination.total

integer

Pagination: total items count

meta.pagination.count

integer

Pagination: page items count

meta.pagination.per_page

integer

Pagination: items per page

meta.pagination.current_page

integer

Pagination: current page number

meta.pagination.total_pages

integer

Pagination: total pages count

meta.pagination.links

object

Pagination links

5.1.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": [
        {
            "id": 8,
            "userId": 20,
            "isActive": 0,
            "approved": "pending",
            "creativeType": "banner",
            "name": "Banner creative #1",
            "frequencyType": "user",
            "frequency": 0,
            "frequencyCap": 0,
            "frequencyPeriod": 1,
            "bidPrice": "17.64",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "529 x 286",
            "weight": "0.35 MB",
            "folderId": null,
            "createdAt": "2024-07-23 00:00:00",
            "updatedAt": "2024-07-23 13:35:02",
            "pendingAt": null,
            "deletedAt": null,
            "media": {
                "id": 8,
                "userId": 20,
                "mediaType": "image",
                "originName": "image.jpg",
                "name": "20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                "extension": "jpg",
                "url": "https:\/\/www.will.com\/omnis-dolor-rem-totam-eum20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                "width": 102,
                "height": 113,
                "weight": 371499
            },
            "relation": {
                "banner": {
                    "apiFramework": 0,
                    "admBody": "<a target=\"_blank\" href=\"https:\/\/www.collins.biz\/quia-deleniti-ut-nesciunt-similique\" ><img src=\"http:\/\/mayert.net\/\/10.jpg\"\/><\/a>",
                    "bannerType": "banner",
                    "clickUrl": "https:\/\/www.bayer.com\/quaerat-dolores-voluptas-eum-eius-suscipit",
                    "width": 529,
                    "height": 286,
                    "childrenCreative": null,
                    "statusChildrenCreative": [],
                    "main": 1
                }
            }
        },
        {
            "id": 9,
            "userId": 20,
            "isActive": 1,
            "approved": "pending",
            "creativeType": "native",
            "name": "Native creative #1",
            "frequencyType": "ip",
            "frequency": 0,
            "frequencyCap": 2,
            "frequencyPeriod": 1,
            "bidPrice": "0.05",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "471 x 115",
            "weight": "0.00 MB",
            "folderId": null,
            "createdAt": "2024-07-23 00:00:00",
            "updatedAt": "2024-07-23 13:35:02",
            "pendingAt": null,
            "deletedAt": null,
            "media": {
                "id": 9,
                "userId": 20,
                "mediaType": "image",
                "originName": "image.jpg",
                "name": "20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                "extension": "jpg",
                "url": "http:\/\/www.beatty.com\/aut-corporis-et-facilis-cumque-deleniti-reiciendis-molestias20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                "width": 121,
                "height": 154,
                "weight": 182198
            },
            "relation": {
                "native": {
                    "smallImageId": 9,
                    "largeImageId": 10,
                    "smallImage": {
                        "id": 9,
                        "folderId": null,
                        "userId": 20,
                        "width": 121,
                        "height": 154,
                        "name": "20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                        "url": "http:\/\/www.beatty.com\/aut-corporis-et-facilis-cumque-deleniti-reiciendis-molestias20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                        "href": null,
                        "originName": "image.jpg",
                        "path": null,
                        "extension": "jpg",
                        "mediaType": "image",
                        "createdAt": "2024-07-23T13:35:02.000000Z",
                        "updatedAt": "2024-07-23T13:35:02.000000Z",
                        "deletedAt": null,
                        "weight": 182198
                    },
                    "largeImage": {
                        "id": 10,
                        "folderId": null,
                        "userId": 20,
                        "width": 471,
                        "height": 115,
                        "name": "20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                        "url": "http:\/\/www.balistreri.com\/20_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                        "href": null,
                        "originName": "image.jpg",
                        "path": null,
                        "extension": "jpg",
                        "mediaType": "image",
                        "createdAt": "2024-07-23T13:35:02.000000Z",
                        "updatedAt": "2024-07-23T13:35:02.000000Z",
                        "deletedAt": null,
                        "weight": 200287
                    },
                    "assetDataDesc": "Est et voluptas quasi.",
                    "assetTitle": "Et ad qui tempora error.",
                    "assetDataSponsored": "Accusamus ea nihil delectus at quod numquam et.",
                    "assetCtaText": "Aut id sit voluptas est.",
                    "clickUrl": "http:\/\/champlin.com\/perferendis-similique-esse-adipisci-quam-nihil-enim-et-molestiae",
                    "displayUrl": "http:\/\/www.grant.org\/odio-autem-magni-expedita-in-sed-voluptatem",
                    "impTracker": null
                }
            }
        },
        {
            "id": 10,
            "userId": 20,
            "isActive": 0,
            "approved": "pending",
            "creativeType": "video",
            "name": "Video creative #1",
            "frequencyType": "ip",
            "frequency": 0,
            "frequencyCap": 2,
            "frequencyPeriod": 1,
            "bidPrice": "0.41",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "669 x 453",
            "weight": "0.47 MB",
            "folderId": null,
            "createdAt": "2024-07-23 00:00:00",
            "updatedAt": "2024-07-23 13:35:02",
            "pendingAt": null,
            "deletedAt": null,
            "media": {
                "id": 11,
                "userId": 20,
                "mediaType": "video",
                "originName": "video.mp4",
                "name": "20_0a5895eb48e5412d31279bebeda6ae4e.mp4",
                "extension": "mp4",
                "url": "http:\/\/huel.info\/20_0a5895eb48e5412d31279bebeda6ae4e.mp4",
                "width": 218,
                "height": 363,
                "weight": 498030
            },
            "relation": {
                "video": {
                    "sizes": "small",
                    "admBody": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<VAST version=\"2.0\">\n<Ad id=\"[HASH]\">\n    <InLine>\n        <AdSystem>DSP<\/AdSystem>\n        <AdTitle>Smartyads<\/AdTitle>\n        <Description>RTB<\/Description>\n        <Creatives>\n            <Creative AdID=\"572\">\n                <Linear>\n                    <Duration>00:00:09<\/Duration>\n                    <VideoClicks>\n                        <ClickThrough><![CDATA[https:\/\/picsum.photos\/]]><\/ClickThrough>\n                    <\/VideoClicks>\n                    <MediaFiles>\n                        <MediaFile delivery=\"streaming\" type=\"video\/quicktime\" width=\"640\" height=\"360\"><![CDATA[http:\/\/72.mp4]]><\/MediaFile>\n                    <\/MediaFiles>\n                <\/Linear>\n            <\/Creative>\n        <\/Creatives>\n    <\/InLine>\n<\/Ad>\n<\/VAST>",
                    "mimeType": [
                        "application\/x-shockwave-flash"
                    ],
                    "width": 669,
                    "height": 453,
                    "duration": 9,
                    "clickUrl": "http:\/\/sauer.net\/",
                    "partyTagFormat": 0
                }
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 3,
            "count": 3,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

5.2. Get by ID (Banner creative)

A `GET` request with a path parameter of the id will return the creative with that id.

5.2.1. HTTP Request

URL

GET api/creatives/11 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiI1NEVHSXF3WEh4MzJacFJEIiwic3ViIjoiMjEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.ZJPAyNUoaYOn0lhIdYcBIVmyio9iqHG3dwwB2hp_55I
DATA
{}

5.2.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives/11' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiI1NEVHSXF3WEh4MzJacFJEIiwic3ViIjoiMjEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.ZJPAyNUoaYOn0lhIdYcBIVmyio9iqHG3dwwB2hp_55I' \
    -d '{}'

5.2.3. Response Body

Path Type Description

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.media.id

integer

Media Id

data.media.userId

string

User Id

data.media.mediaType

string

Media type (html, image, video)

data.media.originName

string

Uploaded file original name

data.media.name

string

Uploaded file name

data.media.extension

string

Uploaded file extention

data.media.url

string

Uploaded file URL

data.media.width

integer

Uploaded file image width

data.media.height

integer

Uploaded file image height

data.media.weight

integer

Uploaded file size

data.media.modifiedUrl

any

data.relation.banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

data.relation.banner.admBody

string

Third-party tag

data.relation.banner.bannerType

String

Banner type (banner,inBannerVideo)

data.relation.banner.clickUrl

string

Click URL

data.relation.banner.width

integer

Banner width

data.relation.banner.height

integer

Banner height

5.2.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 11,
        "userId": 21,
        "isActive": 1,
        "approved": "pending",
        "creativeType": "banner",
        "name": "Banner creative #2",
        "frequencyType": "ip",
        "frequency": 0,
        "frequencyCap": 5,
        "frequencyPeriod": 1,
        "bidPrice": "14.61",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": "549 x 115",
        "weight": "0.36 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:02",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": 0,
                "admBody": "<a target=\"_blank\" href=\"http:\/\/swift.com\/\" ><img src=\"http:\/\/www.wilderman.com\/nihil-vitae-modi-soluta-sed\/10.jpg\"\/><\/a>",
                "bannerType": "banner",
                "clickUrl": "https:\/\/wolf.com\/quod-id-sed-delectus-et-veniam-sed.html",
                "width": 549,
                "height": 115
            }
        }
    }
}

5.3. Get by ID (Native creative)

A `GET` request with a path parameter of the id will return the creative with that id.

5.3.1. HTTP Request

URL

GET api/creatives/12 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJzTU9wQXhNZFhQVW54cGV5Iiwic3ViIjoiMjIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.lTbzRStBLPLv1aQtYPrg2XyWZr8JgNWyDuRZRVez02k
DATA
{}

5.3.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives/12' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJzTU9wQXhNZFhQVW54cGV5Iiwic3ViIjoiMjIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.lTbzRStBLPLv1aQtYPrg2XyWZr8JgNWyDuRZRVez02k' \
    -d '{}'

5.3.3. Response Body

Path Type Description

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.media.id

integer

Media Id

data.media.userId

string

User Id

data.media.mediaType

string

Media type (html, image, video)

data.media.originName

string

Uploaded file original name

data.media.name

string

Uploaded file name

data.media.extension

string

Uploaded file extention

data.media.url

string

Uploaded file URL

data.media.width

integer

Uploaded file image width

data.media.height

integer

Uploaded file image height

data.media.weight

integer

Uploaded file size

data.media.modifiedUrl

any

data.relation.native.smallImageId

integer

Logo media id

data.relation.native.largeImageId

integer

Image media id

data.relation.native.smallImage.id

integer

Logo media id

data.relation.native.smallImage.folderId

string

Folder id

data.relation.native.smallImage.userId

integer

User id

data.relation.native.smallImage.width

string

width

data.relation.native.smallImage.height

string

height

data.relation.native.smallImage.name

string

name

data.relation.native.smallImage.url

string

url

data.relation.native.smallImage.href

string

href

data.relation.native.smallImage.originName

string

originName

data.relation.native.smallImage.path

string

path

data.relation.native.smallImage.extension

string

extension

data.relation.native.smallImage.mediaType

string

mediaType

data.relation.native.smallImage.createdAt

string

createdAt

data.relation.native.smallImage.updatedAt

string

updatedAt

data.relation.native.smallImage.deletedAt

string

updatedAt

data.relation.native.smallImage.weight

string

weight

data.relation.native.largeImage.id

integer

Image media id

data.relation.native.largeImage.folderId

string

Folder id

data.relation.native.largeImage.userId

integer

User id

data.relation.native.largeImage.width

string

width

data.relation.native.largeImage.height

string

height

data.relation.native.largeImage.name

string

name

data.relation.native.largeImage.url

string

url

data.relation.native.largeImage.href

string

href

data.relation.native.largeImage.originName

string

originName

data.relation.native.largeImage.path

string

path

data.relation.native.largeImage.extension

string

extension

data.relation.native.largeImage.mediaType

string

mediaType

data.relation.native.largeImage.createdAt

string

createdAt

data.relation.native.largeImage.updatedAt

string

updatedAt

data.relation.native.largeImage.deletedAt

string

updatedAt

data.relation.native.largeImage.weight

string

weight

data.relation.native.assetDataDesc

string

Ad text

data.relation.native.assetTitle

string

Ad title

data.relation.native.assetDataSponsored

string

Brand name

data.relation.native.assetCtaText

string

CTA button text

data.relation.native.clickUrl

string

Click URL

data.relation.native.displayUrl

string

Display URL

data.relation.native.impTracker

string

Impression tracker

5.3.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 12,
        "userId": 22,
        "isActive": 0,
        "approved": "pending",
        "creativeType": "native",
        "name": "Native creative #2",
        "frequencyType": "user",
        "frequency": 0,
        "frequencyCap": 1,
        "frequencyPeriod": 1,
        "bidPrice": "5.19",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": "416 x 133",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:02",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "native": {
                "smallImageId": 13,
                "largeImageId": 14,
                "smallImage": {
                    "id": 13,
                    "folderId": null,
                    "userId": 22,
                    "width": 489,
                    "height": 171,
                    "name": "22_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                    "url": "http:\/\/sipes.com\/22_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-07-23T13:35:02.000000Z",
                    "updatedAt": "2024-07-23T13:35:02.000000Z",
                    "deletedAt": null,
                    "weight": 124069
                },
                "largeImage": {
                    "id": 14,
                    "folderId": null,
                    "userId": 22,
                    "width": 416,
                    "height": 133,
                    "name": "22_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                    "url": "http:\/\/www.veum.com\/22_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-07-23T13:35:02.000000Z",
                    "updatedAt": "2024-07-23T13:35:02.000000Z",
                    "deletedAt": null,
                    "weight": 209709
                },
                "assetDataDesc": "Dicta sit sunt et amet.",
                "assetTitle": "Excepturi sed vel velit.",
                "assetDataSponsored": "Laborum et quo ducimus sint qui aperiam.",
                "assetCtaText": "Eos ullam ut odit odit.",
                "clickUrl": "http:\/\/borer.com\/et-tempora-aut-facere-suscipit-et",
                "displayUrl": "https:\/\/www.morissette.info\/rerum-molestiae-quis-praesentium-voluptatem-quam",
                "impTracker": null
            }
        }
    }
}

5.4. Get by ID (Video creative)

A `GET` request with a path parameter of the id will return the creative with that id.

5.4.1. HTTP Request

URL

GET api/creatives/13 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJaMG95TnptcEh0R1I1STJsIiwic3ViIjoiMjMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.bUrDXdXlbeOtZOcEsnGZm7_XQfDOSVJXSOTBOGArPi4
DATA
{}

5.4.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives/13' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJaMG95TnptcEh0R1I1STJsIiwic3ViIjoiMjMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.bUrDXdXlbeOtZOcEsnGZm7_XQfDOSVJXSOTBOGArPi4' \
    -d '{}'

5.4.3. Response Body

Path Type Description

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.media.id

integer

Media Id

data.media.userId

string

User Id

data.media.mediaType

string

Media type (html, image, video)

data.media.originName

string

Uploaded file original name

data.media.name

string

Uploaded file name

data.media.extension

string

Uploaded file extention

data.media.url

string

Uploaded file URL

data.media.width

integer

Uploaded file image width

data.media.height

integer

Uploaded file image height

data.media.weight

integer

Uploaded file size

data.media.modifiedUrl

any

data.relation.video.sizes

string

Player size

data.relation.video.admBody

string

Third-party tag

data.relation.video.mimeType

array

MIME types

data.relation.video.width

integer

Video width

data.relation.video.height

integer

Video height

data.relation.video.duration

integer

Video duration

data.relation.video.clickUrl

string

Click URL

data.relation.video.partyTagFormat

integer

3 party tag format (0-NO VPAID, 1-VPAID 1, 2-VPAID 2, 3-ALL VPAID)

5.4.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 13,
        "userId": 23,
        "isActive": 0,
        "approved": "pending",
        "creativeType": "video",
        "name": "Video creative #2",
        "frequencyType": "ip",
        "frequency": 0,
        "frequencyCap": 1,
        "frequencyPeriod": 1,
        "bidPrice": "16.02",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": "306 x 374",
        "weight": "0.26 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:02",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "video": {
                "sizes": "medium",
                "admBody": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<VAST version=\"2.0\">\n<Ad id=\"[HASH]\">\n    <InLine>\n        <AdSystem>DSP<\/AdSystem>\n        <AdTitle>Smartyads<\/AdTitle>\n        <Description>RTB<\/Description>\n        <Creatives>\n            <Creative AdID=\"572\">\n                <Linear>\n                    <Duration>00:00:09<\/Duration>\n                    <VideoClicks>\n                        <ClickThrough><![CDATA[https:\/\/picsum.photos\/]]><\/ClickThrough>\n                    <\/VideoClicks>\n                    <MediaFiles>\n                        <MediaFile delivery=\"streaming\" type=\"video\/quicktime\" width=\"640\" height=\"360\"><![CDATA[http:\/\/72.mp4]]><\/MediaFile>\n                    <\/MediaFiles>\n                <\/Linear>\n            <\/Creative>\n        <\/Creatives>\n    <\/InLine>\n<\/Ad>\n<\/VAST>",
                "mimeType": [
                    "video\/x-ms-wmv"
                ],
                "width": 306,
                "height": 374,
                "duration": 5,
                "clickUrl": "http:\/\/www.king.com\/",
                "partyTagFormat": 0
            }
        }
    }
}

5.5. Create a Custom Banner Creative with Third-party tag

A `POST` request will create new creative.

5.5.1. Request Body

Path Type Description Required

name

string

Creative name

+

creativeType

string

Creative type: banner, native, video, audio

+

frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

frequency

boolean

Frequency on/off.

frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

bidPrice

float

CPM

+

banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

banner.width

integer

Banner width

+

banner.height

integer

Banner height

+

banner.admBody

string

Third-party tag

+

categories.IAB1

array

Categories (required if subCategories is empty)

+

subCategories.IAB1

array

SubCategories (required if categories is empty)

+

5.5.2. HTTP Request

URL

POST api/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJGeURCakY3a1ZTMVdsdTkxIiwic3ViIjoiMjQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.jE-KZKo6_lWHrx0MsqAyI58nap_x8frGCr9ms3V1sXM
DATA
{
    "name": "Banner creative #3",
    "creativeType": "banner",
    "frequencyType": "user",
    "frequencyCap": 1,
    "frequency": 1,
    "frequencyPeriod": 1,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 0,
        "width": 320,
        "height": 200,
        "admBody": "<iframe src=\"url.to.script\"><\/iframe>"
    },
    "categories": {
        "IAB1": true
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    }
}

5.5.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJGeURCakY3a1ZTMVdsdTkxIiwic3ViIjoiMjQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.jE-KZKo6_lWHrx0MsqAyI58nap_x8frGCr9ms3V1sXM' \
    -d '{
    "name": "Banner creative #3",
    "creativeType": "banner",
    "frequencyType": "user",
    "frequencyCap": 1,
    "frequency": 1,
    "frequencyPeriod": 1,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 0,
        "width": 320,
        "height": 200,
        "admBody": "<iframe src=\"url.to.script\"><\/iframe>"
    },
    "categories": {
        "IAB1": true
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    }
}'

5.5.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.relation.banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

data.relation.banner.admBody

string

Third-party tag

data.relation.banner.bannerType

String

Banner type (banner,inBannerVideo)

data.relation.banner.clickUrl

string

Click URL

data.relation.banner.width

integer

Banner width

data.relation.banner.height

integer

Banner height

5.5.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Creative created.",
    "data": {
        "id": 14,
        "userId": 24,
        "isActive": null,
        "approved": null,
        "creativeType": "banner",
        "name": "Banner creative #3",
        "frequencyType": "user",
        "frequency": 1,
        "frequencyCap": 1,
        "frequencyPeriod": 1,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "320 x 200",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:03",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": 0,
                "admBody": "<iframe src=\"url.to.script\"><\/iframe>",
                "bannerType": null,
                "clickUrl": null,
                "width": 320,
                "height": 200
            }
        }
    }
}

5.6. Create a Custom Banner Creative with Media image

A `POST` request will create new creative.

5.6.1. Request Body

Path Type Description Required

name

string

Creative name

+

creativeType

string

Creative type: banner, native, video, audio

+

mediaId

array

Media image Id

+

frequency

boolean

Frequency on/off.

bidPrice

float

CPM

+

banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

banner.width

integer

Banner width

+

banner.height

integer

Banner height

+

banner.clickUrl

string

Click URL

+

subCategories.IAB1

array

SubCategories (required if categories is empty)

+

categories.IAB1

array

Categories (required if subCategories is empty)

+

5.6.2. HTTP Request

URL

POST api/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJzM0JnV1FPTndDQnlkbjYyIiwic3ViIjoiMjUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.0x2m_S-8VXRkkmxSWhkKIsyhjice7Ykg732tucvZNqo
DATA
{
    "name": "Banner creative #4",
    "creativeType": "banner",
    "mediaId": 16,
    "frequency": 0,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 0,
        "width": 320,
        "height": 200,
        "clickUrl": "http:\/\/volkman.com\/"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}

5.6.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJzM0JnV1FPTndDQnlkbjYyIiwic3ViIjoiMjUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.0x2m_S-8VXRkkmxSWhkKIsyhjice7Ykg732tucvZNqo' \
    -d '{
    "name": "Banner creative #4",
    "creativeType": "banner",
    "mediaId": 16,
    "frequency": 0,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 0,
        "width": 320,
        "height": 200,
        "clickUrl": "http:\/\/volkman.com\/"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}'

5.6.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.media.id

integer

Media Id

data.media.userId

string

User Id

data.media.mediaType

string

Media type (html, image, video)

data.media.originName

string

Uploaded file original name

data.media.name

string

Uploaded file name

data.media.extension

string

Uploaded file extention

data.media.url

string

Uploaded file URL

data.media.width

integer

Uploaded file image width

data.media.height

integer

Uploaded file image height

data.media.weight

integer

Uploaded file size

data.media.modifiedUrl

any

data.relation.banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

data.relation.banner.admBody

string

Third-party tag

data.relation.banner.bannerType

String

Banner type (banner,inBannerVideo)

data.relation.banner.clickUrl

string

Click URL

data.relation.banner.width

integer

Banner width

data.relation.banner.height

integer

Banner height

5.6.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Creative created.",
    "data": {
        "id": 15,
        "userId": 25,
        "isActive": null,
        "approved": null,
        "creativeType": "banner",
        "name": "Banner creative #4",
        "frequencyType": null,
        "frequency": 0,
        "frequencyCap": null,
        "frequencyPeriod": null,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "314 x 306",
        "weight": "0.11 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:03",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": 0,
                "admBody": "<a target=\"_blank\" href=\"http:\/\/volkman.com\/\" ><img src=\"http:\/\/klocko.com\/aut-aspernatur-natus-omnis-voluptatem25_58f0737717543603aa77ee7b02fbbb9b.jpg\"\/><\/a>",
                "bannerType": null,
                "clickUrl": "http:\/\/volkman.com\/",
                "width": 314,
                "height": 306
            }
        }
    }
}

5.7. Create a Custom Banner Creative with Rich Media Html

A `POST` request will create new creative.

5.7.1. Request Body

Path Type Description Required

name

string

Creative name

+

creativeType

string

Creative type: banner, native, video, audio

+

mediaId

array

HTML Media Id

+

frequency

boolean

Frequency on/off.

bidPrice

float

CPM

+

banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

banner.width

integer

Banner width

+

banner.height

integer

Banner height

+

subCategories.IAB1

array

SubCategories (required if categories is empty)

+

categories.IAB1

array

Categories (required if subCategories is empty)

+

5.7.2. HTTP Request

URL

POST api/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJjMUFudmhVY1Zqd0pLdVU4Iiwic3ViIjoiMjYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.FalpiBVhXxd7LkVV0_9ksDn6hMml1zRQa8o1QhWGHo4
DATA
{
    "name": "Banner creative #5",
    "creativeType": "banner",
    "mediaId": 17,
    "frequency": 0,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 3,
        "width": 320,
        "height": 200
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}

5.7.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJjMUFudmhVY1Zqd0pLdVU4Iiwic3ViIjoiMjYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.FalpiBVhXxd7LkVV0_9ksDn6hMml1zRQa8o1QhWGHo4' \
    -d '{
    "name": "Banner creative #5",
    "creativeType": "banner",
    "mediaId": 17,
    "frequency": 0,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 3,
        "width": 320,
        "height": 200
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}'

5.7.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.media.id

integer

Media Id

data.media.userId

string

User Id

data.media.mediaType

string

Media type (html, image, video)

data.media.originName

string

Uploaded file original name

data.media.name

string

Uploaded file name

data.media.extension

string

Uploaded file extention

data.media.url

string

Uploaded file URL

data.media.width

integer

Uploaded file image width

data.media.height

integer

Uploaded file image height

data.media.weight

integer

Uploaded file size

data.media.modifiedUrl

any

data.relation.banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

data.relation.banner.admBody

string

Third-party tag

data.relation.banner.bannerType

String

Banner type (banner,inBannerVideo)

data.relation.banner.clickUrl

string

Click URL

data.relation.banner.width

integer

Banner width

data.relation.banner.height

integer

Banner height

5.7.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Creative created.",
    "data": {
        "id": 16,
        "userId": 26,
        "isActive": null,
        "approved": null,
        "creativeType": "banner",
        "name": "Banner creative #5",
        "frequencyType": null,
        "frequency": 0,
        "frequencyCap": null,
        "frequencyPeriod": null,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "320 x 200",
        "weight": "0.29 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:03",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": 3,
                "admBody": "<iframe src=\"http:\/\/huels.biz\/laborum-eos-aut-velit-aut-ex.html26_58f0737717543603aa77ee7b02fbbb9b\/index.html\"><\/iframe>",
                "bannerType": null,
                "clickUrl": null,
                "width": 320,
                "height": 200
            }
        }
    }
}

5.8. Create a Custom Native Creative

A `POST` request will create new creative.

5.8.1. Request Body

Path Type Description Required

name

string

Creative name

+

creativeType

string

Creative type: banner, native, video, audio

+

frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

frequency

boolean

Frequency on/off.

bidPrice

float

CPM

+

folderId

string

Folder Id

native.smallImageId

integer

Logo media id

native.largeImageId

integer

Image media id

+

native.assetDataDesc

string

Ad text

native.assetTitle

string

Ad title

native.assetDataSponsored

string

Brand name

native.assetCtaText

string

CTA button text

native.clickUrl

string

Click URL

+

native.displayUrl

string

Display URL

subCategories.IAB1

array

SubCategories (required if categories is empty)

+

categories.IAB1

array

Categories (required if subCategories is empty)

+

5.8.2. HTTP Request

URL

POST api/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJEbHlFMkF6TTQycEpUVUtUIiwic3ViIjoiMjciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.YBp2ypj7eUzuhtoYaSzEiIXZ3W63vq4odeyNAo9l6RM
DATA
{
    "name": "Native creative #3",
    "creativeType": "native",
    "frequencyType": "user",
    "frequencyCap": 1,
    "frequencyPeriod": 1,
    "frequency": 1,
    "bidPrice": 0.5,
    "folderId": null,
    "native": {
        "smallImageId": 18,
        "largeImageId": 18,
        "assetDataDesc": "Minima qui.",
        "assetTitle": "Nesciunt.",
        "assetDataSponsored": "Optio et iste aliquam.",
        "assetCtaText": "Labore aut.",
        "clickUrl": "http:\/\/miller.info\/quia-blanditiis-assumenda-qui.html",
        "displayUrl": "http:\/\/www.homenick.info\/"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}

5.8.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJEbHlFMkF6TTQycEpUVUtUIiwic3ViIjoiMjciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.YBp2ypj7eUzuhtoYaSzEiIXZ3W63vq4odeyNAo9l6RM' \
    -d '{
    "name": "Native creative #3",
    "creativeType": "native",
    "frequencyType": "user",
    "frequencyCap": 1,
    "frequencyPeriod": 1,
    "frequency": 1,
    "bidPrice": 0.5,
    "folderId": null,
    "native": {
        "smallImageId": 18,
        "largeImageId": 18,
        "assetDataDesc": "Minima qui.",
        "assetTitle": "Nesciunt.",
        "assetDataSponsored": "Optio et iste aliquam.",
        "assetCtaText": "Labore aut.",
        "clickUrl": "http:\/\/miller.info\/quia-blanditiis-assumenda-qui.html",
        "displayUrl": "http:\/\/www.homenick.info\/"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}'

5.8.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.media.id

integer

Media Id

data.media.userId

string

User Id

data.media.mediaType

string

Media type (html, image, video)

data.media.originName

string

Uploaded file original name

data.media.name

string

Uploaded file name

data.media.extension

string

Uploaded file extention

data.media.url

string

Uploaded file URL

data.media.width

integer

Uploaded file image width

data.media.height

integer

Uploaded file image height

data.media.weight

integer

Uploaded file size

data.media.modifiedUrl

any

data.relation.native.smallImageId

integer

Logo media id

data.relation.native.largeImageId

integer

Image media id

data.relation.native.smallImage.id

integer

Logo media id

data.relation.native.smallImage.folderId

string

Folder id

data.relation.native.smallImage.userId

integer

User id

data.relation.native.smallImage.width

string

width

data.relation.native.smallImage.height

string

height

data.relation.native.smallImage.name

string

name

data.relation.native.smallImage.url

string

url

data.relation.native.smallImage.href

string

href

data.relation.native.smallImage.originName

string

originName

data.relation.native.smallImage.path

string

path

data.relation.native.smallImage.extension

string

extension

data.relation.native.smallImage.mediaType

string

mediaType

data.relation.native.smallImage.createdAt

string

createdAt

data.relation.native.smallImage.updatedAt

string

updatedAt

data.relation.native.smallImage.deletedAt

string

updatedAt

data.relation.native.smallImage.weight

string

weight

data.relation.native.largeImage.id

integer

Image media id

data.relation.native.largeImage.folderId

string

Folder id

data.relation.native.largeImage.userId

integer

User id

data.relation.native.largeImage.width

string

width

data.relation.native.largeImage.height

string

height

data.relation.native.largeImage.name

string

name

data.relation.native.largeImage.url

string

url

data.relation.native.largeImage.href

string

href

data.relation.native.largeImage.originName

string

originName

data.relation.native.largeImage.path

string

path

data.relation.native.largeImage.extension

string

extension

data.relation.native.largeImage.mediaType

string

mediaType

data.relation.native.largeImage.createdAt

string

createdAt

data.relation.native.largeImage.updatedAt

string

updatedAt

data.relation.native.largeImage.deletedAt

string

updatedAt

data.relation.native.largeImage.weight

string

weight

data.relation.native.assetDataDesc

string

Ad text

data.relation.native.assetTitle

string

Ad title

data.relation.native.assetDataSponsored

string

Brand name

data.relation.native.assetCtaText

string

CTA button text

data.relation.native.clickUrl

string

Click URL

data.relation.native.displayUrl

string

Display URL

data.relation.native.impTracker

string

Impression tracker

5.8.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Creative created.",
    "data": {
        "id": 17,
        "userId": 27,
        "isActive": null,
        "approved": null,
        "creativeType": "native",
        "name": "Native creative #3",
        "frequencyType": "user",
        "frequency": 1,
        "frequencyCap": 1,
        "frequencyPeriod": 1,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "264 x 401",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:03",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "native": {
                "smallImageId": 18,
                "largeImageId": 18,
                "smallImage": {
                    "id": 18,
                    "folderId": null,
                    "userId": 27,
                    "width": 264,
                    "height": 401,
                    "name": "27_58f0737717543603aa77ee7b02fbbb9b.jpg",
                    "url": "http:\/\/roob.net\/consectetur-facilis-vero-aliquam-voluptate-cupiditate.html27_58f0737717543603aa77ee7b02fbbb9b.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-07-23T13:35:03.000000Z",
                    "updatedAt": "2024-07-23T13:35:03.000000Z",
                    "deletedAt": null,
                    "weight": 379591
                },
                "largeImage": {
                    "id": 18,
                    "folderId": null,
                    "userId": 27,
                    "width": 264,
                    "height": 401,
                    "name": "27_58f0737717543603aa77ee7b02fbbb9b.jpg",
                    "url": "http:\/\/roob.net\/consectetur-facilis-vero-aliquam-voluptate-cupiditate.html27_58f0737717543603aa77ee7b02fbbb9b.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-07-23T13:35:03.000000Z",
                    "updatedAt": "2024-07-23T13:35:03.000000Z",
                    "deletedAt": null,
                    "weight": 379591
                },
                "assetDataDesc": "Minima qui.",
                "assetTitle": "Nesciunt.",
                "assetDataSponsored": "Optio et iste aliquam.",
                "assetCtaText": "Labore aut.",
                "clickUrl": "https:\/\/miller.info\/quia-blanditiis-assumenda-qui.html",
                "displayUrl": "http:\/\/www.homenick.info\/",
                "impTracker": null
            }
        }
    }
}

5.9. Create a Custom Video Creative with Third-party tag

A `POST` request will create new creative.

5.9.1. Request Body

Path Type Description Required

name

string

Creative name

+

creativeType

string

Creative type: banner, native, video, audio

+

frequency

boolean

Frequency on/off.

bidPrice

float

CPM

+

video.sizes

string

Player size

+

video.mimeType

array

MIME types

+

video.admBody

string

Third-party tag

+

subCategories.IAB1

array

SubCategories (required if categories is empty)

+

categories.IAB1

array

Categories (required if subCategories is empty)

+

5.9.2. HTTP Request

URL

POST api/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJkRm5vcjNNcDU1dFdNWTVjIiwic3ViIjoiMjgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.y2N2aPIS8kvR2jjgLKdEUWT4etpMV03V_RrcwSCxU3k
DATA
{
    "name": "Video creative #3",
    "creativeType": "video",
    "frequency": 0,
    "bidPrice": 100,
    "video": {
        "sizes": "small",
        "mimeType": [
            "video\/mp4"
        ],
        "admBody": "<iframe src=\"url.to.script\"><\/iframe>"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}

5.9.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJkRm5vcjNNcDU1dFdNWTVjIiwic3ViIjoiMjgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.y2N2aPIS8kvR2jjgLKdEUWT4etpMV03V_RrcwSCxU3k' \
    -d '{
    "name": "Video creative #3",
    "creativeType": "video",
    "frequency": 0,
    "bidPrice": 100,
    "video": {
        "sizes": "small",
        "mimeType": [
            "video\/mp4"
        ],
        "admBody": "<iframe src=\"url.to.script\"><\/iframe>"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}'

5.9.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.relation.video.sizes

string

Player size

data.relation.video.admBody

string

Third-party tag

data.relation.video.mimeType

array

MIME types

data.relation.video.width

integer

Video width

data.relation.video.height

integer

Video height

data.relation.video.duration

integer

Video duration

data.relation.video.clickUrl

string

Click URL

data.relation.video.partyTagFormat

integer

3 party tag format (0-NO VPAID, 1-VPAID 1, 2-VPAID 2, 3-ALL VPAID)

5.9.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Creative created.",
    "data": {
        "id": 18,
        "userId": 28,
        "isActive": null,
        "approved": null,
        "creativeType": "video",
        "name": "Video creative #3",
        "frequencyType": null,
        "frequency": 0,
        "frequencyCap": null,
        "frequencyPeriod": null,
        "bidPrice": 100,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "0 x 0",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:03",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "video": {
                "sizes": "small",
                "admBody": "<iframe src=\"url.to.script\"><\/iframe>",
                "mimeType": [
                    "video\/mp4"
                ],
                "width": 0,
                "height": 0,
                "duration": 0,
                "clickUrl": "",
                "partyTagFormat": null
            }
        }
    }
}

5.10. Create a Custom Video Creative with Media image

A `POST` request will create new creative.

5.10.1. Request Body

Path Type Description Required

name

string

Creative name

+

creativeType

string

Creative type: banner, native, video, audio

+

frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

frequency

boolean

Frequency on/off.

mediaId

array

Media video Id

+

bidPrice

float

CPM

+

video.clickUrl

string

Click URL

+

subCategories.IAB1

array

SubCategories (required if categories is empty)

+

categories.IAB1

array

Categories (required if subCategories is empty)

+

5.10.2. HTTP Request

URL

POST api/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJUYnltVXQ0eE9uVkZibTdPIiwic3ViIjoiMjkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.SwDaHQ9zH4nIzuLaRWonM_eWRhObQIczSmSQezoDA3M
DATA
{
    "name": "Video creative #4",
    "creativeType": "video",
    "frequencyType": "user",
    "frequencyCap": 1,
    "frequencyPeriod": 1,
    "frequency": 1,
    "mediaId": 19,
    "bidPrice": 100,
    "video": {
        "clickUrl": "https:\/\/www.tromp.info\/laboriosam-facere-et-eum-aut-soluta-culpa"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}

5.10.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDMsImV4cCI6MTcyMTc0NTMwMywibmJmIjoxNzIxNzQxNzAzLCJqdGkiOiJUYnltVXQ0eE9uVkZibTdPIiwic3ViIjoiMjkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.SwDaHQ9zH4nIzuLaRWonM_eWRhObQIczSmSQezoDA3M' \
    -d '{
    "name": "Video creative #4",
    "creativeType": "video",
    "frequencyType": "user",
    "frequencyCap": 1,
    "frequencyPeriod": 1,
    "frequency": 1,
    "mediaId": 19,
    "bidPrice": 100,
    "video": {
        "clickUrl": "https:\/\/www.tromp.info\/laboriosam-facere-et-eum-aut-soluta-culpa"
    },
    "subCategories": {
        "IAB1": [
            "IAB1-1"
        ]
    },
    "categories": {
        "IAB1": true
    }
}'

5.10.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.media.id

integer

Media Id

data.media.userId

string

User Id

data.media.mediaType

string

Media type (html, image, video)

data.media.originName

string

Uploaded file original name

data.media.name

string

Uploaded file name

data.media.extension

string

Uploaded file extention

data.media.url

string

Uploaded file URL

data.media.width

integer

Uploaded file image width

data.media.height

integer

Uploaded file image height

data.media.weight

integer

Uploaded file size

data.media.modifiedUrl

any

data.relation.video.sizes

string

Player size

data.relation.video.admBody

string

Third-party tag

data.relation.video.mimeType

array

MIME types

data.relation.video.width

integer

Video width

data.relation.video.height

integer

Video height

data.relation.video.duration

integer

Video duration

data.relation.video.clickUrl

string

Click URL

data.relation.video.partyTagFormat

integer

3 party tag format (0-NO VPAID, 1-VPAID 1, 2-VPAID 2, 3-ALL VPAID)

5.10.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Creative created.",
    "data": {
        "id": 19,
        "userId": 29,
        "isActive": null,
        "approved": null,
        "creativeType": "video",
        "name": "Video creative #4",
        "frequencyType": "user",
        "frequency": 1,
        "frequencyCap": 1,
        "frequencyPeriod": 1,
        "bidPrice": 100,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "371 x 224",
        "weight": "0.11 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:04",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "video": {
                "sizes": "medium",
                "admBody": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<VAST version=\"2.0\">\n<Ad id=\"[HASH]\">\n    <InLine>\n        <AdSystem>DSP<\/AdSystem>\n        <AdTitle>Smartyads<\/AdTitle>\n        <Description>RTB<\/Description>\n        <Creatives>\n            <Creative AdID=\"19\">\n                <Linear>\n                    <Duration>00:00:05<\/Duration>\n                    <VideoClicks>\n                        <ClickThrough><![CDATA[https:\/\/www.tromp.info\/laboriosam-facere-et-eum-aut-soluta-culpa]]><\/ClickThrough>\n                    <\/VideoClicks>\n                    <MediaFiles>\n                        <MediaFile delivery=\"\" type=\"video\/mp4\" width=\"371\" height=\"224\"><![CDATA[https:\/\/reichert.com\/consequatur-ut-et-et-quis-in.html29_58f0737717543603aa77ee7b02fbbb9b.mp4]]><\/MediaFile>\n                    <\/MediaFiles>\n                <\/Linear>\n            <\/Creative>\n        <\/Creatives>\n    <\/InLine>\n<\/Ad>\n<\/VAST>",
                "mimeType": [
                    "video\/mp4"
                ],
                "width": 371,
                "height": 224,
                "duration": 5,
                "clickUrl": "https:\/\/www.tromp.info\/laboriosam-facere-et-eum-aut-soluta-culpa",
                "partyTagFormat": null
            }
        }
    }
}

5.11. Update a Custom Creative

A `PATCH` request will update creative.

5.11.1. Request Body

Path Type Description Required

isActive

boolean

Creative status

5.11.2. HTTP Request

URL

PUT api/creatives/20 HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJoV01lVWNXSVRvek1lazZoIiwic3ViIjoiMzAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.od5p7Ndhc8aZjrvJEgUOtNPRBRNyN60aYV3MD4JhLJM
DATA
{
    "isActive": true
}

5.11.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives/20' -i -X PUT \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJoV01lVWNXSVRvek1lazZoIiwic3ViIjoiMzAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.od5p7Ndhc8aZjrvJEgUOtNPRBRNyN60aYV3MD4JhLJM' \
    -d '{
    "isActive": true
}'

5.11.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

Creative Id

data.userId

integer

User Id

data.isActive

boolean

Creative status

data.approved

string

Creative approval status (approved, pending, disapproved)

data.creativeType

string

Creative type: banner, native, video, audio

data.name

string

Creative name

data.frequencyType

string

Frequency Type (user, ip).Required if frequency is on.

data.frequency

boolean

Frequency on/off.

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period".Required if frequency is on.

data.frequencyPeriod

integer

Frequency Period (min-1,max-3). Required if frequency is on.

data.bidPrice

float

CPM

data.autoresize

boolean

autoresize

data.adaptiveCpm

bool

adaptiveCpm

data.size

string

Image width and height

data.weight

string

File size

data.folderId

string

Folder Id

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.pendingAt

datetime

Date of pending start

data.deletedAt

datetime

Date of deletion

data.relation.banner.apiFramework

integer

Rich Media: 0-NO MRAID, 3-MRAID1, 5-MRAID2, 6-MRAID3, 10-ALL MRAID

data.relation.banner.admBody

string

Third-party tag

data.relation.banner.bannerType

String

Banner type (banner,inBannerVideo)

data.relation.banner.clickUrl

string

Click URL

data.relation.banner.width

integer

Banner width

data.relation.banner.height

integer

Banner height

5.11.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Creative updated.",
    "data": {
        "id": 20,
        "userId": 30,
        "isActive": true,
        "approved": "pending",
        "creativeType": "banner",
        "name": "laudantium fugiat",
        "frequencyType": "ip",
        "frequency": 0,
        "frequencyCap": 6,
        "frequencyPeriod": 1,
        "bidPrice": "11.77",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": " x ",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-07-23 00:00:00",
        "updatedAt": "2024-07-23 13:35:04",
        "pendingAt": null,
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": null,
                "admBody": null,
                "bannerType": null,
                "clickUrl": null,
                "width": null,
                "height": null
            }
        }
    }
}

5.12. Delete a Custom Creative

A `DELETE` request will delete creative.

5.12.1. HTTP Request

URL

DELETE api/creatives/21 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJnT001amhHdzRPZWEwVFhzIiwic3ViIjoiMzEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.WHk4o4DYY5rSm_G7Atl3BujbNP_DNUBfbdgcwIMP_Ig
Content-type: application/x-www-form-urlencoded
DATA
{}

5.12.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/creatives/21' -i -X DELETE \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJnT001amhHdzRPZWEwVFhzIiwic3ViIjoiMzEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.WHk4o4DYY5rSm_G7Atl3BujbNP_DNUBfbdgcwIMP_Ig' \
                -H 'Content-type: application/x-www-form-urlencoded' \
    -d '{}'

5.12.3. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{}

6. Assign Creatives to Campaigns

6.1. Get list of Creatives assigned to Campaign

A `GET` request with Campaign Id in url will get list of Creatives assigned to Campaign

6.1.1. HTTP Request

URL

GET api/campaigns/10/creatives HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJCZ0s4WXhEYU9uQmMzb1pjIiwic3ViIjoiMTIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.SIMcN5H8CNwBn2rXDBezzDd0HClQWXzynfTE4AdBvmY
DATA
{}

6.1.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/10/creatives' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJCZ0s4WXhEYU9uQmMzb1pjIiwic3ViIjoiMTIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.SIMcN5H8CNwBn2rXDBezzDd0HClQWXzynfTE4AdBvmY' \
    -d '{}'

6.1.3. Response Body

Path Type Description

data.*.id

integer

Creative Id

data.*.userId

integer

User Id

data.*.isActive

boolean

Creative status

data.*.approved

string

Creative approval status (approved, pending, disapproved)

data.*.creativeType

string

Creative type: banner, native, video, audio

data.*.name

string

Creative name

data.*.frequencyType

string

Identify the user to limit the number of the ad shows for the specific user (user, ip). Required if frequency is on.

data.*.frequency

string

Frequency on/off

data.*.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period". Required if frequency is on.

data.*.frequencyPeriod

integer

Frequency period in days (min-1,max-3). Required if frequency is on.

data.*.bidPrice

float

CPM

data.*.autoresize

boolean

autoresize

data.*.adaptiveCpm

bool

adaptiveCpm

data.*.size

string

Image width and height

data.*.weight

string

File size

data.*.folderId

string

Folder Id

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

data.*.pendingAt

datetime

Date of pending start

data.*.deletedAt

datetime

Date of deletion

meta.pagination.total

integer

Pagination: total items count

meta.pagination.count

integer

Pagination: page items count

meta.pagination.per_page

integer

Pagination: items per page

meta.pagination.current_page

integer

Pagination: current page number

meta.pagination.total_pages

integer

Pagination: total pages count

meta.pagination.links

object

Pagination links

6.1.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": [
        {
            "id": 1,
            "userId": 12,
            "isActive": 0,
            "approved": "pending",
            "creativeType": "banner",
            "name": "Test Creative #1",
            "frequencyType": "ip",
            "frequency": 0,
            "frequencyCap": 1,
            "frequencyPeriod": 1,
            "bidPrice": "3.52",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "686 x 382",
            "weight": "0.19 MB",
            "folderId": null,
            "createdAt": "2024-07-23 00:00:00",
            "updatedAt": "2024-07-23 13:35:02",
            "pendingAt": null,
            "deletedAt": null,
            "media": {
                "id": 1,
                "userId": 12,
                "mediaType": "image",
                "originName": "image.jpg",
                "name": "12_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                "extension": "jpg",
                "url": "http:\/\/www.anderson.com\/sapiente-ullam-aut-quo-est-cupiditate12_0a5895eb48e5412d31279bebeda6ae4e.jpg",
                "width": 326,
                "height": 484,
                "weight": 199734
            },
            "relation": {
                "banner": {
                    "apiFramework": 0,
                    "admBody": "<a target=\"_blank\" href=\"http:\/\/www.klein.com\/ea-labore-sunt-modi-aliquid\" ><img src=\"http:\/\/www.schimmel.net\/alias-voluptatum-at-quos-praesentium-sunt-in\/10.jpg\"\/><\/a>",
                    "bannerType": "banner",
                    "clickUrl": "http:\/\/yundt.com\/",
                    "width": 686,
                    "height": 382,
                    "childrenCreative": null,
                    "statusChildrenCreative": [],
                    "main": 1
                }
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 1000,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

6.2. Replace Creatives assigned to Campaign

A `POST` request with Campaign Id in url will replace Creatives assigned to Campaign

6.2.1. Request Body

Path Type Description Required

ids

array

array of Creative ids

+

6.2.2. HTTP Request

URL

POST api/campaigns/11/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJMMWtydDVndUM5WVRqMTdDIiwic3ViIjoiMTMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.cjA07ZuP4RqiitlAy7-5oTFgMGtFXSNxtMSdkNbB5ho
DATA
{
    "ids": [
        2,
        3
    ]
}

6.2.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/11/creatives' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJMMWtydDVndUM5WVRqMTdDIiwic3ViIjoiMTMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.cjA07ZuP4RqiitlAy7-5oTFgMGtFXSNxtMSdkNbB5ho' \
    -d '{
    "ids": [
        2,
        3
    ]
}'

6.2.4. Response Body

Path Type Description

message

string

Result message

6.2.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Replaced."
}

6.3. Append Creatives assigned to Campaign

A `PATCH` request with Campaign Id in url will append Creatives assigned to Campaign

6.3.1. Request Body

Path Type Description Required

ids

array

array of Creative ids

+

6.3.2. HTTP Request

URL

PATCH api/campaigns/12/creatives HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJwM21NYmh4eXNlTldtczFpIiwic3ViIjoiMTQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.Qn3wDMITl-F1E0Q0WMLne1KAZIu8QGxtWMHGX_F0Ucs
DATA
{
    "ids": [
        5
    ]
}

6.3.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/12/creatives' -i -X PATCH \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJwM21NYmh4eXNlTldtczFpIiwic3ViIjoiMTQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.Qn3wDMITl-F1E0Q0WMLne1KAZIu8QGxtWMHGX_F0Ucs' \
    -d '{
    "ids": [
        5
    ]
}'

6.3.4. Response Body

Path Type Description

message

string

Result message

6.3.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Appended."
}

6.4. Remove Creatives assigned to Campaign

A `DELETE` request with Campaign Id in url will remove Creatives assigned to Campaign

6.4.1. Request Body

Path Type Description Required

ids

array

array of Creative ids

+

6.4.2. HTTP Request

URL

DELETE api/campaigns/13/creatives HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJPb08zRk91aWZFdE5JMDNlIiwic3ViIjoiMTUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.67RYy2o6lQZo9nLLp4vnf7Sd4wH93-k0mi8b85asaL8
Content-type: application/x-www-form-urlencoded
DATA
{
    "ids": [
        7
    ]
}

6.4.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/13/creatives' -i -X DELETE \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJPb08zRk91aWZFdE5JMDNlIiwic3ViIjoiMTUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.67RYy2o6lQZo9nLLp4vnf7Sd4wH93-k0mi8b85asaL8' \
                -H 'Content-type: application/x-www-form-urlencoded' \
    -d '{
    "ids": [
        7
    ]
}'

6.4.4. Response Body

Path Type Description

message

string

Result message

deleted

boolean

Deleting result

6.4.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Deleted.",
    "deleted": true
}

7. Filterlists

7.1. Filter lists

A `GET` request will return a filter lists

7.1.1. HTTP Request

URL

GET api/filterlist HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiIydXZLVWdIQjcyTUN2NnluIiwic3ViIjoiMzIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.bkOrwzMw5u_zJIVYazZKib-btOBo5S40lW1y6GW7z3g
DATA
{}

7.1.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/filterlist' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiIydXZLVWdIQjcyTUN2NnluIiwic3ViIjoiMzIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.bkOrwzMw5u_zJIVYazZKib-btOBo5S40lW1y6GW7z3g' \
    -d '{}'

7.1.3. Response Body

Path Type Description

data.*.id

integer

List Id

data.*.isActive

bool

on/off

data.*.userId

integer

User Id

data.*.title

string

List title

data.*.type

string

Filter list type: listDomains, listApps, listBundles, listDeviceIfas, listPublishers, listIpAdresses, listSiteAndAppIds, listUrls, listTags

data.*.isInclude

boolean

White/Black list

data.*.count

integer

Object count

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

meta.pagination.total

integer

Pagination: total items count

meta.pagination.count

integer

Pagination: page items count

meta.pagination.per_page

integer

Pagination: items per page

meta.pagination.current_page

integer

Pagination: current page number

meta.pagination.total_pages

integer

Pagination: total pages count

meta.pagination.links

array

Pagination: array links

7.1.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": [
        {
            "id": 10,
            "isActive": 0,
            "userId": 32,
            "title": "Test Filter list #1",
            "type": "domain",
            "isInclude": "White",
            "count": 1,
            "createdAt": "2024-07-23",
            "updatedAt": "2024-07-23"
        },
        {
            "id": 11,
            "isActive": 0,
            "userId": 32,
            "title": "Test Filter list #2",
            "type": "ipAdresses",
            "isInclude": "White",
            "count": 2,
            "createdAt": "2024-07-23",
            "updatedAt": "2024-07-23"
        },
        {
            "id": 12,
            "isActive": 0,
            "userId": 32,
            "title": "Test Filter list #3",
            "type": "urls",
            "isInclude": "White",
            "count": 3,
            "createdAt": "2024-07-23",
            "updatedAt": "2024-07-23"
        }
    ],
    "meta": {
        "pagination": {
            "total": 3,
            "count": 3,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

7.2. Get filter lists by ID

A `GET` request will return a filter list  by ID

7.2.1. HTTP Request

URL

GET api/filterlist/13 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJQdWd4MHNlb0lSRkR2UmZSIiwic3ViIjoiMzMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.oNhT0Gq-1InFSrKyooAXXMjEoQfH10dBM4y4c4mzF5M
DATA
{}

7.2.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/filterlist/13' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJQdWd4MHNlb0lSRkR2UmZSIiwic3ViIjoiMzMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.oNhT0Gq-1InFSrKyooAXXMjEoQfH10dBM4y4c4mzF5M' \
    -d '{}'

7.2.3. Response Body

Path Type Description

data.id

integer

List Id

data.userId

integer

User Id

data.isActive

bool

on/off

data.title

string

List title

data.type

string

Filter list type: listDomains, listApps, listBundles, listDeviceIfas, listPublishers, listIpAdresses, listSiteAndAppIds, listUrls, listTags

data.isInclude

boolean

White/Black list

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.items

array

items

data.listCount

integer

listCount

7.2.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 13,
        "userId": 33,
        "isActive": 0,
        "title": "Test Filter list #4",
        "type": "domain",
        "isInclude": true,
        "createdAt": "2024-07-23",
        "updatedAt": "2024-07-23",
        "items": [
            "dickens.com",
            "emmerich.org",
            "fahey.org",
            "rice.com",
            "sanford.com"
        ],
        "listCount": 5
    }
}

7.3. Create a filter lists

A `POST` request will set new filter list

7.3.1. Request Body

Path Type Description Required

title

string

List title

+

type

string

Filter list type: domain, apps, bundles, deviceIfas, publishers, ipAdresses, siteAndAppsIds, urls, tagIds

+

isInclude

bool

white/black

+

items

array

List array items (can be empty if there fileName)

fileName

string

null

File name from upload file - Store filter list

7.3.2. HTTP Request

URL

POST api/filterlist HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJIRmEwOWc3VFQ3R2oxZlJyIiwic3ViIjoiMzQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.zququ0zM26SEIbOeOSx-CvRTfKDZLaMrcaJK3rJUOII
DATA
{
    "title": "Test Filter list #5",
    "type": "ipAdresses",
    "isInclude": true,
    "items": [
        "7.186.147.209",
        "42.204.238.190",
        "39.223.29.57",
        "237.28.84.111",
        "63.238.91.231"
    ],
    "fileName": null
}

7.3.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/filterlist' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJIRmEwOWc3VFQ3R2oxZlJyIiwic3ViIjoiMzQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.zququ0zM26SEIbOeOSx-CvRTfKDZLaMrcaJK3rJUOII' \
    -d '{
    "title": "Test Filter list #5",
    "type": "ipAdresses",
    "isInclude": true,
    "items": [
        "7.186.147.209",
        "42.204.238.190",
        "39.223.29.57",
        "237.28.84.111",
        "63.238.91.231"
    ],
    "fileName": null
}'

7.3.4. Response Body

Path Type Description

message

string

message

data.id

integer

List Id

data.userId

integer

User Id

data.isActive

bool

on/off

data.title

string

List title

data.type

string

Filter list type: listDomains, listApps, listBundles, listDeviceIfas, listPublishers, listIpAdresses, listSiteAndAppIds, listUrls, listTags

data.isInclude

boolean

White (1)/Black list(0)

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.items

array

List array items (can be empty if there fileName)

data.listCount

integer

list count

7.3.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "FilterList created.",
    "data": {
        "id": 14,
        "userId": 34,
        "isActive": null,
        "title": "Test Filter list #5",
        "type": "ipAdresses",
        "isInclude": true,
        "createdAt": "2024-07-23",
        "updatedAt": "2024-07-23",
        "items": [],
        "listCount": 0
    }
}

7.4. Filter lists update

A `PATCH` request will update filter lists

7.4.1. Request Body

Path Type Description Required

title

string

List title

isInclude

bool

white/black

items

array

List array items (can be empty if there fileName)

fileName

string

null

File name from upload file - Store filter list

7.4.2. HTTP Request

URL

PUT api/filterlist/15 HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJZekNBbXZLWVZhVWJySHFYIiwic3ViIjoiMzUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qdDVzjg5iLsCwz8jNAAuY2YfBSTNWi-XdG471qgmC2c
DATA
{
    "title": "Test FilterList #7",
    "isInclude": true,
    "items": [
        "http:\/\/www.schuster.com\/optio-error-beatae-molestias-sunt-distinctio-quia-accusantium",
        "http:\/\/www.armstrong.info\/rerum-atque-officiis-ratione-alias-maxime.html",
        "http:\/\/botsford.net\/tenetur-qui-autem-temporibus-deleniti-animi-et.html"
    ],
    "fileName": null
}

7.4.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/filterlist/15' -i -X PUT \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJZekNBbXZLWVZhVWJySHFYIiwic3ViIjoiMzUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qdDVzjg5iLsCwz8jNAAuY2YfBSTNWi-XdG471qgmC2c' \
    -d '{
    "title": "Test FilterList #7",
    "isInclude": true,
    "items": [
        "http:\/\/www.schuster.com\/optio-error-beatae-molestias-sunt-distinctio-quia-accusantium",
        "http:\/\/www.armstrong.info\/rerum-atque-officiis-ratione-alias-maxime.html",
        "http:\/\/botsford.net\/tenetur-qui-autem-temporibus-deleniti-animi-et.html"
    ],
    "fileName": null
}'

7.4.4. Response Body

Path Type Description

message

string

Result message

data.id

integer

List Id

data.userId

integer

User Id

data.isActive

bool

on/off

data.title

string

List title

data.type

string

Filter list type: domain, apps, bundles, deviceIfas, publishers, ipAdresses, siteAndAppsIds, urls, tagIds

data.isInclude

boolean

white/black

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

data.items

array

List items

data.listCount

integer

listCount

7.4.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "FilterList updated.",
    "data": {
        "id": 15,
        "userId": 35,
        "isActive": 0,
        "title": "Test FilterList #7",
        "type": "urls",
        "isInclude": true,
        "createdAt": "2024-07-23",
        "updatedAt": "2024-07-23",
        "items": [
            "http:\/\/www.carroll.com\/numquam-quam-ab-qui-praesentium-sint-distinctio",
            "http:\/\/www.hagenes.com\/"
        ],
        "listCount": 2
    }
}

7.5. Filter lists delete

A `DELETE` request will delete a filter lists

7.5.1. HTTP Request

URL

DELETE api/filterlist/16 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJOU0VhQjdJeHIwdDdFQVJDIiwic3ViIjoiMzYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.AIm6wiP-ttfxlXU5AOjSxc_FaoUAFdVNXjkQHlk-Kq0
Content-type: application/x-www-form-urlencoded
DATA
{}

7.5.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/filterlist/16' -i -X DELETE \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDQsImV4cCI6MTcyMTc0NTMwNCwibmJmIjoxNzIxNzQxNzA0LCJqdGkiOiJOU0VhQjdJeHIwdDdFQVJDIiwic3ViIjoiMzYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.AIm6wiP-ttfxlXU5AOjSxc_FaoUAFdVNXjkQHlk-Kq0' \
                -H 'Content-type: application/x-www-form-urlencoded' \
    -d '{}'

7.5.3. Response Body

Path Type Description

message

string

Result message

deleted

boolean

is deleted

7.5.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "FilterList deleted.",
    "deleted": true
}

8. Assign Filterlists to Campaigns

8.1. Get list of Filter Lists assigned to Campaign

A `GET` request with Campaign Id in url will get list of Filter Lists assigned to Campaign

8.1.1. HTTP Request

URL

GET api/campaigns/14/filterlists HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJZdVowNUVzcXNJU3pxQWlLIiwic3ViIjoiMTYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.PFUqMn5G0YRq0q3PH-8q8nLh47VUFaDvKpC04VQLUGE
DATA
{}

8.1.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/14/filterlists' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJZdVowNUVzcXNJU3pxQWlLIiwic3ViIjoiMTYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.PFUqMn5G0YRq0q3PH-8q8nLh47VUFaDvKpC04VQLUGE' \
    -d '{}'

8.1.3. Response Body

Path Type Description

data.*.isInclude

boolean

List is Include

data.*.filterList.id

integer

List Id

data.*.filterList.isActive

bool

on/off

data.*.filterList.userId

integer

User Id

data.*.filterList.title

string

List title

data.*.filterList.type

string

Filter list type: listDomains, listApps, listBundles, listDeviceIfas, listPublishers, listIpAdresses, listSiteAndAppIds, listUrls, listTags

data.*.filterList.isInclude

boolean

White/Black list

data.*.filterList.count

integer

Object count

data.*.filterList.createdAt

datetime

Date of creation

data.*.filterList.updatedAt

datetime

Date of last modification

meta.pagination.total

integer

Pagination: total items count

meta.pagination.count

integer

Pagination: page items count

meta.pagination.per_page

integer

Pagination: items per page

meta.pagination.current_page

integer

Pagination: current page number

meta.pagination.total_pages

integer

Pagination: total pages count

meta.pagination.links

array

Pagination: array links

8.1.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": [
        {
            "isInclude": true,
            "filterList": {
                "id": 1,
                "isActive": 0,
                "userId": 16,
                "title": "Test Filter list #1",
                "type": "domain",
                "isInclude": "White",
                "count": 1,
                "createdAt": "2024-07-23",
                "updatedAt": "2024-07-23"
            }
        },
        {
            "isInclude": true,
            "filterList": {
                "id": 2,
                "isActive": 0,
                "userId": 16,
                "title": "Test Filter list #2",
                "type": "ipAdresses",
                "isInclude": "White",
                "count": 1,
                "createdAt": "2024-07-23",
                "updatedAt": "2024-07-23"
            }
        },
        {
            "isInclude": true,
            "filterList": {
                "id": 3,
                "isActive": 0,
                "userId": 16,
                "title": "Test Filter list #3",
                "type": "urls",
                "isInclude": "White",
                "count": 1,
                "createdAt": "2024-07-23",
                "updatedAt": "2024-07-23"
            }
        }
    ],
    "meta": {
        "pagination": {
            "total": 3,
            "count": 3,
            "per_page": 1000,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

8.2. Replace Filter Lists assigned to Campaign

A `POST` request with Campaign Id in url will replace Filter Lists assigned to Campaign

8.2.1. Request Body

Path Type Description Required

items.*.id

integer

Filter list id

+

8.2.2. HTTP Request

URL

POST api/campaigns/15/filterlists HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJINkJPS3JQQnpCNFRCQTNvIiwic3ViIjoiMTciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.DeycZfGYU4mPPXsOfVY5SB2msZe7HTzHCRnSilsrlyU
DATA
{
    "items": [
        {
            "id": 4
        },
        {
            "id": 5
        }
    ]
}

8.2.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/15/filterlists' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJINkJPS3JQQnpCNFRCQTNvIiwic3ViIjoiMTciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.DeycZfGYU4mPPXsOfVY5SB2msZe7HTzHCRnSilsrlyU' \
    -d '{
    "items": [
        {
            "id": 4
        },
        {
            "id": 5
        }
    ]
}'

8.2.4. Response Body

Path Type Description

message

string

Result message

8.2.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Replaced."
}

8.3. Append Filter Lists assigned to Campaign

A `PATCH` request with Campaign Id in url will append Filter Lists assigned to Campaign

8.3.1. Request Body

Path Type Description Required

items.*.id

integer

Filter list id

+

items.*.isInclude

boolean

Filter list type: include or exclude

+

8.3.2. HTTP Request

URL

PATCH api/campaigns/16/filterlists HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJCUURkSTRtNVhxVXE0OFNIIiwic3ViIjoiMTgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.X5Pv2IvRU1Za5n_jKGfx2hJ92BbZSwRFRi4TzZAs-kE
DATA
{
    "items": [
        {
            "id": 7,
            "isInclude": true
        }
    ]
}

8.3.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/16/filterlists' -i -X PATCH \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJCUURkSTRtNVhxVXE0OFNIIiwic3ViIjoiMTgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.X5Pv2IvRU1Za5n_jKGfx2hJ92BbZSwRFRi4TzZAs-kE' \
    -d '{
    "items": [
        {
            "id": 7,
            "isInclude": true
        }
    ]
}'

8.3.4. Response Body

Path Type Description

message

string

Result message

8.3.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Appended."
}

8.4. Remove Filter Lists assigned to Campaign

A `DELETE` request with Campaign Id in url will remove Filter Lists assigned to Campaign

8.4.1. Request Body

Path Type Description Required

ids

array

List id to remove

+

8.4.2. HTTP Request

URL

DELETE api/campaigns/17/filterlists HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiI0T3IweTk5SW54eFUzVERWIiwic3ViIjoiMTkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.YJByFNsEo7tawoC0qftTpQvrU4k4NrZR3tT1uuyy5r8
Content-type: application/x-www-form-urlencoded
DATA
{
    "ids": [
        9
    ]
}

8.4.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaigns/17/filterlists' -i -X DELETE \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiI0T3IweTk5SW54eFUzVERWIiwic3ViIjoiMTkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.YJByFNsEo7tawoC0qftTpQvrU4k4NrZR3tT1uuyy5r8' \
                -H 'Content-type: application/x-www-form-urlencoded' \
    -d '{
    "ids": [
        9
    ]
}'

8.4.4. Response Body

Path Type Description

message

string

Result message

8.4.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "message": "Deleted."
}

9. Optimization Rule

9.1. Rule

A `GET` request will return a optimization rules

9.1.1. HTTP Request

URL

GET api/optimization-rule HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJyVjh6N3loMnNMazV0U29kIiwic3ViIjoiNDEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.o0lANTm9OjRM9q5vH4mmt7vA4HNsEdKDSH-qt-ZBC04
DATA
{}

9.1.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/optimization-rule' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJyVjh6N3loMnNMazV0U29kIiwic3ViIjoiNDEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.o0lANTm9OjRM9q5vH4mmt7vA4HNsEdKDSH-qt-ZBC04' \
    -d '{}'

9.1.3. Response Body

Path Type Description

data.*.id

integer

Id

data.*.userId

integer

User Id

data.*.ownerCampaignId

integer

Campaign id where it was created rule

data.*.name

string

Name

data.*.timeRange

string

type: last_day,last_3_days,last_week,last_month

data.*.then

string

type: whitelist_source,blacklist_source

data.*.targetFilterListId

integer

Filter list id

data.*.conditions

Array

Conditions

data.*.createdAt

datetime

Date of creation

data.*.updatedAt

datetime

Date of last modification

meta.pagination.total

integer

Pagination: total items count

meta.pagination.count

integer

Pagination: page items count

meta.pagination.per_page

integer

Pagination: items per page

meta.pagination.current_page

integer

Pagination: current page number

meta.pagination.total_pages

integer

Pagination: total pages count

meta.pagination.links

array

Pagination: array links

9.1.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": [
        {
            "id": 4,
            "userId": 41,
            "ownerCampaignId": 0,
            "name": "TEST Rule#1",
            "timeRange": "last_month",
            "then": "whitelist_source",
            "targetFilterListId": 1,
            "conditions": [],
            "createdAt": "2024-07-23T13:35:05.000000Z",
            "updatedAt": "2024-07-23T13:35:05.000000Z"
        }
    ],
    "meta": {
        "pagination": {
            "total": 1,
            "count": 1,
            "per_page": 15,
            "current_page": 1,
            "total_pages": 1,
            "links": []
        }
    }
}

9.2. Get rule by ID

A `GET` request will return a optimization rule

9.2.1. HTTP Request

URL

GET api/optimization-rule/5 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJwSG1XTktyOFUzMG5PT0xwIiwic3ViIjoiNDIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.T-tgaHneH_oLKvXq_Q3iN0uXsEb9sEbfeljj1V0BY_k
DATA
{}

9.2.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/optimization-rule/5' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJwSG1XTktyOFUzMG5PT0xwIiwic3ViIjoiNDIiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.T-tgaHneH_oLKvXq_Q3iN0uXsEb9sEbfeljj1V0BY_k' \
    -d '{}'

9.2.3. Response Body

Path Type Description

data.id

integer

Id

data.userId

integer

User Id

data.ownerCampaignId

integer

Campaign id where it was created rule

data.name

string

Name

data.timeRange

string

type: last_day,last_3_days,last_week,last_month

data.then

string

type: whitelist_source,blacklist_source

data.targetFilterListId

integer

Filter list id

data.conditions

Array

Conditions

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

9.2.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 5,
        "userId": 42,
        "ownerCampaignId": 0,
        "name": "TEST Rule#1",
        "timeRange": "last_day",
        "then": "blacklist_source",
        "targetFilterListId": 1,
        "conditions": [],
        "createdAt": "2024-07-23T13:35:05.000000Z",
        "updatedAt": "2024-07-23T13:35:05.000000Z"
    }
}

9.3. Create a rule

A `POST` request will return a optimization rule

9.3.1. Request Body

Path Type Description Required

name

string

Name

+

timeRange

string

type: (last_day,last_3_days,last_week,last_month)

+

then

string

type: (whitelist_source,blacklist_source)

+

targetFilterListId

integer

Filter list id

+

conditions.*.condition

string

Condition type: (when,and,or) first condition must be - when

+

conditions.*.action

string

Actions type: (ctr,clicks,winrate,impressions,dspSpend)

+

conditions.*.comparison

string

Comparison type: (>,<,=)

+

conditions.*.value

string

Value

+

9.3.2. HTTP Request

URL

POST api/optimization-rule HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJwZFRndFllVXNTckcxUHVKIiwic3ViIjoiNDMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0._1uQ7PJJiuU1APmPPoq48_UqCaahNM1FUJRbdltAD3Q
DATA
{
    "name": "Test",
    "timeRange": "last_day",
    "then": "blacklist_source",
    "targetFilterListId": 17,
    "conditions": [
        {
            "condition": "when",
            "action": "dspPrice",
            "comparison": ">",
            "value": "0.5"
        }
    ]
}

9.3.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/optimization-rule' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJwZFRndFllVXNTckcxUHVKIiwic3ViIjoiNDMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0._1uQ7PJJiuU1APmPPoq48_UqCaahNM1FUJRbdltAD3Q' \
    -d '{
    "name": "Test",
    "timeRange": "last_day",
    "then": "blacklist_source",
    "targetFilterListId": 17,
    "conditions": [
        {
            "condition": "when",
            "action": "dspPrice",
            "comparison": ">",
            "value": "0.5"
        }
    ]
}'

9.3.4. Response Body

Path Type Description

data.id

integer

Id

data.userId

integer

User Id

data.ownerCampaignId

integer

Campaign id where it was created rule

data.name

string

Name

data.timeRange

string

type: (last_day,last_3_days,last_week,last_month)

data.then

string

type: (whitelist_source,blacklist_source)

data.targetFilterListId

integer

Filter list id

data.conditions

Array

Conditions

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

9.3.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 6,
        "userId": 0,
        "ownerCampaignId": 0,
        "name": "Test",
        "timeRange": "last_day",
        "then": "blacklist_source",
        "targetFilterListId": 17,
        "conditions": [],
        "createdAt": "2024-07-23T13:35:05.000000Z",
        "updatedAt": "2024-07-23T13:35:05.000000Z"
    }
}

9.4. Rule update

A `PATCH` request will return a optimization rule

9.4.1. Request Body

Path Type Description Required

name

string

Name

+

timeRange

string

type: (last_day,last_3_days,last_week,last_month)

+

then

string

type: (whitelist_source,blacklist_source)

+

targetFilterListId

integer

Filter list id

+

conditions.*.condition

string

Condition type: (when,and,or) first condition must be - when

+

conditions.*.action

string

Actions type: (ctr,clicks,winrate,impressions,dspSpend)

+

conditions.*.comparison

string

Comparison type: (>,<,=)

+

conditions.*.value

string

Value

+

9.4.2. HTTP Request

URL

PUT api/optimization-rule/7 HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJ3a1NiSTlTYWNzd3U0RlZXIiwic3ViIjoiNDQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.dFq6nlAYgoE1qvKvNsxEbQqG8t6lrdBq33kQfmGrWwM
DATA
{
    "name": "Test#2",
    "timeRange": "last_week",
    "then": "whitelist_source",
    "targetFilterListId": 18,
    "conditions": [
        {
            "condition": "when",
            "action": "dspPrice",
            "comparison": "<",
            "value": "1"
        }
    ]
}

9.4.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/optimization-rule/7' -i -X PUT \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJ3a1NiSTlTYWNzd3U0RlZXIiwic3ViIjoiNDQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.dFq6nlAYgoE1qvKvNsxEbQqG8t6lrdBq33kQfmGrWwM' \
    -d '{
    "name": "Test#2",
    "timeRange": "last_week",
    "then": "whitelist_source",
    "targetFilterListId": 18,
    "conditions": [
        {
            "condition": "when",
            "action": "dspPrice",
            "comparison": "<",
            "value": "1"
        }
    ]
}'

9.4.4. Response Body

Path Type Description

data.id

integer

Id

data.userId

integer

User Id

data.ownerCampaignId

integer

Campaign id where it was created rule

data.name

string

Name

data.timeRange

string

type: (last_day,last_3_days,last_week,last_month)

data.then

string

type: (whitelist_source,blacklist_source)

data.targetFilterListId

integer

Filter list id

data.conditions

Array

Conditions

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

9.4.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 7,
        "userId": 44,
        "ownerCampaignId": 0,
        "name": "Test#2",
        "timeRange": "last_week",
        "then": "whitelist_source",
        "targetFilterListId": 18,
        "conditions": [],
        "createdAt": "2024-07-23T13:35:05.000000Z",
        "updatedAt": "2024-07-23T13:35:05.000000Z"
    }
}

9.5. Remove Rule assigned to Campaign

A `DELETE` request will delete a Optimization rule relation

9.5.1. HTTP Request

URL

DELETE api/optimization-rule/8 HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJkQ29weHIxNTJEMDBtckNoIiwic3ViIjoiNDUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.yEOafAmAhKsMGHGGjmO3B5Cy1tcdFvdFaGxmTLplWPg
Content-type: application/x-www-form-urlencoded
DATA
{}

9.5.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/optimization-rule/8' -i -X DELETE \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDUsImV4cCI6MTcyMTc0NTMwNSwibmJmIjoxNzIxNzQxNzA1LCJqdGkiOiJkQ29weHIxNTJEMDBtckNoIiwic3ViIjoiNDUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.yEOafAmAhKsMGHGGjmO3B5Cy1tcdFvdFaGxmTLplWPg' \
                -H 'Content-type: application/x-www-form-urlencoded' \
    -d '{}'

9.5.3. Response Body

Path Type Description

deleted

boolean

is deleted

9.5.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "deleted": true
}

10. Assign Optimization rules to Campaigns

10.1. Get Rule assigned to Campaign

A `GET` request will return a optimization rule relation

10.1.1. HTTP Request

URL

GET api/campaign/7/optimization-rule-relation HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJHRWJWUjg0bXdVNnBZWFRGIiwic3ViIjoiOSIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.e09AbILXTprNmFpHqStlBxVi8n4USUew6ucxvskK4QA
DATA
{}

10.1.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaign/7/optimization-rule-relation' -i -X GET \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJHRWJWUjg0bXdVNnBZWFRGIiwic3ViIjoiOSIsInBydiI6IjIzYmQ1Yzg5NDlmNjAwYWRiMzllNzAxYzQwMDg3MmRiN2E1OTc2ZjcifQ.e09AbILXTprNmFpHqStlBxVi8n4USUew6ucxvskK4QA' \
    -d '{}'

10.1.3. Response Body

Path Type Description

data.id

integer

Id

data.userId

integer

User Id

data.ownerCampaignId

integer

Campaign id where it was created rule

data.name

string

Name

data.timeRange

string

last_day

last_3_days

last_week

last_month

data.then

string

whitelist_source

blacklist_source

data.targetFilterListId

integer

Filter list id

data.conditions.*.condition

string

Condition (when

and

or) first condition must be - when

data.conditions.*.action

string

Actions (ctr

clicks

winrate

impressions

dspSpend)

data.conditions.*.comparison

string

Comparison types (>

<

=)

data.conditions.*.value

string

Value

data.createdAt

datetime

Date of creation

data.updatedAt

datetime

Date of last modification

10.1.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "data": {
        "id": 1,
        "userId": 9,
        "ownerCampaignId": 7,
        "name": "TEST Rule#1",
        "timeRange": "last_3_days",
        "then": "whitelist_source",
        "targetFilterListId": 1,
        "conditions": [
            {
                "condition": "when",
                "action": "ctr",
                "comparison": "<",
                "value": 1
            }
        ],
        "createdAt": "2024-07-23T13:35:02.000000Z",
        "updatedAt": "2024-07-23T13:35:02.000000Z"
    }
}

10.2. Replace Rule assigned to Campaign

A `POST` request will return a optimization rule relation

10.2.1. Request Body

Path Type Description Required

campaignId

integer

campaignId

+

ruleId

integer

ruleId

+

10.2.2. HTTP Request

URL

POST api/campaign/optimization-rule-relation HTTP/1.1

HEADER
Accept: application/json
Content-type: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJCcmNDNU5yVzQxNmVzNG1WIiwic3ViIjoiMTAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.ffYbeXscOE7jUJaD-DawN110rjjIl4flxfq3GBJOp7A
DATA
{
    "campaignId": 8,
    "ruleId": 2
}

10.2.3. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaign/optimization-rule-relation' -i -X POST \
            -H 'Accept: application/json' \
                -H 'Content-type: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJCcmNDNU5yVzQxNmVzNG1WIiwic3ViIjoiMTAiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.ffYbeXscOE7jUJaD-DawN110rjjIl4flxfq3GBJOp7A' \
    -d '{
    "campaignId": 8,
    "ruleId": 2
}'

10.2.4. Response Body

Path Type Description

campaignId

integer

campaignId

ruleId

integer

ruleId

10.2.5. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "campaignId": 0,
    "ruleId": 2
}

10.3. Remove Rule assigned to Campaign

A `DELETE` request will delete a Optimization rule relation

10.3.1. HTTP Request

URL

DELETE api/campaign/9/optimization-rule-relation HTTP/1.1

HEADER
Accept: application/json
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJ5SkZsUnJqZDllMlhQUEhSIiwic3ViIjoiMTEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.ufnQWZcuMTqe4yUXrJqfUByaOH_Al5RAloFxO_2_7w0
Content-type: application/x-www-form-urlencoded
DATA
{}

10.3.2. Curl request

$ curl 'http://dsp-api.smartyads.com:80/api/campaign/9/optimization-rule-relation' -i -X DELETE \
            -H 'Accept: application/json' \
                -H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0Ojk5MjMiLCJpYXQiOjE3MjE3NDE3MDIsImV4cCI6MTcyMTc0NTMwMiwibmJmIjoxNzIxNzQxNzAyLCJqdGkiOiJ5SkZsUnJqZDllMlhQUEhSIiwic3ViIjoiMTEiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.ufnQWZcuMTqe4yUXrJqfUByaOH_Al5RAloFxO_2_7w0' \
                -H 'Content-type: application/x-www-form-urlencoded' \
    -d '{}'

10.3.3. Response Body

Path Type Description

deleted

boolean

is deleted

10.3.4. HTTP Response

HTTP/1.0 200 OK
    Content-type: application/json
    Access-control-allow-origin: *
    X-ratelimit-limit: 500
    X-ratelimit-remaining: 499
{
    "deleted": true
}

Postman collection

Request validation list

Campaign.contentCategories
  • IAB1

  • IAB2

  • IAB3

  • IAB4

  • IAB5

  • IAB6

  • IAB7

  • IAB8

  • IAB9

  • IAB10

  • IAB11

  • IAB12

  • IAB13

  • IAB14

  • IAB15

  • IAB16

  • IAB17

  • IAB18

  • IAB19

  • IAB20

  • IAB21

  • IAB22

  • IAB23

    Campaign.connectionTypes
  • wifi

  • ethernet

  • cellular_all

  • cellular_all

  • cellular_3g

  • cellular_4g

Campaign.OS

  • 'Android',

  • 'Android 8.0',

  • 'Android 8.1',

  • 'Android 9.0',

  • 'Android 10.0',

  • 'Android 11.0',

  • 'Android 12.0',

  • 'Android 13.0',

  • 'Android 14.0',

  • 'iOS',

  • 'iOS 10.0',

  • 'iOS 10.1',

  • 'iOS 10.2',

  • 'iOS 10.3',

  • 'iOS 11.0',

  • 'iOS 11.1',

  • 'iOS 11.2',

  • 'iOS 11.3',

  • 'iOS 12.0',

  • 'iOS 12.1',

  • 'iOS 12.2',

  • 'iOS 12.3',

  • 'iOS 12.4',

  • 'iOS 13.1',

  • 'iOS 13.2',

  • 'iOS 13.3',

  • 'iOS 13.4',

  • 'iOS 13.5',

  • 'iOS 13.6',

  • 'iOS 14.0',

  • 'iOS 14.1',

  • 'iOS 14.2',

  • 'iOS 14.3',

  • 'iOS 14.4',

  • 'iOS 14.5',

  • 'iOS 14.6',

  • 'iOS 14.7',

  • 'iOS 14.8',

  • 'iOS 15.0',

  • 'iOS 15.1',

  • 'iOS 15.2',

  • 'iOS 15.3',

  • 'iOS 15.4',

  • 'iOS 15.5',

  • 'iOS 15.6',

  • 'iOS 15.7',

  • 'iOS 16.0',

  • 'iOS 16.1',

  • 'iOS 16.2',

  • 'iOS 16.3',

  • 'iOS 16.4',

  • 'Mac OS',

  • 'Mac OS 10.1',

  • 'Mac OS 10.2',

  • 'Mac OS 10.3',

  • 'Mac OS 10.4',

  • 'Mac OS 10.5',

  • 'Mac OS 10.6',

  • 'Mac OS 10.7',

  • 'Mac OS 10.8',

  • 'Mac OS 10.9',

  • 'Mac OS 10.10',

  • 'Mac OS 10.11',

  • 'Mac OS 10.12',

  • 'Mac OS 10.13',

  • 'Mac OS 10.14',

  • 'Mac OS 10.15',

  • 'Mac OS 11.0',

  • 'Mac OS 11.1',

  • 'Mac OS 11.2',

  • 'Mac OS 11.3',

  • 'Mac OS 11.4',

  • 'Mac OS 11.5',

  • 'Mac OS 11.6',

  • 'Mac OS 12.0',

  • 'Mac OS 12.1',

  • 'Mac OS 12.2',

  • 'Mac OS 12.3',

  • 'Mac OS 12.4',

  • 'Mac OS 12.5',

  • 'Mac OS 12.6',

  • 'Mac OS 13.0',

  • 'Mac OS 13.1',

  • 'Mac OS 13.2',

  • 'BlackBerry',

  • 'Linux',

  • 'Windows',

  • 'Windows 8.1',

  • 'Windows 10',

  • 'Windows 11',

  • 'Windows Mobile',

  • 'Symbian',

  • 'Symbian 9.1',

  • 'Symbian 9.2',

  • 'Symbian 9.3',

  • 'Symbian 9.4',

     Campaign.browser
    * 'Chrome',
    * 'Edge',
    * 'IE',
    * 'Safari',
    * 'Mozilla',
    * 'Opera',
    * 'UCBrowser',
    * 'Yandex',