{"__v":7,"_id":"56477347c7687d0d00739fba","category":{"__v":26,"_id":"564dcf87d3320b0d0028ca10","pages":["564dcfb4d3320b0d0028ca11","564dd25da8671617004e7b71","564dd3a7e39c4435005a1f33","564ddbcbd3320b0d0028ca25","564ddcb2a8671617004e7b8e","564ddfffa8671617004e7b94","564de165a8671617004e7b97","564de17d9176e9170068007b","564de194e39c4435005a1f56","564de3d99176e9170068007e","564de439fe07a81700b5c3af","564ef3911e9a082b00344ea1","564f03dfedbade0d000efa57","564f0978234efc0d006e186e","564f0d9aaf8ae235002db90e","564f133e4f000617007bd68e","564f14d829338a1700beefcd","564f15619eb2701700532470","564f2fec6b10960d00865761","564f302b6b10960d00865764","564f33e219857f2b00387a44","564f35d110b21d3500ad29d3","564f42e41af2c835004bfbe9","564f456ab85ee335004cbdb3","5652e161b83d8e0d00d24b6b","56859949cfc7cf0d001cb3f5"],"project":"564621e00c30fb2100ba3814","version":"564621e10c30fb2100ba3817","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-11-19T13:32:55.176Z","from_sync":false,"order":6,"slug":"api-overview","title":"Ad Request API"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"564621e00c30fb2100ba3814","user":"564621d275c83f0d00e9d52d","version":{"__v":14,"_id":"564621e10c30fb2100ba3817","project":"564621e00c30fb2100ba3814","createdAt":"2015-11-13T17:46:09.275Z","releaseDate":"2015-11-13T17:46:09.275Z","categories":["564621e10c30fb2100ba3818","564624cf0c30fb2100ba3822","564628d69f3f550d00fa3db6","564dafeeda00e82b00ed601d","564daff8fc36dc3700882b95","564db0ccda00e82b00ed601f","564dcf87d3320b0d0028ca10","5661a6e436398e0d00f79566","568585153703ed1700e420b0","56858767d96a760d00545da6","56858d693703ed1700e420b2","56858d8d22c41b0d00e4666c","56859e9c009a8d0d00797130","5685a6453703ed1700e420d3"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-14T17:45:43.774Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"Complete Interstitial Request","language":"curl","code":"curl \"http://my.mobfox.com/request.php?rt=api&r_type=banner&i=69.197.148.18&s=267d72ac3f77a3f447b32cf7ebf20673&imp_instl=1&adspace_width=320&adspace_height=480&adspace_strict=1&o_iosadvid=1976F519-26D0-4428-9891-3133253A453F&r_floor=0.8&longitude=12.12&latitude=280.12&demo_gender=male&demo_age=1982&demo_keywords=sports&u=Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%208_0%20like%20Mac%20OS%20X)%20AppleWebKit%2F600.1.3%20(KHTML%2C%20like%20Gecko)%20Version%2F8.0%20Mobile%2F12A4345d%20Safari%2F600.1.4&r_resp=xml\"\n\n# Replace the value of s= with your own inventory hash once you are ready for live ads"}]},"method":"get","results":{"codes":[{"name":"Interstitial (XML)","code":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<request type=\"textAd\">\n   <htmlString><![CDATA[<a href=\"http://my.mobfox.com/exchange.click.php?h=987f8c064fca63bef0bdb1cedbf124f7\" target=\"_self\"><img src=\"http://creative2cdn.mobfox.com/2286dc850031ff1d51ad381b5c59ae27.gif\" border=\"0\"/></a><img style=\"position:absolute; left: -10000px;\" width=\"1\" height=\"1\" src=\"http://my.mobfox.com/rtb.impression.pixel.php?rid=5442bea06c81e8175d42b564ccb9b639&price=1.984\"/><img style=\"position:absolute; left: -10000px;\" width=\"1\" height=\"1\" src=\"http://my.mobfox.com/exchange.pixel.php?h=987f8c064fca63bef0bdb1cedbf124f7\"/><script type=\"text/javascript\">document.write('<img style=\"position:absolute; left: -10000px;\" width=\"1\" height=\"1\" src=\"http://my.mobfox.com/exchange.pixel.php?h=987f8c064fca63bef0bdb1cedbf124f7&test=1\"/>');</script>]]></htmlString>\n   <clicktype>safari</clicktype>\n   <clickurl><![CDATA[http://my.mobfox.com/exchange.click.php?h=987f8c064fca63bef0bdb1cedbf124f7]]></clickurl>\n   <urltype>link</urltype>\n   <refresh>30</refresh>\n   <scale>no</scale>\n   <skippreflight>yes</skippreflight>\n   <demandPartner>\n     <id>6</id>\n     <name><![CDATA[MobFox DSP]]></name>\n  </demandPartner>\n</request>","language":"xml","status":200},{"name":"Interstitial (JSON)","status":200,"language":"json","code":"{\n  \"request\": {\n    \"type\": \"textAd\",\n    \"htmlString\": \"<!DOCTYPE html><html lang=\\\"en\\\"><head><meta charset=\\\"UTF-8\\\"><title></title><style>body{margin:0;padding:0}#mobfoxCover{background:0 0;margin:0;padding:0;border:none;position:absolute;left:0;top:0;z-index:100}</style></head><body><div id=\\\"mobfoxCover\\\"></div><script type=\\\"text/javascript\\\">function checkRedirect(e){return function(){if(state===REDIRECT){state=REDUNDANT;var t=window.document.querySelector(\\\"iframe\\\").contentDocument.querySelector(\\\"html\\\").innerHTML.toLowerCase();if(!(t.indexOf(\\\"<script\\\")<0&&t.indexOf(\\\"<iframe\\\")<0)){var o=new XMLHttpRequest,d={creativeId:creativeId,advertiserId:advertiserId,hParam:hParam,dspId:dspId,networkId:networkId,autoPilotInventoryConfId:autoPilotInventoryConfId,stackItemId:stackItemId,adSpaceId:adSpaceId,cId:cId,adomain:adomain,geo:geo,event:e,ua:window.navigator.userAgent,adId:adId,site:window.location.href,md5Hash:md5Hash,snapshot:btoa(unescape(encodeURIComponent(t)))};o.open(\\\"POST\\\",\\\"http://my.mobfox.com/fraud-integration\\\",!1),o.setRequestHeader(\\\"Content-type\\\",\\\"application/json\\\"),o.send(JSON.stringify(d))}}}}function init(){window.onbeforeunload=checkRedirect(\\\"onbeforeunload\\\"),window.addEventListener(\\\"beforeunload\\\",checkRedirect(\\\"beforeunload\\\")),window.addEventListener(\\\"unload\\\",checkRedirect(\\\"unload\\\")),document.addEventListener(\\\"visibilitychange\\\",function(){\\\"hidden\\\"===document.visibilityState&&checkRedirect(\\\"visibilityState\\\")});var e=document.createElement(\\\"iframe\\\");document.body.appendChild(e),e.width=\\\"320\\\",e.height=\\\"480\\\";var t=document.querySelector(\\\"#mobfoxCover\\\");t.style.width=e.width+\\\"px\\\",t.style.height=e.height+\\\"px\\\",e.style.margin=\\\"0px\\\",e.style.padding=\\\"0px\\\",e.style.border=\\\"none\\\",e.scrolling=\\\"no\\\",e.style.overflow=\\\"hidden\\\",e.sandbox=\\\"allow-scripts allow-popups allow-popups-to-escape-sandbox allow-top-navigation allow-same-origin\\\";var o=atob(markupB64);setTimeout(function(){state=NORMAL},200),setTimeout(function(){var e=document.querySelector(\\\"#mobfoxCover\\\");document.body.removeChild(e)},200);var d=\\\"srcdoc\\\"in e,n=o;o.indexOf(\\\"<body>\\\")<0&&(n=\\\"<html><body style='margin:0'>\\\"+o+\\\"</body></html>\\\"),d?e.srcdoc=n:(e.contentWindow.document.open(),e.contentWindow.document.write(n),e.contentWindow.document.close())}var markupB64=\\\"PGEgaHJlZj0iaHR0cDovL252aXJnaW5pYS1teS5tb2Jmb3guY29tL2V4Y2hhbmdlLmNsaWNrLnBocD9oPWE3NzY1YjNlNjJkN2IzZmY0YzRmNGQxNjBkZWJlYzQ4IiB0YXJnZXQ9Il9zZWxmIj48aW1nIHNyYz0iaHR0cHM6Ly9jcmVhdGl2ZTJjZG4ubW9iZm94LmNvbS8yMjg2ZGM4NTAwMzFmZjFkNTFhZDM4MWI1YzU5YWUyNy5naWYiIGJvcmRlcj0iMCIvPjwvYT48aW1nIHN0eWxlPSJwb3NpdGlvbjphYnNvbHV0ZTsgbGVmdDogLTEwMDAwcHg7IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiBzcmM9Imh0dHBzOi8vaHEtbXkubW9iZm94LmNvbS9ydGIuaW1wcmVzc2lvbi5waXhlbC5waHA/cmlkPWI3ZGJiOTkzY2Q3MDJiN2Y5MTM1ZTUxMzJiNmI4ZWM0JnByaWNlPTIuODE4Ii8+PGltZyBzdHlsZT0icG9zaXRpb246YWJzb2x1dGU7IGxlZnQ6IC0xMDAwMHB4OyIgd2lkdGg9IjEiIGhlaWdodD0iMSIgc3JjPSJodHRwOi8vbnZpcmdpbmlhLW15Lm1vYmZveC5jb20vZXhjaGFuZ2UucGl4ZWwucGhwP2g9YTc3NjViM2U2MmQ3YjNmZjRjNGY0ZDE2MGRlYmVjNDgiLz48c2NyaXB0IHR5cGU9InRleHQvamF2YXNjcmlwdCI+ZG9jdW1lbnQud3JpdGUoJzxpbWcgc3R5bGU9InBvc2l0aW9uOmFic29sdXRlOyBsZWZ0OiAtMTAwMDBweDsiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHNyYz0iaHR0cDovL252aXJnaW5pYS1teS5tb2Jmb3guY29tL2V4Y2hhbmdlLnBpeGVsLnBocD9oPWE3NzY1YjNlNjJkN2IzZmY0YzRmNGQxNjBkZWJlYzQ4JnRlc3Q9MSIvPicpOzwvc2NyaXB0Pg==\\\",INITIAL=0,REDIRECT=1,REDUNDANT=2,NORMAL=3,state=INITIAL,creativeId=\\\"715336\\\",advertiserId=\\\"14566\\\",hParam=\\\"a7765b3e62d7b3ff4c4f4d160debec48\\\",dspId=\\\"6\\\",networkId=\\\"\\\",autoPilotInventoryConfId=\\\"\\\",stackItemId=\\\"\\\",serverHost=\\\"184.172.209.50\\\",adSpaceId=\\\"\\\",adId=\\\"715336\\\",cId=\\\"58767\\\",adomain=\\\"google.com\\\",geo=\\\"US\\\",md5Hash=\\\"b01976128508824cec3d451e5c5c43ae\\\";document.addEventListener(\\\"DOMContentLoaded\\\",function(e){state=REDIRECT}),setTimeout(init,1)</script></body></html>\",\n    \"clicktype\": \"safari\",\n    \"clickurl\": \"http://nvirginia-my.mobfox.com/exchange.click.php?h=a7765b3e62d7b3aa4c4f4d160debec48\",\n    \"urltype\": \"link\",\n    \"refresh\": \"30\",\n    \"scale\": \"no\",\n    \"skippreflight\": \"yes\",\n    \"demandPartner\": {\n      \"id\": \"6\",\n      \"name\": \"MobFox DSP\"\n    }\n  }\n}"},{"name":"Error","status":200,"language":"xml","code":"<!-- We respond with 200 OK and add an error xml element to our response if something went wrong -->\n<error>Invalid inventory hash supplied. (argument \"s\")</error>"}]},"settings":"","auth":"required","params":[{"_id":"56473ab856fb450d0041012d","ref":"","in":"query","required":true,"desc":"Requester type. Our SDKs will populate this parameter with their SDK version numbers.","default":"api","type":"string","name":"rt"},{"_id":"56473ab856fb450d0041012c","ref":"","in":"query","required":true,"desc":"Requested ad type. Allowed values: banner, video, native","default":"banner","type":"string","name":"r_type"},{"_id":"56473f2c054d8f0d00bc776f","ref":"","in":"query","required":true,"desc":"The hash of your inventory to identify which app is making the request.","default":"267d72ac3f77a3f447b32cf7ebf20673","type":"string","name":"s"},{"_id":"56473ee7c7687d0d00739fa0","ref":"","in":"query","required":true,"desc":"Set IP address of the device making the request. API will first check for the X-Forwarded-For header before it falls back to this parameter.","default":"69.197.148.18","type":"string","name":"i"},{"_id":"56473f2c054d8f0d00bc776e","ref":"","in":"query","required":true,"desc":"Url encoded user agent string.","default":"","type":"string","name":"u"},{"_id":"577d2a4074aea42200723102","ref":"","in":"query","required":false,"desc":"Indicates if the requested banner will be displayed as an interstitial/fullscreen ad. **1** means yes, **0** means no. Please check the explanation box bellow on more about interstitials.","default":"1","type":"int","name":"imp_instl"},{"_id":"5647729ac7687d0d00739fb9","ref":"","in":"query","required":false,"desc":"Width of your ad space. See below a note on the recommended adspace sizes for interstitials.","default":"320","type":"int","name":"adspace_width"},{"_id":"5647729ac7687d0d00739fb8","ref":"","in":"query","required":false,"desc":"Height of your ad space. See below a note on the recommended adspace sizes for interstitials.","default":"480","type":"int","name":"adspace_height"},{"_id":"56893317e1f9a00d00350b02","ref":"","in":"query","required":false,"desc":"If this parameter is set to 1 and an adspace_height and adspace_width is provided, the ad server will only serve ads of these exact dimensions and will not serve any smaller-sized ads.","default":"1","type":"int","name":"adspace_strict"},{"_id":"58a3995a23b12b0f00dc345e","ref":"","in":"query","required":false,"desc":"Define, which response format to receive, **xml** or **json**. The default is **xml** for legacy reasons.","default":"xml","type":"string","name":"r_resp"}],"url":"/request.php?rt=api&r_type=banner&adspace_width=320&adspace_height=480"},"isReference":false,"order":6,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Size Matters\",\n  \"body\": \"If you want an interstitial ad then you must set **imp_instl** to **1** and set an **adspace to a value above 300x250**.\\n\\nPlease refer to the [IAB standard](http://www.iab.com/wp-content/uploads/2015/11/IAB_Display_Mobile_Creative_Guidelines_HTML5_2015.pdf) ad sizes. We recommend these interstitial adspace sizes:\\n* 320x480 (for phones)\\n* 768x1024 (for tablets)\\n\\nThe sizes above are for **portrait** mode. Please flip the sizes in case of **landscape**.\\n\\nIf you set **imp_instl = 0** we won't request an interstitial ad but instead a normal banner ad with the provided adspace size.\\n\\nThere is also a method to request interstitial ads by directly setting the adspace parameters to be 320x480 or 1024x768 (without setting **imp_instl**). This method is deprecated. Please use the **imp_instl** parameter instead.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"We recommend passing these parameters on all of your ad requests to get the best eCPM:\\n* o_andadvid\\n* o_iosadvid\\n* latitude\\n* longitude\\n* r_floor\\n* demo_age\\n* demo_gender\\n* c_mraid\\n* adspace_width/adspace_height\\n\\nThese params are documented on our [Global Request Parameters](doc:global-request-parameters) page.\",\n  \"title\": \"Augment your ad request with global ad request parameters\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%208_0%20like%20Mac%20OS%20X)%20AppleWebKit%2F600.1.3%20(KHTML%2C%20like%20Gecko)%20Version%2F8.0%20Mobile%2F12A4345d%20Safari%2F600.1.4\",\n      \"language\": \"text\",\n      \"name\": \"User Agent for testing\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"request-interstitial-banners","type":"endpoint","title":"Request Interstitial Banners"}

getRequest Interstitial Banners


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

rt:
required
stringapi
Requester type. Our SDKs will populate this parameter with their SDK version numbers.
r_type:
required
stringbanner
Requested ad type. Allowed values: banner, video, native
s:
required
string267d72ac3f77a3f447b32cf7ebf20673
The hash of your inventory to identify which app is making the request.
i:
required
string69.197.148.18
Set IP address of the device making the request. API will first check for the X-Forwarded-For header before it falls back to this parameter.
u:
required
string
Url encoded user agent string.
imp_instl:
integer1
Indicates if the requested banner will be displayed as an interstitial/fullscreen ad. **1** means yes, **0** means no. Please check the explanation box bellow on more about interstitials.
adspace_width:
integer320
Width of your ad space. See below a note on the recommended adspace sizes for interstitials.
adspace_height:
integer480
Height of your ad space. See below a note on the recommended adspace sizes for interstitials.
adspace_strict:
integer1
If this parameter is set to 1 and an adspace_height and adspace_width is provided, the ad server will only serve ads of these exact dimensions and will not serve any smaller-sized ads.
r_resp:
stringxml
Define, which response format to receive, **xml** or **json**. The default is **xml** for legacy reasons.

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Size Matters", "body": "If you want an interstitial ad then you must set **imp_instl** to **1** and set an **adspace to a value above 300x250**.\n\nPlease refer to the [IAB standard](http://www.iab.com/wp-content/uploads/2015/11/IAB_Display_Mobile_Creative_Guidelines_HTML5_2015.pdf) ad sizes. We recommend these interstitial adspace sizes:\n* 320x480 (for phones)\n* 768x1024 (for tablets)\n\nThe sizes above are for **portrait** mode. Please flip the sizes in case of **landscape**.\n\nIf you set **imp_instl = 0** we won't request an interstitial ad but instead a normal banner ad with the provided adspace size.\n\nThere is also a method to request interstitial ads by directly setting the adspace parameters to be 320x480 or 1024x768 (without setting **imp_instl**). This method is deprecated. Please use the **imp_instl** parameter instead." } [/block] [block:callout] { "type": "info", "body": "We recommend passing these parameters on all of your ad requests to get the best eCPM:\n* o_andadvid\n* o_iosadvid\n* latitude\n* longitude\n* r_floor\n* demo_age\n* demo_gender\n* c_mraid\n* adspace_width/adspace_height\n\nThese params are documented on our [Global Request Parameters](doc:global-request-parameters) page.", "title": "Augment your ad request with global ad request parameters" } [/block] [block:code] { "codes": [ { "code": "Mozilla%2F5.0%20(iPhone%3B%20CPU%20iPhone%20OS%208_0%20like%20Mac%20OS%20X)%20AppleWebKit%2F600.1.3%20(KHTML%2C%20like%20Gecko)%20Version%2F8.0%20Mobile%2F12A4345d%20Safari%2F600.1.4", "language": "text", "name": "User Agent for testing" } ] } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}