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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0L2FwaS91c2Vycy9sb2dpbiIsImlhdCI6MTcxNTI2OTgyMywiZXhwIjoxNzE1MjczNDIzLCJuYmYiOjE3MTUyNjk4MjMsImp0aSI6IkZvamJGeVNyb3JBTmdPNWUiLCJzdWIiOiIyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.8615dW-SgKoie7hpN8XD1RmNgWrt1cJDttsOxW8do0U",
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODIzLCJleHAiOjE3MTUyNzM0MjMsIm5iZiI6MTcxNTI2OTgyMywianRpIjoibEpRNlIxMHl2NXZISm1LaSIsInN1YiI6IjMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qP1xor3QiVRWJ3IIY6hrU273bkhsN16UERk8ebbIn0o
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODIzLCJleHAiOjE3MTUyNzM0MjMsIm5iZiI6MTcxNTI2OTgyMywianRpIjoibEpRNlIxMHl2NXZISm1LaSIsInN1YiI6IjMiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qP1xor3QiVRWJ3IIY6hrU273bkhsN16UERk8ebbIn0o' \
    -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoiWW1QOWpyZWlrQ0ZtRzgxeiIsInN1YiI6IjQ2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.WgNwKe1Mhbc9mTKuSX1a4hendztQUCvPQ86M-pjL420
DATA
{
    "timezone": "Etc\/GMT+10",
    "from": "2024-05-07",
    "to": "2024-05-09",
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoiWW1QOWpyZWlrQ0ZtRzgxeiIsInN1YiI6IjQ2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.WgNwKe1Mhbc9mTKuSX1a4hendztQUCvPQ86M-pjL420' \
    -d '{
    "timezone": "Etc\/GMT+10",
    "from": "2024-05-07",
    "to": "2024-05-09",
    "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-05-09",
            "campaignId": 1,
            "campaignId_dict": "Rem libero| id# 1",
            "creativeId": 12,
            "creativeId_dict": "Est ut| id# 12",
            "bids": 476,
            "wins": 228,
            "impressions": 196,
            "dspSpend": 0.25983,
            "winrate": 47.89915966386555,
            "ecpm": 1.3256632653061224,
            "clicks": 8,
            "conversions": 15,
            "ctr": 4.081632653061225
        },
        {
            "YMD": "2024-05-09",
            "campaignId": 2,
            "campaignId_dict": "Est aliquam| id# 2",
            "creativeId": 11,
            "creativeId_dict": "Qui et| id# 11",
            "bids": 205,
            "wins": 101,
            "impressions": 90,
            "dspSpend": 0.32709,
            "winrate": 49.26829268292683,
            "ecpm": 3.634333333333333,
            "clicks": 25,
            "conversions": 39,
            "ctr": 27.77777777777778
        },
        {
            "YMD": "2024-05-09",
            "campaignId": 2,
            "campaignId_dict": "Dolores ipsam| id# 2",
            "creativeId": 12,
            "creativeId_dict": "Earum voluptatum| id# 12",
            "bids": 438,
            "wins": 279,
            "impressions": 250,
            "dspSpend": 0.45772,
            "winrate": 63.6986301369863,
            "ecpm": 1.83088,
            "clicks": 30,
            "conversions": 18,
            "ctr": 12
        },
        {
            "YMD": "2024-05-08",
            "campaignId": 1,
            "campaignId_dict": "Tempora corporis| id# 1",
            "creativeId": 11,
            "creativeId_dict": "Quo consequatur| id# 11",
            "bids": 877,
            "wins": 434,
            "impressions": 306,
            "dspSpend": 0.4512,
            "winrate": 49.48688711516534,
            "ecpm": 1.4745098039215685,
            "clicks": 16,
            "conversions": 49,
            "ctr": 5.228758169934641
        },
        {
            "YMD": "2024-05-09",
            "campaignId": 1,
            "campaignId_dict": "Quaerat velit| id# 1",
            "creativeId": 11,
            "creativeId_dict": "A fugiat| id# 11",
            "bids": 207,
            "wins": 129,
            "impressions": 113,
            "dspSpend": 0.4666,
            "winrate": 62.31884057971015,
            "ecpm": 4.129203539823009,
            "clicks": 15,
            "conversions": 4,
            "ctr": 13.274336283185841
        },
        {
            "YMD": "2024-05-08",
            "campaignId": 1,
            "campaignId_dict": "Quisquam quia| id# 1",
            "creativeId": 12,
            "creativeId_dict": "Architecto voluptas| id# 12",
            "bids": 589,
            "wins": 261,
            "impressions": 182,
            "dspSpend": 0.22134,
            "winrate": 44.31239388794567,
            "ecpm": 1.2161538461538461,
            "clicks": 3,
            "conversions": 49,
            "ctr": 1.6483516483516483
        },
        {
            "YMD": "2024-05-08",
            "campaignId": 2,
            "campaignId_dict": "Eos voluptas| id# 2",
            "creativeId": 11,
            "creativeId_dict": "Excepturi accusamus| id# 11",
            "bids": 718,
            "wins": 406,
            "impressions": 358,
            "dspSpend": 0.19564,
            "winrate": 56.54596100278552,
            "ecpm": 0.5464804469273743,
            "clicks": 42,
            "conversions": 26,
            "ctr": 11.731843575418994
        },
        {
            "YMD": "2024-05-08",
            "campaignId": 2,
            "campaignId_dict": "Et beatae| id# 2",
            "creativeId": 12,
            "creativeId_dict": "Dolor consequatur| id# 12",
            "bids": 828,
            "wins": 538,
            "impressions": 452,
            "dspSpend": 0.30047,
            "winrate": 64.97584541062803,
            "ecpm": 0.6647566371681417,
            "clicks": 33,
            "conversions": 13,
            "ctr": 7.300884955752212
        },
        {
            "YMD": "2024-05-07",
            "campaignId": 1,
            "campaignId_dict": "Aut ut| id# 1",
            "creativeId": 11,
            "creativeId_dict": "Voluptate amet| id# 11",
            "bids": 395,
            "wins": 198,
            "impressions": 166,
            "dspSpend": 0.42069,
            "winrate": 50.12658227848101,
            "ecpm": 2.5342771084337348,
            "clicks": 7,
            "conversions": 7,
            "ctr": 4.216867469879518
        },
        {
            "YMD": "2024-05-07",
            "campaignId": 1,
            "campaignId_dict": "Reiciendis labore| id# 1",
            "creativeId": 12,
            "creativeId_dict": "Nihil porro| id# 12",
            "bids": 559,
            "wins": 361,
            "impressions": 310,
            "dspSpend": 0.13373,
            "winrate": 64.57960644007156,
            "ecpm": 0.4313870967741935,
            "clicks": 49,
            "conversions": 31,
            "ctr": 15.806451612903226
        },
        {
            "YMD": "2024-05-07",
            "campaignId": 2,
            "campaignId_dict": "Accusantium non| id# 2",
            "creativeId": 11,
            "creativeId_dict": "Saepe et| id# 11",
            "bids": 580,
            "wins": 223,
            "impressions": 178,
            "dspSpend": 0.41033,
            "winrate": 38.44827586206897,
            "ecpm": 2.3052247191011235,
            "clicks": 25,
            "conversions": 3,
            "ctr": 14.044943820224718
        },
        {
            "YMD": "2024-05-07",
            "campaignId": 2,
            "campaignId_dict": "Quo aperiam| id# 2",
            "creativeId": 12,
            "creativeId_dict": "Molestiae aperiam| id# 12",
            "bids": 251,
            "wins": 114,
            "impressions": 98,
            "dspSpend": 0.19898,
            "winrate": 45.418326693227094,
            "ecpm": 2.030408163265306,
            "clicks": 42,
            "conversions": 38,
            "ctr": 42.857142857142854
        }
    ],
    "totals": {
        "YMD": "",
        "campaignId": 0,
        "campaignId_dict": "",
        "creativeId": 0,
        "creativeId_dict": "",
        "bids": 6123,
        "wins": 3272,
        "impressions": 2699,
        "dspSpend": 3.8436200000000005,
        "winrate": 53.089900146155166,
        "ecpm": 1.8436064966839796,
        "clicks": 295,
        "conversions": 292,
        "ctr": 13.33074923530272
    },
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoib3BBaE1tMThCQlVGZzVmciIsInN1YiI6IjQ3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.V3mVJv7w45Z-qHoHY-cyism-BBJ_AwEIuu67008SWdQ
DATA
{
    "timezone": "UTC",
    "from": "2024-05-07",
    "to": "2024-05-09",
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoib3BBaE1tMThCQlVGZzVmciIsInN1YiI6IjQ3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.V3mVJv7w45Z-qHoHY-cyism-BBJ_AwEIuu67008SWdQ' \
    -d '{
    "timezone": "UTC",
    "from": "2024-05-07",
    "to": "2024-05-09",
    "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-05-08",
            "campaignId": 1,
            "campaignId_dict": "Quis consequatur| id# 1",
            "creativeId": 10,
            "creativeId_dict": "Unde facilis| id# 10",
            "bids": 271,
            "wins": 110,
            "impressions": 80,
            "dspSpend": 0.43643,
            "winrate": 40.59040590405904,
            "ecpm": 5.455375,
            "clicks": 25,
            "conversions": 19,
            "ctr": 31.25
        },
        {
            "YMD": "2024-05-09",
            "campaignId": 1,
            "campaignId_dict": "Dolor maxime| id# 1",
            "creativeId": 10,
            "creativeId_dict": "Quo voluptatem| id# 10",
            "bids": 282,
            "wins": 170,
            "impressions": 119,
            "dspSpend": 0.27211,
            "winrate": 60.283687943262414,
            "ecpm": 2.286638655462185,
            "clicks": 21,
            "conversions": 0,
            "ctr": 17.647058823529413
        },
        {
            "YMD": "2024-05-07",
            "campaignId": 1,
            "campaignId_dict": "Et soluta| id# 1",
            "creativeId": 10,
            "creativeId_dict": "At laboriosam| id# 10",
            "bids": 586,
            "wins": 200,
            "impressions": 147,
            "dspSpend": 0.31614,
            "winrate": 34.129692832764505,
            "ecpm": 2.150612244897959,
            "clicks": 50,
            "conversions": 37,
            "ctr": 34.01360544217687
        }
    ],
    "totals": {
        "YMD": "",
        "campaignId": 0,
        "campaignId_dict": "",
        "creativeId": 0,
        "creativeId_dict": "",
        "bids": 1139,
        "wins": 480,
        "impressions": 346,
        "dspSpend": 1.02468,
        "winrate": 45.001262226695324,
        "ecpm": 3.297541966786715,
        "clicks": 96,
        "conversions": 56,
        "ctr": 27.636888088568764
    },
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiWW8xWk5MclE3ZG9za05UMCIsInN1YiI6IjQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.9oAaqfwQlj8suPVl7L0Iau75ukhYUIzvBKgfPV1KQOY
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiWW8xWk5MclE3ZG9za05UMCIsInN1YiI6IjQiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.9oAaqfwQlj8suPVl7L0Iau75ukhYUIzvBKgfPV1KQOY' \
    -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": true,
            "isRunning": false,
            "type": "banner",
            "name": "Facilis.",
            "isRewarded": false,
            "isDesktopWeb": false,
            "isMobileApp": false,
            "isMobileWeb": true,
            "isSmartphone": false,
            "isTablet": false,
            "isCTV": false,
            "isDOOH": true,
            "aDomain": "purdy.biz",
            "dateStart": "2023-09-24",
            "dateEnd": "2024-05-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": 160,
            "spentTotalLimit": 7009,
            "impressionsDailyLimit": 243761,
            "impressionsTotalLimit": 400000,
            "clicksDailyLimit": 0,
            "clicksTotalLimit": 0,
            "budgetUse": "fast",
            "allSources": true,
            "cpm": 0,
            "adaptiveCpm": false,
            "useCpm": false,
            "extendedStatus": "Low Balance",
            "createdAt": "2024-05-09",
            "updatedAt": "2024-05-09",
            "deletedAt": null
        },
        {
            "id": 2,
            "userId": 4,
            "isActive": false,
            "isRunning": false,
            "type": "video",
            "name": "Est.",
            "isRewarded": false,
            "isDesktopWeb": true,
            "isMobileApp": true,
            "isMobileWeb": true,
            "isSmartphone": false,
            "isTablet": false,
            "isCTV": false,
            "isDOOH": false,
            "aDomain": "rolfson.com",
            "dateStart": "2023-11-11",
            "dateEnd": "2024-05-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": 105,
            "spentTotalLimit": 7400,
            "impressionsDailyLimit": 235647,
            "impressionsTotalLimit": 400000,
            "clicksDailyLimit": 0,
            "clicksTotalLimit": 0,
            "budgetUse": "fast",
            "allSources": true,
            "cpm": 0,
            "adaptiveCpm": false,
            "useCpm": false,
            "extendedStatus": "Campaign is not active",
            "createdAt": "2024-05-09",
            "updatedAt": "2024-05-09",
            "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiU1BBRHExZzdOQk9sWXQzTiIsInN1YiI6IjUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qgELAqubjwItXoJYNRv-b-Lf0VPqyLLsRq0vABTMO44
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiU1BBRHExZzdOQk9sWXQzTiIsInN1YiI6IjUiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.qgELAqubjwItXoJYNRv-b-Lf0VPqyLLsRq0vABTMO44' \
    -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) - PUSH Campaigns

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period" "Frequency Period Type" - PUSH Campaigns

data.frequencyPeriod

integer

Frequency Period - PUSH Campaigns

data.frequencyPeriodType

string

Frequency Period Type (min, hour, day) - PUSH Campaigns

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": "audio",
        "name": "Test Campaign #1",
        "isRewarded": false,
        "isDesktopWeb": true,
        "isMobileApp": true,
        "isMobileWeb": true,
        "isSmartphone": false,
        "isTablet": true,
        "isCTV": true,
        "isDOOH": false,
        "aDomain": "goodwin.info",
        "dateStart": "2024-03-13",
        "dateEnd": "2024-08-23",
        "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": 179,
        "spentTotalLimit": 1194,
        "impressionsDailyLimit": 284242,
        "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",
        "frequencyCap": 0,
        "frequencyPeriod": 24,
        "frequencyPeriodType": "day",
        "extendedStatus": "Low Balance",
        "createdAt": "2024-05-09",
        "updatedAt": "2024-05-09",
        "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiMkJYbzJ1elU1ODRDTExlUiIsInN1YiI6IjYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.0Wu9fJWsw1TBg4qKIa9LUAsbLO081MOQ-8DRyp5WSaA
DATA
{
    "type": "banner",
    "name": "New Campaign #2",
    "aDomain": "stokes.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-04-04",
    "dateEnd": "2024-07-11"
}

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiMkJYbzJ1elU1ODRDTExlUiIsInN1YiI6IjYiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.0Wu9fJWsw1TBg4qKIa9LUAsbLO081MOQ-8DRyp5WSaA' \
    -d '{
    "type": "banner",
    "name": "New Campaign #2",
    "aDomain": "stokes.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-04-04",
    "dateEnd": "2024-07-11"
}'

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) - PUSH Campaigns

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period" "Frequency Period Type" - PUSH Campaigns

data.frequencyPeriod

integer

Frequency Period - PUSH Campaigns

data.frequencyPeriodType

string

Frequency Period Type (min, hour, day) - PUSH Campaigns

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": "stokes.com",
        "dateStart": "2024-04-04",
        "dateEnd": "2024-07-11",
        "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,
        "frequencyCap": 0,
        "frequencyPeriod": 0,
        "frequencyPeriodType": "day",
        "extendedStatus": "Campaign is not active",
        "createdAt": "2024-05-09",
        "updatedAt": "2024-05-09",
        "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoianU2N3VHb01UTVE0M29YUiIsInN1YiI6IjciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.722QVVtJxwkuzmvFTgP4Zv-iZqIJjazojWkKbyJEcWA
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoianU2N3VHb01UTVE0M29YUiIsInN1YiI6IjciLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.722QVVtJxwkuzmvFTgP4Zv-iZqIJjazojWkKbyJEcWA' \
    -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) - PUSH Campaigns

data.frequencyCap

integer

Show ads no more than "Frequency Cap" times in "Frequency Period" "Frequency Period Type" - PUSH Campaigns

data.frequencyPeriod

integer

Frequency Period - PUSH Campaigns

data.frequencyPeriodType

string

Frequency Period Type (min, hour, day) - PUSH Campaigns

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": true,
        "isDOOH": false,
        "aDomain": "sanford.com",
        "dateStart": "2023-06-09",
        "dateEnd": "2025-05-09",
        "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": 251,
        "spentTotalLimit": 1361,
        "impressionsDailyLimit": 255392,
        "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",
        "frequencyCap": 0,
        "frequencyPeriod": 24,
        "frequencyPeriodType": "day",
        "extendedStatus": "Campaign is not active",
        "createdAt": "2024-05-09",
        "updatedAt": "2024-05-09",
        "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiVU5RczF2ZVJwMDVGQVYzMyIsInN1YiI6IjgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.h7cofkLhDulXeuyzIrX05dSfzP7pxYnWr5sbSUnUbRw
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiVU5RczF2ZVJwMDVGQVYzMyIsInN1YiI6IjgiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.h7cofkLhDulXeuyzIrX05dSfzP7pxYnWr5sbSUnUbRw' \
                -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoibUd2ZVY3RDcydDBZZTZKUiIsInN1YiI6IjM3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.EzAuHCAg5Er77vUedoxykw5hqJxcJekRmSg2RQIxDrA
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoibUd2ZVY3RDcydDBZZTZKUiIsInN1YiI6IjM3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.EzAuHCAg5Er77vUedoxykw5hqJxcJekRmSg2RQIxDrA' \
    -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-05-09 15:51:01",
            "updatedAt": "2024-05-09 15:51:01"
        }
    ]
}

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoiaEg1YlpLSndNUDdJN2FmUSIsInN1YiI6IjM4IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.NgPSJOxSQDlRZen39ODLgk7uVOiHU6o2I3nqDkKVRBw
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoiaEg1YlpLSndNUDdJN2FmUSIsInN1YiI6IjM4IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.NgPSJOxSQDlRZen39ODLgk7uVOiHU6o2I3nqDkKVRBw' \
    -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-05-09 15:51:01",
            "updatedAt": "2024-05-09 15:51:01"
        }
    ]
}

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoiWmhNdHlmVkpXdGtReTZhUCIsInN1YiI6IjM5IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.0yOwGRp62_UvvWg4fd_QAgty-GruRKH-3n_x_7rwBWk
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoiWmhNdHlmVkpXdGtReTZhUCIsInN1YiI6IjM5IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.0yOwGRp62_UvvWg4fd_QAgty-GruRKH-3n_x_7rwBWk' \
    -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-05-09 15:51:01",
            "updatedAt": "2024-05-09 15:51:01"
        }
    ]
}

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoiRVNTUWJwQzdwdTQ2Nm95cyIsInN1YiI6IjQwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.uJcdMNIPm6uFPMKzoOKbuqhcSz8zQdtMFJshj_aJB98
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoiRVNTUWJwQzdwdTQ2Nm95cyIsInN1YiI6IjQwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.uJcdMNIPm6uFPMKzoOKbuqhcSz8zQdtMFJshj_aJB98' \
    -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": "1715269861_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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoialFXT2FCMDAwOXA0YzlvaCIsInN1YiI6IjIwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.TJC05VjOdSzkBjoPCfb9ljVV-XgiaOAbFDEtcp8ECx0
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoialFXT2FCMDAwOXA0YzlvaCIsInN1YiI6IjIwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.TJC05VjOdSzkBjoPCfb9ljVV-XgiaOAbFDEtcp8ECx0' \
    -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)

data.*.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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",
            "frequencyCap": 9,
            "bidPrice": "3.01",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "595 x 431",
            "weight": "0.25 MB",
            "folderId": null,
            "createdAt": "2024-05-09 00:00:00",
            "updatedAt": "2024-05-09 15:50:26",
            "pendingAt": "2024-05-09 00:00:00",
            "deletedAt": null,
            "media": {
                "id": 8,
                "userId": 20,
                "mediaType": "image",
                "originName": "image.jpg",
                "name": "20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                "extension": "jpg",
                "url": "http:\/\/pfeffer.net\/consequatur-saepe-quidem-aut-ad-quia-tenetur-vel.html20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                "width": 421,
                "height": 364,
                "weight": 257217
            },
            "relation": {
                "banner": {
                    "apiFramework": 0,
                    "admBody": "<a target=\"_blank\" href=\"http:\/\/www.bergstrom.org\/et-culpa-eius-tenetur\" ><img src=\"http:\/\/www.stehr.com\/\/10.jpg\"\/><\/a>",
                    "bannerType": "banner",
                    "clickUrl": "http:\/\/shields.com\/",
                    "width": 595,
                    "height": 431,
                    "childrenCreative": null,
                    "statusChildrenCreative": [],
                    "main": 1
                }
            }
        },
        {
            "id": 9,
            "userId": 20,
            "isActive": 0,
            "approved": "pending",
            "creativeType": "native",
            "name": "Native creative #1",
            "frequencyType": "user",
            "frequencyCap": 0,
            "bidPrice": "1.17",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "101 x 262",
            "weight": "0.00 MB",
            "folderId": null,
            "createdAt": "2024-05-09 00:00:00",
            "updatedAt": "2024-05-09 15:50:26",
            "pendingAt": "2024-05-09 00:00:00",
            "deletedAt": null,
            "media": {
                "id": 9,
                "userId": 20,
                "mediaType": "image",
                "originName": "image.jpg",
                "name": "20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                "extension": "jpg",
                "url": "https:\/\/www.keeling.com\/et-ratione-sit-sint-maiores-dolores-dolores-excepturi-repudiandae20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                "width": 246,
                "height": 208,
                "weight": 176781
            },
            "relation": {
                "native": {
                    "smallImageId": 9,
                    "largeImageId": 10,
                    "smallImage": {
                        "id": 9,
                        "folderId": null,
                        "userId": 20,
                        "width": 246,
                        "height": 208,
                        "name": "20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                        "url": "https:\/\/www.keeling.com\/et-ratione-sit-sint-maiores-dolores-dolores-excepturi-repudiandae20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                        "href": null,
                        "originName": "image.jpg",
                        "path": null,
                        "extension": "jpg",
                        "mediaType": "image",
                        "createdAt": "2024-05-09T15:50:26.000000Z",
                        "updatedAt": "2024-05-09T15:50:26.000000Z",
                        "deletedAt": null,
                        "weight": 176781
                    },
                    "largeImage": {
                        "id": 10,
                        "folderId": null,
                        "userId": 20,
                        "width": 101,
                        "height": 262,
                        "name": "20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                        "url": "https:\/\/swaniawski.com\/nobis-aliquam-quibusdam-dignissimos-nostrum-voluptas-suscipit-aut.html20_a3305c1b20ca7b0dc7cdca796da087fd.jpg",
                        "href": null,
                        "originName": "image.jpg",
                        "path": null,
                        "extension": "jpg",
                        "mediaType": "image",
                        "createdAt": "2024-05-09T15:50:26.000000Z",
                        "updatedAt": "2024-05-09T15:50:26.000000Z",
                        "deletedAt": null,
                        "weight": 175763
                    },
                    "assetDataDesc": "Id nihil et sit illum.",
                    "assetTitle": "Quia ut facere odio.",
                    "assetDataSponsored": "Quisquam earum itaque ducimus et perferendis.",
                    "assetCtaText": "Repellat qui nam enim.",
                    "clickUrl": "https:\/\/www.will.biz\/autem-autem-est-deserunt-maiores-quasi-quia-ad",
                    "displayUrl": "http:\/\/www.wilkinson.biz\/eos-alias-eum-qui-deleniti-quas-doloribus-distinctio-perferendis",
                    "impTracker": null
                }
            }
        },
        {
            "id": 10,
            "userId": 20,
            "isActive": 0,
            "approved": "pending",
            "creativeType": "video",
            "name": "Video creative #1",
            "frequencyType": "ip",
            "frequencyCap": 9,
            "bidPrice": "7.47",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "532 x 296",
            "weight": "0.36 MB",
            "folderId": null,
            "createdAt": "2024-05-09 00:00:00",
            "updatedAt": "2024-05-09 15:50:26",
            "pendingAt": "2024-05-09 00:00:00",
            "deletedAt": null,
            "media": {
                "id": 11,
                "userId": 20,
                "mediaType": "video",
                "originName": "video.mp4",
                "name": "20_a3305c1b20ca7b0dc7cdca796da087fd.mp4",
                "extension": "mp4",
                "url": "http:\/\/schamberger.com\/voluptatem-recusandae-quam-sapiente-rem-et-recusandae-eius20_a3305c1b20ca7b0dc7cdca796da087fd.mp4",
                "width": 455,
                "height": 446,
                "weight": 380626
            },
            "relation": {
                "video": {
                    "sizes": "x-large",
                    "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": 532,
                    "height": 296,
                    "duration": 7,
                    "clickUrl": "http:\/\/kessler.com\/",
                    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiQ21RbXFXTVVlOE1qUVJmayIsInN1YiI6IjIxIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.m-kOq3NhII7LnpHssXjFfpgqgrACjVklRlWcsVXHKPc
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiQ21RbXFXTVVlOE1qUVJmayIsInN1YiI6IjIxIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.m-kOq3NhII7LnpHssXjFfpgqgrACjVklRlWcsVXHKPc' \
    -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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": 0,
        "approved": "pending",
        "creativeType": "banner",
        "name": "Banner creative #2",
        "frequencyType": "ip",
        "frequencyCap": 1,
        "bidPrice": "6.99",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": "350 x 233",
        "weight": "0.39 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:27",
        "pendingAt": "2024-05-09 00:00:00",
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": 0,
                "admBody": "<a target=\"_blank\" href=\"http:\/\/www.dare.org\/rem-consequatur-placeat-sunt-blanditiis-a-labore-delectus\" ><img src=\"https:\/\/reinger.net\/aliquid-ipsum-sunt-maxime.html\/10.jpg\"\/><\/a>",
                "bannerType": "banner",
                "clickUrl": "http:\/\/cormier.info\/",
                "width": 350,
                "height": 233
            }
        }
    }
}

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiTno4SEVUbklKbnZ1WTV0cSIsInN1YiI6IjIyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.P8479rGRwYlGz73n2JObLtqtKEEdMndKDwxhn8nXTuI
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiTno4SEVUbklKbnZ1WTV0cSIsInN1YiI6IjIyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.P8479rGRwYlGz73n2JObLtqtKEEdMndKDwxhn8nXTuI' \
    -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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": "ip",
        "frequencyCap": 9,
        "bidPrice": "19.09",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": "209 x 374",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:27",
        "pendingAt": "2024-05-09 00:00:00",
        "deletedAt": null,
        "relation": {
            "native": {
                "smallImageId": 13,
                "largeImageId": 14,
                "smallImage": {
                    "id": 13,
                    "folderId": null,
                    "userId": 22,
                    "width": 493,
                    "height": 449,
                    "name": "22_00f55f26b047c4e3f2c867c642141c5b.jpg",
                    "url": "https:\/\/blanda.biz\/minus-ut-nemo-qui-voluptatem-et-blanditiis-cupiditate.html22_00f55f26b047c4e3f2c867c642141c5b.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-05-09T15:50:27.000000Z",
                    "updatedAt": "2024-05-09T15:50:27.000000Z",
                    "deletedAt": null,
                    "weight": 457146
                },
                "largeImage": {
                    "id": 14,
                    "folderId": null,
                    "userId": 22,
                    "width": 209,
                    "height": 374,
                    "name": "22_00f55f26b047c4e3f2c867c642141c5b.jpg",
                    "url": "http:\/\/www.hilpert.org\/22_00f55f26b047c4e3f2c867c642141c5b.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-05-09T15:50:27.000000Z",
                    "updatedAt": "2024-05-09T15:50:27.000000Z",
                    "deletedAt": null,
                    "weight": 317361
                },
                "assetDataDesc": "Qui corporis quo a.",
                "assetTitle": "Ut sit unde quis ut.",
                "assetDataSponsored": "Aut deleniti facilis placeat ullam qui.",
                "assetCtaText": "Ut aut ut tempora qui.",
                "clickUrl": "http:\/\/rempel.net\/",
                "displayUrl": "http:\/\/www.balistreri.com\/temporibus-ab-ab-impedit",
                "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiNEwzZllqdDNwNjVyRWhkbCIsInN1YiI6IjIzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.4sNyt_toyOPieTcYs8FV90z_bKjzR1R_Yog2F-8-C6M
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiNEwzZllqdDNwNjVyRWhkbCIsInN1YiI6IjIzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.4sNyt_toyOPieTcYs8FV90z_bKjzR1R_Yog2F-8-C6M' \
    -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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": 1,
        "approved": "pending",
        "creativeType": "video",
        "name": "Video creative #2",
        "frequencyType": "ip",
        "frequencyCap": 1,
        "bidPrice": "13.05",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": "676 x 397",
        "weight": "0.25 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:27",
        "pendingAt": "2024-05-09 00:00:00",
        "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": 676,
                "height": 397,
                "duration": 6,
                "clickUrl": "http:\/\/www.denesik.org\/nemo-officia-rerum-voluptas-accusantium-dolorum.html",
                "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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

+

frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

+

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiaU9heVhoNTh1bnFPU2lsOSIsInN1YiI6IjI0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.EvDokbpv9WXzXQIYuPu-c8oV5NpO4PrKiObQ8Une21E
DATA
{
    "name": "Banner creative #3",
    "creativeType": "banner",
    "frequencyType": "user",
    "frequencyCap": 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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiaU9heVhoNTh1bnFPU2lsOSIsInN1YiI6IjI0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.EvDokbpv9WXzXQIYuPu-c8oV5NpO4PrKiObQ8Une21E' \
    -d '{
    "name": "Banner creative #3",
    "creativeType": "banner",
    "frequencyType": "user",
    "frequencyCap": 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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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",
        "frequencyCap": 1,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "320 x 200",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:27",
        "pendingAt": "2024-05-09 00:00:00",
        "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

+

frequencyType

string

Identify the user to limit the number of the ad shows for the specific user (user, ip)

+

frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

+

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiRVJsU2xMOVBmTHlSUE5hVCIsInN1YiI6IjI1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.sjKGxzkg_UuLICRHWNf3QpqvTuwJ06k80qF5UxW4dFw
DATA
{
    "name": "Banner creative #4",
    "creativeType": "banner",
    "mediaId": 16,
    "frequencyType": "user",
    "frequencyCap": 1,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 0,
        "width": 320,
        "height": 200,
        "clickUrl": "https:\/\/kris.info\/reprehenderit-animi-earum-facere-enim.html"
    },
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI3LCJleHAiOjE3MTUyNzM0MjcsIm5iZiI6MTcxNTI2OTgyNywianRpIjoiRVJsU2xMOVBmTHlSUE5hVCIsInN1YiI6IjI1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.sjKGxzkg_UuLICRHWNf3QpqvTuwJ06k80qF5UxW4dFw' \
    -d '{
    "name": "Banner creative #4",
    "creativeType": "banner",
    "mediaId": 16,
    "frequencyType": "user",
    "frequencyCap": 1,
    "bidPrice": 0.5,
    "banner": {
        "apiFramework": 0,
        "width": 320,
        "height": 200,
        "clickUrl": "https:\/\/kris.info\/reprehenderit-animi-earum-facere-enim.html"
    },
    "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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": "user",
        "frequencyCap": 1,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "130 x 200",
        "weight": "0.15 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:58",
        "pendingAt": "2024-05-09 00:00:00",
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": 0,
                "admBody": "<a target=\"_blank\" href=\"https:\/\/kris.info\/reprehenderit-animi-earum-facere-enim.html\" ><img src=\"http:\/\/www.emard.org\/25_00f55f26b047c4e3f2c867c642141c5b.jpg\"\/><\/a>",
                "bannerType": null,
                "clickUrl": "https:\/\/kris.info\/reprehenderit-animi-earum-facere-enim.html",
                "width": 130,
                "height": 200
            }
        }
    }
}

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

+

frequencyType

string

Identify the user to limit the number of the ad shows for the specific user (user, ip)

+

frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

+

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU4LCJleHAiOjE3MTUyNzM0NTgsIm5iZiI6MTcxNTI2OTg1OCwianRpIjoiVlU3UWFocDZhNjJSR0VPWSIsInN1YiI6IjI2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.nQqbHHKR7GkmMVmzKUfXVL-EKfRY3X5y-Mk7fAHS_eM
DATA
{
    "name": "Banner creative #5",
    "creativeType": "banner",
    "mediaId": 17,
    "frequencyType": "user",
    "frequencyCap": 1,
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU4LCJleHAiOjE3MTUyNzM0NTgsIm5iZiI6MTcxNTI2OTg1OCwianRpIjoiVlU3UWFocDZhNjJSR0VPWSIsInN1YiI6IjI2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.nQqbHHKR7GkmMVmzKUfXVL-EKfRY3X5y-Mk7fAHS_eM' \
    -d '{
    "name": "Banner creative #5",
    "creativeType": "banner",
    "mediaId": 17,
    "frequencyType": "user",
    "frequencyCap": 1,
    "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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": "user",
        "frequencyCap": 1,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "320 x 200",
        "weight": "0.28 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:58",
        "pendingAt": "2024-05-09 00:00:00",
        "deletedAt": null,
        "relation": {
            "banner": {
                "apiFramework": 3,
                "admBody": "<iframe src=\"http:\/\/www.lakin.com\/dolorum-et-id-dolorem.html26_39e2d65e023dcdd8c9ffcaf2b1eb0217\/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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

+

frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

+

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU4LCJleHAiOjE3MTUyNzM0NTgsIm5iZiI6MTcxNTI2OTg1OCwianRpIjoib3kxcnVVSVpoNlp3d3M0MSIsInN1YiI6IjI3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.XBBzbSj9MmNQph5gx-vKB8-TZOGqPpBKfGa5i3GVBzI
DATA
{
    "name": "Native creative #3",
    "creativeType": "native",
    "frequencyType": "user",
    "frequencyCap": 1,
    "bidPrice": 0.5,
    "folderId": null,
    "native": {
        "smallImageId": 18,
        "largeImageId": 18,
        "assetDataDesc": "Voluptate quae.",
        "assetTitle": "Dolores.",
        "assetDataSponsored": "Autem ut qui a harum.",
        "assetCtaText": "Eum sint.",
        "clickUrl": "http:\/\/konopelski.org\/",
        "displayUrl": "http:\/\/www.bauch.com\/ab-molestias-eum-quos-aut-non-voluptas-voluptatem-magni"
    },
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU4LCJleHAiOjE3MTUyNzM0NTgsIm5iZiI6MTcxNTI2OTg1OCwianRpIjoib3kxcnVVSVpoNlp3d3M0MSIsInN1YiI6IjI3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.XBBzbSj9MmNQph5gx-vKB8-TZOGqPpBKfGa5i3GVBzI' \
    -d '{
    "name": "Native creative #3",
    "creativeType": "native",
    "frequencyType": "user",
    "frequencyCap": 1,
    "bidPrice": 0.5,
    "folderId": null,
    "native": {
        "smallImageId": 18,
        "largeImageId": 18,
        "assetDataDesc": "Voluptate quae.",
        "assetTitle": "Dolores.",
        "assetDataSponsored": "Autem ut qui a harum.",
        "assetCtaText": "Eum sint.",
        "clickUrl": "http:\/\/konopelski.org\/",
        "displayUrl": "http:\/\/www.bauch.com\/ab-molestias-eum-quos-aut-non-voluptas-voluptatem-magni"
    },
    "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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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",
        "frequencyCap": 1,
        "bidPrice": 0.5,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "319 x 423",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:58",
        "pendingAt": "2024-05-09 00:00:00",
        "deletedAt": null,
        "relation": {
            "native": {
                "smallImageId": 18,
                "largeImageId": 18,
                "smallImage": {
                    "id": 18,
                    "folderId": null,
                    "userId": 27,
                    "width": 319,
                    "height": 423,
                    "name": "27_39e2d65e023dcdd8c9ffcaf2b1eb0217.jpg",
                    "url": "http:\/\/turner.com\/quam-officiis-excepturi-qui-velit-voluptas-et-qui27_39e2d65e023dcdd8c9ffcaf2b1eb0217.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-05-09T15:50:58.000000Z",
                    "updatedAt": "2024-05-09T15:50:58.000000Z",
                    "deletedAt": null,
                    "weight": 237912
                },
                "largeImage": {
                    "id": 18,
                    "folderId": null,
                    "userId": 27,
                    "width": 319,
                    "height": 423,
                    "name": "27_39e2d65e023dcdd8c9ffcaf2b1eb0217.jpg",
                    "url": "http:\/\/turner.com\/quam-officiis-excepturi-qui-velit-voluptas-et-qui27_39e2d65e023dcdd8c9ffcaf2b1eb0217.jpg",
                    "href": null,
                    "originName": "image.jpg",
                    "path": null,
                    "extension": "jpg",
                    "mediaType": "image",
                    "createdAt": "2024-05-09T15:50:58.000000Z",
                    "updatedAt": "2024-05-09T15:50:58.000000Z",
                    "deletedAt": null,
                    "weight": 237912
                },
                "assetDataDesc": "Voluptate quae.",
                "assetTitle": "Dolores.",
                "assetDataSponsored": "Autem ut qui a harum.",
                "assetCtaText": "Eum sint.",
                "clickUrl": "https:\/\/konopelski.org\/",
                "displayUrl": "http:\/\/www.bauch.com\/ab-molestias-eum-quos-aut-non-voluptas-voluptatem-magni",
                "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

+

frequencyType

string

Identify the user to limit the number of the ad shows for the specific user (user, ip)

+

frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

+

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiV2lHZ3lkYkxNeVdXZW1PNyIsInN1YiI6IjI4IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.-CTvJlxTCm1U8i0QhLIRMn9tJd5G79Bg7VPLpCCrgbM
DATA
{
    "name": "Video creative #3",
    "creativeType": "video",
    "frequencyType": "user",
    "frequencyCap": 1,
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiV2lHZ3lkYkxNeVdXZW1PNyIsInN1YiI6IjI4IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.-CTvJlxTCm1U8i0QhLIRMn9tJd5G79Bg7VPLpCCrgbM' \
    -d '{
    "name": "Video creative #3",
    "creativeType": "video",
    "frequencyType": "user",
    "frequencyCap": 1,
    "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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": "user",
        "frequencyCap": 1,
        "bidPrice": 100,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "0 x 0",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:59",
        "pendingAt": "2024-05-09 00:00:00",
        "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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

+

frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

+

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiNDRDVDhWRTNuZkpSY1JWRyIsInN1YiI6IjI5IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.Kq51XCu-pR-gH-vAB9Mk0HIZfpMcH4QwPap46F_Iows
DATA
{
    "name": "Video creative #4",
    "creativeType": "video",
    "frequencyType": "user",
    "frequencyCap": 1,
    "mediaId": 19,
    "bidPrice": 100,
    "video": {
        "clickUrl": "http:\/\/www.thompson.com\/esse-optio-unde-dolorem-illo.html"
    },
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiNDRDVDhWRTNuZkpSY1JWRyIsInN1YiI6IjI5IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.Kq51XCu-pR-gH-vAB9Mk0HIZfpMcH4QwPap46F_Iows' \
    -d '{
    "name": "Video creative #4",
    "creativeType": "video",
    "frequencyType": "user",
    "frequencyCap": 1,
    "mediaId": 19,
    "bidPrice": 100,
    "video": {
        "clickUrl": "http:\/\/www.thompson.com\/esse-optio-unde-dolorem-illo.html"
    },
    "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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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",
        "frequencyCap": 1,
        "bidPrice": 100,
        "autoresize": null,
        "adaptiveCpm": null,
        "size": "422 x 189",
        "weight": "0.36 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:59",
        "pendingAt": "2024-05-09 00:00:00",
        "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:09<\/Duration>\n                    <VideoClicks>\n                        <ClickThrough><![CDATA[https:\/\/www.thompson.com\/esse-optio-unde-dolorem-illo.html]]><\/ClickThrough>\n                    <\/VideoClicks>\n                    <MediaFiles>\n                        <MediaFile delivery=\"\" type=\"video\/mp4\" width=\"422\" height=\"189\"><![CDATA[http:\/\/www.trantow.com\/magnam-et-maiores-quaerat-neque-ut-exercitationem-magni-tempora29_e7181ca6e5180a39ecd6aefae11b6626.mp4]]><\/MediaFile>\n                    <\/MediaFiles>\n                <\/Linear>\n            <\/Creative>\n        <\/Creatives>\n    <\/InLine>\n<\/Ad>\n<\/VAST>",
                "mimeType": [
                    "video\/mp4"
                ],
                "width": 422,
                "height": 189,
                "duration": 9,
                "clickUrl": "https:\/\/www.thompson.com\/esse-optio-unde-dolorem-illo.html",
                "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiaGVhQThDTUNwZGV1M1c0eiIsInN1YiI6IjMwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.K5YmJ8Oq5nwfBjCvEF5qPYL57bpFLyhgkgnNAZu57O4
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiaGVhQThDTUNwZGV1M1c0eiIsInN1YiI6IjMwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.K5YmJ8Oq5nwfBjCvEF5qPYL57bpFLyhgkgnNAZu57O4' \
    -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

Identify the user to limit the number of the ad shows for the specific user (user, ip)

data.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": "sequi atque",
        "frequencyType": "ip",
        "frequencyCap": 1,
        "bidPrice": "10.84",
        "autoresize": 0,
        "adaptiveCpm": false,
        "size": " x ",
        "weight": "0.00 MB",
        "folderId": null,
        "createdAt": "2024-05-09 00:00:00",
        "updatedAt": "2024-05-09 15:50:59",
        "pendingAt": "2024-05-09 00:00:00",
        "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiWkFTdVc5c3V5Zjd3NmUxYSIsInN1YiI6IjMxIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.OoJz4lHkFz6qIiQgCDY2xzYKiIAZjzKGR7dMMuQt7QQ
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiWkFTdVc5c3V5Zjd3NmUxYSIsInN1YiI6IjMxIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.OoJz4lHkFz6qIiQgCDY2xzYKiIAZjzKGR7dMMuQt7QQ' \
                -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiZDlzaEhJb2pWVG1MaXVzeiIsInN1YiI6IjEyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.Wyl0NTNrdHbx6YyuKMxFbevml5mt4E8mSEz2JjeYj3Y
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiZDlzaEhJb2pWVG1MaXVzeiIsInN1YiI6IjEyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.Wyl0NTNrdHbx6YyuKMxFbevml5mt4E8mSEz2JjeYj3Y' \
    -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)

data.*.frequencyCap

integer

Show ads no more than frequencyCap times in 24 hours

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": "user",
            "frequencyCap": 7,
            "bidPrice": "10.36",
            "autoresize": 0,
            "adaptiveCpm": false,
            "size": "689 x 139",
            "weight": "0.46 MB",
            "folderId": null,
            "createdAt": "2024-05-09 00:00:00",
            "updatedAt": "2024-05-09 15:50:25",
            "pendingAt": "2024-05-09 00:00:00",
            "deletedAt": null,
            "media": {
                "id": 1,
                "userId": 12,
                "mediaType": "image",
                "originName": "image.jpg",
                "name": "12_78386135b60bc7631c73ee3acdd27691.jpg",
                "extension": "jpg",
                "url": "http:\/\/www.hartmann.com\/excepturi-et-beatae-fugiat-et-dolor-ratione12_78386135b60bc7631c73ee3acdd27691.jpg",
                "width": 165,
                "height": 429,
                "weight": 480484
            },
            "relation": {
                "banner": {
                    "apiFramework": 0,
                    "admBody": "<a target=\"_blank\" href=\"http:\/\/yundt.com\/odit-magnam-ut-ipsam\" ><img src=\"http:\/\/www.fadel.net\/\/10.jpg\"\/><\/a>",
                    "bannerType": "banner",
                    "clickUrl": "https:\/\/price.org\/adipisci-totam-inventore-blanditiis-iste-suscipit.html",
                    "width": 689,
                    "height": 139,
                    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiODlQNWxtdTYzbUNPSFlNeiIsInN1YiI6IjEzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.1pwMU_2Ea9UC0UL78xd8lhnWxJDC9MJcrR0tMpu4ego
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiODlQNWxtdTYzbUNPSFlNeiIsInN1YiI6IjEzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.1pwMU_2Ea9UC0UL78xd8lhnWxJDC9MJcrR0tMpu4ego' \
    -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiaGw5ekpQTFc1S3BBRXBPcyIsInN1YiI6IjE0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.P7Rw1K7m4meUlJOaZZR25R7xTBuoMQfU1u_TLEsgTE8
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiaGw5ekpQTFc1S3BBRXBPcyIsInN1YiI6IjE0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.P7Rw1K7m4meUlJOaZZR25R7xTBuoMQfU1u_TLEsgTE8' \
    -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiaWR5WFBxYXJzTjZsZ3F4ZCIsInN1YiI6IjE1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.KkGBJAj0_g3FMyA0hhwWtA3pTuuLWV7ljanPe2wqZw0
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiaWR5WFBxYXJzTjZsZ3F4ZCIsInN1YiI6IjE1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.KkGBJAj0_g3FMyA0hhwWtA3pTuuLWV7ljanPe2wqZw0' \
                -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiMTNqSWk4M1VIcVFhUkg4TCIsInN1YiI6IjMyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.Lir4vD_9fqAsxltLbWhjcblh6AQSYJ2TR2C0fj0zTJk
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODU5LCJleHAiOjE3MTUyNzM0NTksIm5iZiI6MTcxNTI2OTg1OSwianRpIjoiMTNqSWk4M1VIcVFhUkg4TCIsInN1YiI6IjMyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.Lir4vD_9fqAsxltLbWhjcblh6AQSYJ2TR2C0fj0zTJk' \
    -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

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-05-09",
            "updatedAt": "2024-05-09"
        },
        {
            "id": 11,
            "isActive": 0,
            "userId": 32,
            "title": "Test Filter list #2",
            "type": "ipAdresses",
            "isInclude": "White",
            "count": 2,
            "createdAt": "2024-05-09",
            "updatedAt": "2024-05-09"
        },
        {
            "id": 12,
            "isActive": 0,
            "userId": 32,
            "title": "Test Filter list #3",
            "type": "urls",
            "isInclude": "White",
            "count": 3,
            "createdAt": "2024-05-09",
            "updatedAt": "2024-05-09"
        }
    ],
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoiRHhyVWVmZUlIaWs3OVZCdCIsInN1YiI6IjMzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.HwIT72npzDomE9Ztnl8SnsgEcbNfuK3hKdx8_yGjaoo
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoiRHhyVWVmZUlIaWs3OVZCdCIsInN1YiI6IjMzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.HwIT72npzDomE9Ztnl8SnsgEcbNfuK3hKdx8_yGjaoo' \
    -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

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-05-09",
        "updatedAt": "2024-05-09",
        "items": [
            "hegmann.com",
            "mckenzie.info",
            "rippin.com",
            "willms.com",
            "wisozk.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

+

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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoiR0FSZW1WOEtNUXhOeGVvaCIsInN1YiI6IjM0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.uxTLFYFyxhP7RVdk9ECO4n9AJyo0AeN6P3q92O-PRoc
DATA
{
    "title": "Test Filter list #5",
    "type": "ipAdresses",
    "isInclude": true,
    "items": [
        "78.118.204.45",
        "9.29.186.248",
        "181.237.238.55",
        "250.7.200.240",
        "211.76.120.135"
    ],
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoiR0FSZW1WOEtNUXhOeGVvaCIsInN1YiI6IjM0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.uxTLFYFyxhP7RVdk9ECO4n9AJyo0AeN6P3q92O-PRoc' \
    -d '{
    "title": "Test Filter list #5",
    "type": "ipAdresses",
    "isInclude": true,
    "items": [
        "78.118.204.45",
        "9.29.186.248",
        "181.237.238.55",
        "250.7.200.240",
        "211.76.120.135"
    ],
    "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

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-05-09",
        "updatedAt": "2024-05-09",
        "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoidkJMUWtWSmlmaXZsbnlHYiIsInN1YiI6IjM1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.rJqWD-4HSPB9dgws0PQ-BOvCwgydY9XK_8WjF7osEso
DATA
{
    "title": "Test FilterList #7",
    "isInclude": true,
    "items": [
        "http:\/\/weimann.org\/vel-est-modi-voluptatem-illum-modi-ut-et-dolor.html",
        "http:\/\/www.auer.com\/et-molestias-consequatur-tempora-facere-eum",
        "https:\/\/mraz.com\/et-sed-aut-dolorum-alias.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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoidkJMUWtWSmlmaXZsbnlHYiIsInN1YiI6IjM1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.rJqWD-4HSPB9dgws0PQ-BOvCwgydY9XK_8WjF7osEso' \
    -d '{
    "title": "Test FilterList #7",
    "isInclude": true,
    "items": [
        "http:\/\/weimann.org\/vel-est-modi-voluptatem-illum-modi-ut-et-dolor.html",
        "http:\/\/www.auer.com\/et-molestias-consequatur-tempora-facere-eum",
        "https:\/\/mraz.com\/et-sed-aut-dolorum-alias.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

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-05-09",
        "updatedAt": "2024-05-09",
        "items": [
            "http:\/\/willms.com\/",
            "http:\/\/www.emard.org\/debitis-maiores-recusandae-minima-eum"
        ],
        "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoiTWVnTXc2bkpydEs0WEp1WCIsInN1YiI6IjM2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.-_CpJXtUEMaFe1D2CdytUW7svh4UUMsdzyo7bQVdS4c
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYwLCJleHAiOjE3MTUyNzM0NjAsIm5iZiI6MTcxNTI2OTg2MCwianRpIjoiTWVnTXc2bkpydEs0WEp1WCIsInN1YiI6IjM2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.-_CpJXtUEMaFe1D2CdytUW7svh4UUMsdzyo7bQVdS4c' \
                -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoicnIyQk1neE5MQnNpRHZ1eCIsInN1YiI6IjE2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.cAWeW2QLChH2FeC-t3TP98_gziAQGzEaP71cZDDToSQ
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoicnIyQk1neE5MQnNpRHZ1eCIsInN1YiI6IjE2IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.cAWeW2QLChH2FeC-t3TP98_gziAQGzEaP71cZDDToSQ' \
    -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

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-05-09",
                "updatedAt": "2024-05-09"
            }
        },
        {
            "isInclude": true,
            "filterList": {
                "id": 2,
                "isActive": 0,
                "userId": 16,
                "title": "Test Filter list #2",
                "type": "ipAdresses",
                "isInclude": "White",
                "count": 1,
                "createdAt": "2024-05-09",
                "updatedAt": "2024-05-09"
            }
        },
        {
            "isInclude": true,
            "filterList": {
                "id": 3,
                "isActive": 0,
                "userId": 16,
                "title": "Test Filter list #3",
                "type": "urls",
                "isInclude": "White",
                "count": 1,
                "createdAt": "2024-05-09",
                "updatedAt": "2024-05-09"
            }
        }
    ],
    "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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoiejdFNEI4YUhxbzNKTzRFSSIsInN1YiI6IjE3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.a28r15WQqk-w1lP009GlP5chnU-yGtaIXRimFV8mV4M
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoiejdFNEI4YUhxbzNKTzRFSSIsInN1YiI6IjE3IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.a28r15WQqk-w1lP009GlP5chnU-yGtaIXRimFV8mV4M' \
    -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoiVVhnT0Q0ZXlPSjVyaG1iWSIsInN1YiI6IjE4IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.n4N5mN2pVNAX3jvWDyD7UWTfdGEjFE2PPdRGGoCT-FA
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoiVVhnT0Q0ZXlPSjVyaG1iWSIsInN1YiI6IjE4IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.n4N5mN2pVNAX3jvWDyD7UWTfdGEjFE2PPdRGGoCT-FA' \
    -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoiOWZwRUNsVWZlelgyazNQbSIsInN1YiI6IjE5IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.l8ci3qNRDmR4eYVPbmYoTzFAGswkQh_in2JYJGjvyzA
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI2LCJleHAiOjE3MTUyNzM0MjYsIm5iZiI6MTcxNTI2OTgyNiwianRpIjoiOWZwRUNsVWZlelgyazNQbSIsInN1YiI6IjE5IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.l8ci3qNRDmR4eYVPbmYoTzFAGswkQh_in2JYJGjvyzA' \
                -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoibUFUSnZBMVN0emRlNDlXbSIsInN1YiI6IjQxIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.l8_hJv5Sw4oR0_jxZ8aJRU_Birx_sVvb2g7bejdvhaI
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYxLCJleHAiOjE3MTUyNzM0NjEsIm5iZiI6MTcxNTI2OTg2MSwianRpIjoibUFUSnZBMVN0emRlNDlXbSIsInN1YiI6IjQxIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.l8_hJv5Sw4oR0_jxZ8aJRU_Birx_sVvb2g7bejdvhaI' \
    -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_3_days",
            "then": "blacklist_source",
            "targetFilterListId": 1,
            "conditions": [],
            "createdAt": "2024-05-09T15:51:01.000000Z",
            "updatedAt": "2024-05-09T15:51:01.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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoiMHhxUllBOEkwbmhNcjMwMCIsInN1YiI6IjQyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.FKQdNWBXgr9nBKXH-1-1rIVEyXFxn3bobr9bLR7t4Uc
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoiMHhxUllBOEkwbmhNcjMwMCIsInN1YiI6IjQyIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.FKQdNWBXgr9nBKXH-1-1rIVEyXFxn3bobr9bLR7t4Uc' \
    -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": "whitelist_source",
        "targetFilterListId": 1,
        "conditions": [],
        "createdAt": "2024-05-09T15:51:02.000000Z",
        "updatedAt": "2024-05-09T15:51:02.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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoieFRKdU8yb0pQVkJ3dTR0NSIsInN1YiI6IjQzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.OHvskwe9QG40ZVIx7hQyG80DP6f6tc5oeDpJIul301k
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoieFRKdU8yb0pQVkJ3dTR0NSIsInN1YiI6IjQzIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.OHvskwe9QG40ZVIx7hQyG80DP6f6tc5oeDpJIul301k' \
    -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-05-09T15:51:02.000000Z",
        "updatedAt": "2024-05-09T15:51:02.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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoia0FsSTRlNmRlRWdybHVtYSIsInN1YiI6IjQ0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.vAdFHCQEnwPwLp33Ruz_REWnjc0SL1aF__mMA3w2tr8
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoia0FsSTRlNmRlRWdybHVtYSIsInN1YiI6IjQ0IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.vAdFHCQEnwPwLp33Ruz_REWnjc0SL1aF__mMA3w2tr8' \
    -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-05-09T15:51:02.000000Z",
        "updatedAt": "2024-05-09T15:51:02.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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoidFZFUmxDbVBSQW5tMVlhTiIsInN1YiI6IjQ1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.vHMyNKFC2Y_k0g-AS9g8jHxbY4KCNIwSENPFqqj1sxE
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODYyLCJleHAiOjE3MTUyNzM0NjIsIm5iZiI6MTcxNTI2OTg2MiwianRpIjoidFZFUmxDbVBSQW5tMVlhTiIsInN1YiI6IjQ1IiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.vHMyNKFC2Y_k0g-AS9g8jHxbY4KCNIwSENPFqqj1sxE' \
                -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiVEJkNEFQaHdncllXZzN5aiIsInN1YiI6IjkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.cS3Svgk0WqzhCQv7YUJ0W_KzpS4dzBrCWrecPm4lAwo
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI0LCJleHAiOjE3MTUyNzM0MjQsIm5iZiI6MTcxNTI2OTgyNCwianRpIjoiVEJkNEFQaHdncllXZzN5aiIsInN1YiI6IjkiLCJwcnYiOiIyM2JkNWM4OTQ5ZjYwMGFkYjM5ZTcwMWM0MDA4NzJkYjdhNTk3NmY3In0.cS3Svgk0WqzhCQv7YUJ0W_KzpS4dzBrCWrecPm4lAwo' \
    -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_week",
        "then": "whitelist_source",
        "targetFilterListId": 1,
        "conditions": [
            {
                "condition": "and",
                "action": "clicks",
                "comparison": "=",
                "value": 1
            }
        ],
        "createdAt": "2024-05-09T15:50:24.000000Z",
        "updatedAt": "2024-05-09T15:50:24.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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiYk5iTmFZVVZWRUZNcURtVSIsInN1YiI6IjEwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.YITt854IrmZgdphDbgP0TZDbHtBShrZtETG65wIeW2Y
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiYk5iTmFZVVZWRUZNcURtVSIsInN1YiI6IjEwIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.YITt854IrmZgdphDbgP0TZDbHtBShrZtETG65wIeW2Y' \
    -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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiOER0d3RrMWZwdkZsNVJRUCIsInN1YiI6IjExIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.q3VTlUrHYqkEHebaBWfR4g20yaLcvjsx-oCQx5J5DJE
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.eyJpc3MiOiJodHRwOi8vbG9jYWxob3N0IiwiaWF0IjoxNzE1MjY5ODI1LCJleHAiOjE3MTUyNzM0MjUsIm5iZiI6MTcxNTI2OTgyNSwianRpIjoiOER0d3RrMWZwdkZsNVJRUCIsInN1YiI6IjExIiwicHJ2IjoiMjNiZDVjODk0OWY2MDBhZGIzOWU3MDFjNDAwODcyZGI3YTU5NzZmNyJ9.q3VTlUrHYqkEHebaBWfR4g20yaLcvjsx-oCQx5J5DJE' \
                -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',