{"_id":"56477692054d8f0d00bc778e","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"},"__v":21,"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"},"editedParams2":true,"user":"564621d275c83f0d00e9d52d","parentDoc":null,"project":"564621e00c30fb2100ba3814","editedParams":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-11-14T17:59:46.657Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"curl \"http://my.mobfox.com/request.php?rt=api&r_type=video&r_resp=vast20&i=69.197.148.18&s=80187188f458cfde788d961b6882fd53&v_dur_min=5&v_dur_max=60&v_autoplay=1&v_startmute=1&v_rewarded=0&adspace_width=320&adspace_height=480&adspace_strict=0&o_iosadvid=00000000-0000-0000-0000-000000000000&r_floor=0.8&longitude=12.12&latitude=280.12&demo_gender=male&demo_age=1982&demo_keywords=sports&v_api=vpaid20&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\"\n\n# Replace the value of s= with your own inventory hash once you are ready for live ads","language":"curl","name":"Complete Parameters Video Request"}]},"method":"get","results":{"codes":[{"status":200,"name":"Video (VAST AD)","language":"xml","code":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<VAST version=\"2.0\">\n   <Ad id=\"1\">\n      <InLine>\n         <AdSystem version=\"1.0\">MobFox DSP</AdSystem>\n         <AdTitle><![CDATA[MobFox Video Creative]]></AdTitle>\n         <Impression><![CDATA[http://my.mobfox.com/rtb.impression.pixel.php?rid=c2fae25aa14c2560c47c337fe5af344a&price=2.271]]></Impression>\n         <Impression>http://my.mobfox.com/exchange.pixel.php?h=ac2931d2c9ca1f1c542c91a7b9061ef4</Impression>\n         <Creatives>\n            <Creative sequence=\"1\" id=\"1\">\n               <Linear>\n                  <Duration>00:01:23</Duration>\n                  <TrackingEvents>\n                     <Tracking event=\"complete\"><![CDATA[http://www.compleate.com]]></Tracking>\n                     <Tracking event=\"firstQuartile\"><![CDATA[http://www.FirstQuartile.com]]></Tracking>\n                     <Tracking event=\"midpoint\"><![CDATA[http://www.midpoint.com]]></Tracking>\n                     <Tracking event=\"mute\"><![CDATA[http://www.mute.com]]></Tracking>\n                     <Tracking event=\"pause\"><![CDATA[http://www.Pause.com]]></Tracking>\n                     <Tracking event=\"resume\"><![CDATA[http://www.resume.com]]></Tracking>\n                     <Tracking event=\"start\"><![CDATA[http://video_start.com]]></Tracking>\n                     <Tracking event=\"thirdQuartile\"><![CDATA[http://www.Thirdquartile.com]]></Tracking>\n                     <Tracking event=\"unmute\"><![CDATA[http://www.unmute.com]]></Tracking>\n                     <Tracking event=\"start\">http://my.mobfox.com/sendcookie.php</Tracking>\n                  </TrackingEvents>\n                  <VideoClicks>\n                     <ClickThrough>http://my.mobfox.com/exchange.click.php?h=ac2931d2c9ca1f1c542c91a7b9061ef4</ClickThrough>\n                  </VideoClicks>\n                  <MediaFiles>\n                     <MediaFile delivery=\"progressive\" width=\"640\" height=\"360\" type=\"video/mp4\"><![CDATA[http://creative1cdn.mobfox.com/a5d96c7f0987d2644bdcef11bc24deb4.mp4]]></MediaFile>\n                  </MediaFiles>\n               </Linear>\n            </Creative>\n         </Creatives>\n         <Extensions>\n            <adMetadata>\n               <dspId><![CDATA[60]]></dspId>\n               <publisherId><![CDATA[74403]]></publisherId>\n               <inventoryId><![CDATA[234227]]></inventoryId>\n               <adomain><![CDATA[www.advertiser.com]]></adomain>\n               <bundleId><![CDATA[com.company.appname]]></bundleId>\n               <campaignId><![CDATA[3964975]]></campaignId>\n               <creativeId><![CDATA[871978]]></creativeId>\n            </adMetadata>\n         </Extensions>\n      </InLine>\n   </Ad>\n</VAST>"},{"status":200,"name":"Error","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>","language":"xml"},{"status":200,"name":"No Ad (VAST 2.0)","language":"xml","code":"<VAST version=\"2.0\"/>"},{"status":200,"name":"No Ad (VAST 3.0)","language":"xml","code":"<VAST version=\"3.0\"/>"},{"code":"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<VAST version=\"2.0\">\n   <Ad id=\"1\">\n      <Wrapper>\n         <AdSystem><![CDATA[Mobfox]]></AdSystem>\n         <VASTAdTagURI><![CDATA[http://tracker.mtrtb.com/vast/?duration=7&impression_url=http%3A%2F%2Ftracker.mtrtb.com%2Ftracker%2Fimp%2F%3Fuuid%3D58a95470-c85f-11e7-9071-0668f60b412e%26ccrid%3D703303%26price%3D%24%7BAUCTION_PRICE%7D%26bid_ts%3D1510569749303%26campaign_id%3D3964975%26ssp_id%3D2&click_url=http%3A%2F%2Ftracker.mtrtb.com%2Ftracker%2Fclick%2F%3Fd%3DZZdXVpZD01OGE5NTQ3MC1jODVmLTExZTctOTA3MS0wNjY4ZjYwYjQxMmUmY2NyaWQ9NzAzMzAzJnNzcF9pZD0y&video_w=640&video_h=960&ccrid=703303&ssp_id=2&encode_media_file=abbWVkaWFfZmlsZT04NzE5NzgubXA0]]></VASTAdTagURI>\n         <Impression><![CDATA[http://tracker.mtrtb.com/tracker/imp/?uuid=58a95470-c85f-11e7-9071-0668f60b412e&ccrid=703303&price=0.151&bid_ts=1510569749303&campaign_id=3964975&ssp_id=2]]></Impression>\n         <Impression><![CDATA[http://nvirginia-callbacks.mobfox.com/exchange.pixel.php?h=f314a12b2a030d6c26f3988f6e317b7e]]></Impression>\n         <Creatives>\n            <Creative>\n               <Linear>\n                  <TrackingEvents />\n               </Linear>\n            </Creative>\n         </Creatives>\n         <Extensions>\n            <adMetadata>\n               <dspId><![CDATA[60]]></dspId>\n               <publisherId><![CDATA[74403]]></publisherId>\n               <inventoryId><![CDATA[234227]]></inventoryId>\n               <adomain><![CDATA[www.advertiser.com]]></adomain>\n               <bundleId><![CDATA[com.company.appname]]></bundleId>\n               <campaignId><![CDATA[3964975]]></campaignId>\n               <creativeId><![CDATA[871978]]></creativeId>\n            </adMetadata>\n         </Extensions>\n      </Wrapper>\n   </Ad>\n</VAST>","language":"xml","name":"Video (VAST WRAPPER)","status":200}]},"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. Set this to **video** to request a video ad.","default":"video","type":"string","name":"r_type"},{"_id":"564776cd8056940d001942b9","ref":"","in":"query","required":true,"desc":"Video response type. You can choose between **vast20** (for Vast 2.0) or **vast30** (for VAST 2.0 or VAST 3.0), depending on what your platform supports.","default":"vast20","type":"string","name":"r_resp"},{"_id":"56473f2c054d8f0d00bc776f","ref":"","in":"query","required":true,"desc":"The hash of your inventory to identify which app is making the request.","default":"80187188f458cfde788d961b6882fd53","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":"568b02cd176a6c0d00a29ede","ref":"","in":"query","required":false,"desc":"Width of your ad space for the video. If its fullscreen, take the screen-width. **Defaults to screen-width**.","default":"320","type":"int","name":"adspace_width"},{"_id":"568b02cd176a6c0d00a29edd","ref":"","in":"query","required":false,"desc":"Height of your ad space for the video. If its fullscreen, take the screen-height. **Defaults to screen-height**.","default":"480","type":"int","name":"adspace_height"},{"_id":"578639cfbbe6c40e009f7088","ref":"","in":"query","required":false,"desc":"Indicates if the requested video will be displayed as an interstitial/fullscreen ad. **1** means yes, **0** means no. **Defaults to 0**.","default":"1","type":"int","name":"imp_instl"},{"_id":"568b022bbf86800d00fe31ce","ref":"","in":"query","required":false,"desc":"The minimum video duration in seconds. **Defaults to 0**.","default":"0","type":"int","name":"v_dur_min"},{"_id":"568b022bbf86800d00fe31cd","ref":"","in":"query","required":false,"desc":"The maximum video duration in seconds. **Defaults to 999**.","default":"999","type":"int","name":"v_dur_max"},{"_id":"577cfc9e7a157c0e00205817","ref":"","in":"query","required":false,"desc":"Indicates if the video ad should be played automatically once it appears. 1 indicates true, 0 indicates false. We recommend to autoplay your video. **Defaults to 1**.","default":"1","type":"int","name":"v_autoplay"},{"_id":"577cfc9e7a157c0e00205816","ref":"","in":"query","required":false,"desc":"Indicates if the video should be played as mute by default. 1 indicates yes, 0 indicates no. We recommend to start the video with audio. **Defaults to 1**.","default":"0","type":"int","name":"v_startmute"},{"_id":"585babb4eb91d62d00b9e9ad","ref":"","in":"query","required":false,"desc":"Indicates if this particular type of video offers game bonuses to players, if watched.","default":"0","type":"int","name":"v_rewarded"},{"_id":"58e217569bd19125009da176","ref":"","in":"query","required":false,"desc":"Indicates, which formats you support within VAST. Currently MobFox supports **vpaid10** (VPAID version 1.0) and **vpaid20** (VPAID version 2.0).","default":"vpaid20","type":"string","name":"v_api"}],"url":"/request.php?rt=api&r_type=video&r_resp=vast20"},"isReference":false,"order":9,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Video ads will be returned as [IAB VAST 2.0](http://www.iab.com/insights/vast-2-0-xml-samples-for-testing), or [IAB VAST 3.0](http://www.iab.com/guidelines/digital-video-ad-serving-template-vast-3-0/) compliant XML. \\n\\nNote that Vast 3.0 is backwards compatible with Vast 2.0. \\n\\nIf you specify **vast30** for the **r_resp** parameter, you can be returned a VAST 3.0 or VAST 2.0 ad. But if you only support VAST 2.0, and specify **vast20** as a parameter, then we will only serve you VAST 2.0 and nothing above.\",\n  \"title\": \"VAST Versions\"\n}\n[/block]\n\n[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:api-header]\n{\n  \"title\": \"VAST AD vs. VAST WRAPPPER\"\n}\n[/block]\nThe advertising industry today is using two different types of VAST to deliver an ad.\n\n**1) VAST WRAPPER**\nThis is not the final ad markup with the <MediaFile> but instead it is a \"redirect\" to the next ad server which might again serve a VAST WRAPPER or the final VAST AD markup to you.\n\nThe \"redirect URI\" is defined inside the <VASTAdTagURI> tag in the VAST WRAPPER markup.\n\n**2) VAST AD**\nThis is the actual ad that can be rendered as it contains the needed <MediaFile> object.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Rendering VAST\",\n  \"body\": \"Your video player must be able to handle a **VAST WRAPPER** as well as a **VAST AD** and collect all events and trigger them once the final VAST AD was received and rendered.\"\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-videos","type":"endpoint","title":"Request Video Ads"}

getRequest Video Ads


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
stringvideo
Requested ad type. Set this to **video** to request a video ad.
r_resp:
required
stringvast20
Video response type. You can choose between **vast20** (for Vast 2.0) or **vast30** (for VAST 2.0 or VAST 3.0), depending on what your platform supports.
s:
required
string80187188f458cfde788d961b6882fd53
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 for the video. If its fullscreen, take the screen-width. **Defaults to screen-width**.
adspace_height:
integer480
Height of your ad space for the video. If its fullscreen, take the screen-height. **Defaults to screen-height**.
imp_instl:
integer1
Indicates if the requested video will be displayed as an interstitial/fullscreen ad. **1** means yes, **0** means no. **Defaults to 0**.
v_dur_min:
integer0
The minimum video duration in seconds. **Defaults to 0**.
v_dur_max:
integer999
The maximum video duration in seconds. **Defaults to 999**.
v_autoplay:
integer1
Indicates if the video ad should be played automatically once it appears. 1 indicates true, 0 indicates false. We recommend to autoplay your video. **Defaults to 1**.
v_startmute:
integer0
Indicates if the video should be played as mute by default. 1 indicates yes, 0 indicates no. We recommend to start the video with audio. **Defaults to 1**.
v_rewarded:
integer0
Indicates if this particular type of video offers game bonuses to players, if watched.
v_api:
stringvpaid20
Indicates, which formats you support within VAST. Currently MobFox supports **vpaid10** (VPAID version 1.0) and **vpaid20** (VPAID version 2.0).

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "body": "Video ads will be returned as [IAB VAST 2.0](http://www.iab.com/insights/vast-2-0-xml-samples-for-testing), or [IAB VAST 3.0](http://www.iab.com/guidelines/digital-video-ad-serving-template-vast-3-0/) compliant XML. \n\nNote that Vast 3.0 is backwards compatible with Vast 2.0. \n\nIf you specify **vast30** for the **r_resp** parameter, you can be returned a VAST 3.0 or VAST 2.0 ad. But if you only support VAST 2.0, and specify **vast20** as a parameter, then we will only serve you VAST 2.0 and nothing above.", "title": "VAST Versions" } [/block] [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:api-header] { "title": "VAST AD vs. VAST WRAPPPER" } [/block] The advertising industry today is using two different types of VAST to deliver an ad. **1) VAST WRAPPER** This is not the final ad markup with the <MediaFile> but instead it is a "redirect" to the next ad server which might again serve a VAST WRAPPER or the final VAST AD markup to you. The "redirect URI" is defined inside the <VASTAdTagURI> tag in the VAST WRAPPER markup. **2) VAST AD** This is the actual ad that can be rendered as it contains the needed <MediaFile> object. [block:callout] { "type": "danger", "title": "Rendering VAST", "body": "Your video player must be able to handle a **VAST WRAPPER** as well as a **VAST AD** and collect all events and trigger them once the final VAST AD was received and rendered." } [/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 }}