Display native ad using API

Step 1: Request Ad

GET /request

You can display native ad using the ad of result field in the received data from the response. Since the native ad is returned in HTML format, you can directly render it in web projects. In other platforms, you can utilize a WebView.

Please refer to the REST API.

Parameters:

NameTypeMandatoryDescription

unit

STRING

YES

Ad unit ID

uid

STRING

Recommended

Provide a value to uniquely identify the user.

pf

STRING

Recommended

lcl

STRING

Recommended

Response:

NameTypeMandatoryDescription

code

INT

YES

msg

STRING

YES

result

STRING

YES

Ad data

NameTypeMandatoryDescription

format

STRING

YES

unit

STRING

YES

Ad unit ID

ad

STRING

YES

w

INT

YES

Width

h

INT

YES

Height

advertiser

STRING

NO

Advertiser Name

icon

URL

NO

Advertiser Icon

cover

URL

NO

Advertiser Cover

advertiserURL

URL

NO

Advertiser URL

headline

STRING

NO

Headline text

body

STRING

NO

Body text

callToAction

STRING

NO

Action button text

destinationURL

URL

NO

Destination URL

accountTag

JSON

NO

Account tag data added by publisher

creativeTag

JSON

NO

Creative tag data added by publisher


Example

Please replace your Unit ID. You can also use test_unit_id instead of your own.

GET /request?unit={unit_id}&uid={user_id}&pf={platform}&lcl={locale} HTTP/1.1
Host: api-rest.adrop.io
Authorization: {app_key}
{
    "code": 0,
    "msg": "OK",
    "result": {
        "format": "nativeAd",
        "unit": "unit_id",    
        "ad": "...",
        "advertiser": "..."
    }
}

Last updated