Display banner using API

Step 1: Request Ad

GET /request

You can display banners using the ad of result field in the received data from the response. Since the banner 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

w

INT

YES

Width

h

INT

YES

Height

ad

STRING

YES


Example

GET /request?unit=TEST_UNIT_ID&uid=UNIQUE_USER_ID&pf=android&lcl=en_US HTTP/1.1
Host: api-rest.adrop.io
Authorization: TEST_APP_KEY
{
    "code": 0,
    "msg": "OK",
    "result": {
        "format": "banner",
        "unit": "TEST_UNIT_ID",    
        "w": 375,
        "h": 80,
        "ad": "...",
    }
}

Last updated