{"_id":"56465ec2054d8f0d00bc76da","__v":12,"category":{"_id":"564dcf87d3320b0d0028ca10","version":"564621e10c30fb2100ba3817","__v":26,"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","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"},"project":"564621e00c30fb2100ba3814","user":"564621d275c83f0d00e9d52d","editedParams":true,"parentDoc":null,"version":{"_id":"564621e10c30fb2100ba3817","__v":14,"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"},"editedParams2":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-13T22:05:54.557Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"name":"Complete Banner Request","code":"curl \"http://my.mobfox.com/request.php?rt=api&r_type=banner&i=69.197.148.18&s=fe96717d9875b9da4339ea5367eff1ec&adspace_width=320&adspace_height=50&adspace_strict=0&o_iosadvid=1976F519-26D0-4428-9891-3133253A453F&r_floor=0.2&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","language":"curl"}]},"method":"get","results":{"codes":[{"status":200,"language":"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=90e501a3aadc19675e585b67cde52eb4\" target=\"_self\"><img src=\"http://creative2cdn.mobfox.com/bfc136b8ec5b7ecb01e1206e20ced03d.gif\" border=\"0\"/></a><img style=\"position:absolute; left: -10000px;\" width=\"1\" height=\"1\" src=\"http://my.mobfox.com/rtb.impression.pixel.php?rid=d528134752bbd5bc6f8b84542a50443c&price=0.233\"/><img style=\"position:absolute; left: -10000px;\" width=\"1\" height=\"1\" src=\"http://my.mobfox.com/exchange.pixel.php?h=90e501a3aadc19675e585b67cde52eb4\"/><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=90e501a3aadc19675e585b67cde52eb4&test=1\"/>');</script>]]></htmlString>\n   <clicktype>safari</clicktype>\n   <clickurl><![CDATA[http://my.mobfox.com/exchange.click.php?h=90e501a3aadc19675e585b67cde52eb4]]></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>","name":"Banner (XML)"},{"code":"{\n  \"request\": {\n    \"type\": \"textAd\",\n    \"htmlString\": \"<!DOCTYPE html><html lang=\\\"en\\\"><head><meta charset=\\\"UTF-8\\\"><title>Document</title></head><style>body{margin:0;text-align:center;}</style><body><a id=\\\"btn\\\" href=\\\"http://mobfox.dev:50000/exchange.click.php?h=ed24a82382b6c47efbcf6c522611dd90\\\"><img style=\\\"width:70%\\\" src=\\\"http://dogg2vbfv32xf.cloudfront.net/testad1.jpg\\\"/></a><img src=\\\"http://tracking.yeahmobi.com/event.php?e=10200&adx=mobfox&ad=3335&bid=590E6EFF73B9875DB64651E847E19AE7&imp=1\\\" style=\\\"position:absolute;left:-9999px\\\"/></body><script>function click(){var script=document.createElement('img'); script.src=\\\"http://tracking.yeahmobi.com/event.php?e=10300&adx=mobfox&ad=3335&bid=590E6EFF73B9875DB64651E847E19AE7&imp=1\\\"; document.body.appendChild(script);} document.querySelector('#btn').addEventListener('click',click);</script></html><img style=\\\"position:absolute; left: -10000px;\\\" width=\\\"1\\\" height=\\\"1\\\" src=\\\"http://mobfox.dev:50000/exchange.pixel.php?h=ed24a82382b6c47efbcf6c522611dd90\\\"/><script type=\\\"text/javascript\\\">document.write('<img style=\\\"position:absolute; left: -10000px;\\\" width=\\\"1\\\" height=\\\"1\\\" src=\\\"http://mobfox.dev:50000/exchange.pixel.php?h=ed24a82382b6c47efbcf6c522611dd90&test=1\\\"/>');</script>\",\n    \"clicktype\": \"safari\",\n    \"clickurl\": \"http://mobfox.dev:50000/exchange.click.php?h=ed24a82382b6c47efbcf6c522611dd90\",\n    \"urltype\": \"link\",\n    \"refresh\": \"30\",\n    \"scale\": \"no\",\n    \"skippreflight\": \"yes\",\n    \"demandPartner\": {\n      \"id\": \"6\",\n      \"name\": \"MobFox DSP\"\n    }\n  }\n}","language":"json","name":"Banner (JSON)","status":200},{"code":"<error>Invalid inventory hash supplied. (argument \"s\")</error>\n\n<!-- We respond with 200 OK and add an error xml element to our response if something went wrong -->","language":"xml","status":200,"name":"Error (XML)"},{"code":"{\n  \"error\": \"Invalid inventory hash supplied. (argument \\\"s\\\")\"\n}\n\n// We respond with 200 OK and add an error xml element to our response if something went wrong","language":"json","status":200,"name":"Error (JSON)"}]},"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":"fe96717d9875b9da4339ea5367eff1ec","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":"5647729ac7687d0d00739fb9","ref":"","in":"query","required":false,"desc":"Width of your ad space.","default":"320","type":"int","name":"adspace_width"},{"_id":"5647729ac7687d0d00739fb8","ref":"","in":"query","required":false,"desc":"Height of your ad space.","default":"50","type":"int","name":"adspace_height"},{"_id":"5647729ac7687d0d00739fb7","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":"0","type":"int","name":"adspace_strict"},{"_id":"585c00350da2ee0f00108bbd","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"},"isReference":false,"order":5,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Augment your ad request with global ad request parameters\",\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}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Typical Regular Banner Sizes\",\n  \"body\": \"Most used ad sizes are:\\n* 300x50 (for phones)\\n* 320x50 (for phones)\\n* 300x250 (for  phones) also called \\\"Medium Rectangle\\\"\\n* 728x90 (for tablets)\"\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":"banners","type":"endpoint","title":"Request  Regular Banners"}

getRequest Regular 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
stringfe96717d9875b9da4339ea5367eff1ec
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.
adspace_width:
integer320
Width of your ad space.
adspace_height:
integer50
Height of your ad space.
adspace_strict:
integer0
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": "info", "title": "Augment your ad request with global ad request parameters", "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." } [/block] [block:callout] { "type": "info", "title": "Typical Regular Banner Sizes", "body": "Most used ad sizes are:\n* 300x50 (for phones)\n* 320x50 (for phones)\n* 300x250 (for phones) also called \"Medium Rectangle\"\n* 728x90 (for tablets)" } [/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 }}