curl --request GET \
--url https://api-v2.adrop.io/request \
--header 'Authorization: <authorization>'{
"code": 0,
"msg": "OK",
"result": {
"id": "ad_123456",
"format": "banner",
"type": "display",
"unit": "YOUR_UNIT_ID",
"w": 320,
"h": 100,
"ad": "<div>...</div>",
"target": "external",
"carouselActivated": false
}
}
REST API를 사용하여 배너 광고를 요청하는 방법을 안내합니다.
curl --request GET \
--url https://api-v2.adrop.io/request \
--header 'Authorization: <authorization>'{
"code": 0,
"msg": "OK",
"result": {
"id": "ad_123456",
"format": "banner",
"type": "display",
"unit": "YOUR_UNIT_ID",
"w": 320,
"h": 100,
"ad": "<div>...</div>",
"target": "external",
"carouselActivated": false
}
}
android, ios, web 중 하나ko_KR, en_USlight 또는 dark0은 성공을 의미합니다.{
"code": 0,
"msg": "OK",
"result": {
"id": "ad_123456",
"format": "banner",
"type": "display",
"unit": "YOUR_UNIT_ID",
"w": 320,
"h": 100,
"ad": "<div>...</div>",
"target": "external",
"carouselActivated": false
}
}
<div id="ad-container"></div>
<script>
fetch('https://api-v2.adrop.io/request?unit=YOUR_UNIT_ID&uid=USER_ID&pf=web', {
headers: { 'Authorization': 'YOUR_APP_KEY' }
})
.then(res => res.json())
.then(data => {
if (data.code === 0) {
document.getElementById('ad-container').innerHTML = data.result.ad;
}
});
</script>
<script src="https://storage.adrop.io/js/adrop-carousel-1.0.1.min.js"></script>
이 페이지가 도움이 되었나요?