{"_id":"57ab87c5b5e8742000e17e9e","user":"5429becb1163360800ed31f8","__v":5,"version":{"_id":"5429beef1163360800ed31fd","__v":21,"project":"5429beef1163360800ed31fa","createdAt":"2014-09-29T20:19:59.904Z","releaseDate":"2014-09-29T20:19:59.904Z","categories":["5429beef1163360800ed31fe","55e74e1f5d36b32b002563fa","55e7500a73169617001f2e86","55e76b8196131b2f00bf4b72","55e89569cdbb8a350096df9c","55f8935eb089b71700a8364e","55f8a67d3bb4bb0d0022d093","55f9dbefc7ef770d00d9bf6d","5601c21a22ecf60d002b27b3","5601c21ff12aee0d001bb06e","5601c2256c7b610d00280db5","5601c22c22ecf60d002b27b4","5603738d0c78b00d0039af47","5626f70bfcbbc621004ebf52","566f7a1ae144ab0d00e9732f","566f85ca7820960d00c3b93d","56708ce43a32d20d00c45cbf","56708d436995210d003aad8e","5736471abe10a9200030732c","57a82c7aff9bd30e00a6f1c1","591b8500e3992319007190f4"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"parentDoc":null,"project":"5429beef1163360800ed31fa","category":{"_id":"55e76b8196131b2f00bf4b72","pages":["55e8b2c13fef5017000dbd9a","55e8b365f0f1850d00d24a5b","55f88ebd5840d119004346bf","55f8ab55c449610d002daf87","5603759a8d58900d0051e9ee","560375cd90ee490d004403da","5633b5ebc49a7c19001fd091","567353ae47f7010d005bfdc9"],"project":"5429beef1163360800ed31fa","__v":8,"version":"5429beef1163360800ed31fd","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-09-02T21:34:57.232Z","from_sync":false,"order":2,"slug":"apis","title":"Integrating with APIs"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-08-10T20:00:05.975Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"name":"","code":"{\n    \"status\": \"OK\",\n    \"count\": 1,\n    \"ad\": {\n        \"promotedByUrl\": \"\",\n        \"trackingTags\": \"<img src=\\\"http://bevo.adsnative.com/im.gif?sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\\\" BORDER=0 WIDTH=1 HEIGHT=1>\\n\",\n        \"ctaTitle\": \"\",\n        \"summary\": \"Test\",\n        \"videoExperience\": \"autoplay_inview\",\n        \"promotedBy\": \"Test\",\n        \"video\": {\n            \"sources\": [\n                \"http://static.adsnative.com/media/videos/blank.mp4\"\n            ],\n            \"experience\": \"autoplay_inview\",\n            \"vastTags\": [\n                \"http://dsp.videostat.com/giantmedia/vast?fid=6011&adid=5624&pid=855&sd=businessinsider.sg&sid=1921&pos=1&at=552\"\n            ],\n            \"embedType\": \"vast\",\n            \"trackingUrls\": {\n                \"duration\": {\n                    \"percentage\": {\n                        \"25\": [\n                            \"http://bevo.adsnative.com/vv.gif?tag_name=duration_25&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                        ],\n                        \"50\": [\n                            \"http://bevo.adsnative.com/vv.gif?tag_name=duration_50&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                        ],\n                        \"75\": [\n                            \"http://bevo.adsnative.com/vv.gif?tag_name=duration_75&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                        ]\n                    },\n                    \"complete\": [\n                        \"http://bevo.adsnative.com/vv.gif?tag_name=duration_complete&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                    ]\n                },\n                \"impression\": [\n                    \"http://bevo.adsnative.com/vv.gif?tag_name=impression&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                ],\n                \"userActions\": {\n                    \"unmute\": [],\n                    \"fullscreen\": [],\n                    \"pause\": [],\n                    \"resume\": [],\n                    \"mute\": []\n                },\n                \"clickThrough\": [\n                    \"http://bevo.adsnative.com/vv.gif?tag_name=click&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                ],\n                \"view\": [\n                    \"http://bevo.adsnative.com/vv.gif?tag_name=view&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                ]\n            }\n        },\n        \"target\": \"_blank\",\n        \"title\": \"Test\",\n        \"url\": \"http://bevo.adsnative.com/ck?url=http%3A%2F%2Fnytimes.com&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\",\n        \"trackingUrls\": {\n            \"impressions\": [\n                \"http://bevo.adsnative.com/im.gif?sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n            ],\n            \"viewables\": [\n                \"http://bevo.adsnative.com/vi.gif?sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n            ],\n            \"clicks\": [\n                \"http://bevo.adsnative.com/ck?nr=1&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n            ],\n            \"actions\": {\n                \"action\": [\n                    \"http://bevo.adsnative.com/ca.gif?action_name=action&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\"\n                ]\n            }\n        },\n        \"landingUrl\": \"http://nytimes.com\",\n        \"ctaUrl\": null,\n        \"viewableTags\": \"<img src=\\\"http://bevo.adsnative.com/vi.gif?sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\\\" BORDER=0 WIDTH=1 HEIGHT=1>\\n\",\n        \"imageSrc\": \"/media/nw-13/c4c20aba-f3b2-43a4-a125-601bf615a5e4.png\",\n        \"promotedByTag\": \"Promoted by\",\n        \"backgroundColor\": \"#FFFFFF\",\n        \"sid\": \"8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\",\n        \"brandImageUrl\": \"\",\n        \"embedUrl\": \"http://api.adsnative.com/v1/creative.html?crid=ST481LGW&sid=8d384809050a4d9c9b27167fbdebe45e_a6ba41d5\",\n        \"type\": \"video\"\n    },\n    \"cid\": \"Y565P12K\",\n    \"crid\": \"ST481LGW\",\n    \"zid\": \"ping\",\n    \"sid\": \"8d384809050a4d9c9b27167fbdebe45e\",\n    \"uuid\": \"79f872ea-2a95-4edc-b49d-9448185a9034\"\n}","language":"json"},{"name":"","code":"{\n    \"status\": \"Internal Server Error\",\n    \"code\": \"500\",\n    \"description\": \"Something is broken. We are looking into it!\"\n}","language":"json","status":500},{"code":"{\n    \"status\": \"FAIL\",\n    \"message\": \"no campaigns found\",\n    \"uuid\": \"e3b50f82-f570-44d0-8c17-638059c9edf2\"\n}","language":"json","status":200,"name":"No campaigns found"}]},"settings":"","examples":{"codes":[{"language":"json","code":"{\n    \"app\": {\n        \"app_id\" : \"demo_app\",\n      \t\"ver\": \"1.0\",\n        \"bnid\" : \"com.democompany.appdemo\",\n        \"store_id\": \"102323235\"\n    },\n    \"device\": {\n        \"ua\": \"Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12A405 Safari/600.1.4\",\n        \"ip\": \"69.125.199.79\",\n        \"h\" : 150,\n        \"w\" : 200,\n        \"ort\" : \"v\",\n        \"ct\" : \"LTE\",\n        \"carrier\" : \"verizon\",\n        \"al\" : \"en-us\"\n    },\n    \"geo\": {\n        \"lat\": -20.555652,\n      \t\"lon\": 45.527344,\n      \t\"lla\": 10\n    },\n    \"user\": {\n        \"uuid\": \"68753A44-4D6F-1226-9C60-0050E4C00067\",\n      \t\"idfa\": \"68753A44-4D6F-1226-9C60-0050E4C00067\",\n        \"age\": 29,\n        \"gender\": \"m\",\n  \t\t\t\"dnt\" : false\n    },\n    \"zid\": \"eayh1ApaOSjr4CZqzFmpwH1fNHGdbTRs9K40DXhq\",\n    \"fetch_num\": 1,\n    \"s2s_tracking\": false,\n}","name":null}]},"method":"post","auth":"required","params":[{"_id":"582c4badb2bed80f0086e14b","ref":"","in":"body","required":true,"desc":"Details of the app making this request","default":"","type":"object","name":"app"},{"_id":"582c4badb2bed80f0086e14a","ref":"","in":"body","required":true,"desc":"Details of the device from this request is coming","default":"","type":"object","name":"device"},{"_id":"582c4badb2bed80f0086e149","ref":"","in":"body","required":true,"desc":"Geo details of the request","default":"","type":"object","name":"geo"},{"_id":"582c4badb2bed80f0086e148","ref":"","in":"body","required":true,"desc":"Details of the user accessing your app while making this request","default":"","type":"object","name":"user"},{"_id":"582c4badb2bed80f0086e147","ref":"","in":"body","required":true,"desc":"This is the ad placement id that can be fetch from your dashboard as shown here : https://dev.getpolymorph.com/docs/publisher-faqs#4-how-to-get-placement-id-","default":"","type":"string","name":"zid"},{"_id":"5857b0359988d00f0055062e","ref":"","in":"body","required":false,"desc":"Number of ads to be returned by API","default":"","type":"int","name":"fetch_num"},{"_id":"5857b0359988d00f0055062d","ref":"","in":"body","required":false,"desc":"To enable/disable server-side impression & click tracking","default":"","type":"boolean","name":"s2s_tracking"}],"url":"/v1/ad.json"},"isReference":true,"order":1,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Request Parameters - Individual Object Parameters\"\n}\n[/block]\n**App Object Parameters**\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Required?\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"app_id\",\n    \"0-1\": \"String\",\n    \"0-2\": \"No\",\n    \"0-3\": \"Application ID\",\n    \"1-0\": \"store_id\",\n    \"1-1\": \"String\",\n    \"1-2\": \"No\",\n    \"1-3\": \"Store id, itunes_id in case iOS\",\n    \"2-0\": \"ver\",\n    \"2-1\": \"String\",\n    \"2-2\": \"Yes\",\n    \"2-3\": \"Application version\",\n    \"3-0\": \"bnid\",\n    \"3-1\": \"String\",\n    \"3-2\": \"Yes\",\n    \"3-3\": \"Bundle ID\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n**Device Object Parameters** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Required?\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"ua\",\n    \"1-0\": \"ip\",\n    \"2-0\": \"h\",\n    \"3-0\": \"w\",\n    \"4-0\": \"ort\",\n    \"5-0\": \"ct\",\n    \"6-0\": \"carrier\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Yes\",\n    \"0-3\": \"User Agent\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Yes\",\n    \"1-3\": \"User's IP address\",\n    \"2-1\": \"Int\",\n    \"3-1\": \"Int\",\n    \"4-1\": \"String\",\n    \"5-1\": \"String\",\n    \"6-1\": \"String\",\n    \"2-2\": \"No\",\n    \"3-2\": \"No\",\n    \"2-3\": \"Height of device display in pixels\",\n    \"3-3\": \"Width of device display in pixels\",\n    \"4-2\": \"No\",\n    \"4-3\": \"Orientation. \\\"v\\\" for vertical, \\\"h\\\" for horizontal\",\n    \"5-3\": \"Connection type. Accepted values are wifi, 5g, lte, 4g, 3g, 2g\",\n    \"6-3\": \"Carrier Name\",\n    \"5-2\": \"No\",\n    \"6-2\": \"No\",\n    \"7-0\": \"al\",\n    \"7-1\": \"String\",\n    \"7-2\": \"No\",\n    \"7-3\": \"Language setting e.g 'en-us'\"\n  },\n  \"cols\": 4,\n  \"rows\": 8\n}\n[/block]\n**Geo Object Parameters** \n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"lat\",\n    \"1-0\": \"lon\",\n    \"2-0\": \"lla\",\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Required?\",\n    \"h-3\": \"Description\",\n    \"0-1\": \"Float\",\n    \"1-1\": \"Float\",\n    \"2-1\": \"Float\",\n    \"0-2\": \"No\",\n    \"1-2\": \"No\",\n    \"2-2\": \"No\",\n    \"0-3\": \"Latitude of the device\",\n    \"1-3\": \"Longitude of the device\",\n    \"2-3\": \"Location accuracy\"\n  },\n  \"cols\": 4,\n  \"rows\": 3\n}\n[/block]\n**User Object Parameters** \n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Required?\",\n    \"h-3\": \"Description\",\n    \"0-0\": \"uuid\",\n    \"1-0\": \"idfa\",\n    \"2-0\": \"gaid\",\n    \"3-0\": \"dnt\",\n    \"0-1\": \"String\",\n    \"0-2\": \"Yes\",\n    \"0-3\": \"Universal unique ID. Pass idfa or gaid when available, otherwise pass a uuid generated by the app to allow things like frequency capping, unique ads rotation, etc.\",\n    \"1-3\": \"Id sanctioned for advertiser use (if sending request from iOS devices)\",\n    \"2-3\": \"Id sanctioned for advertiser use (if sending request from android devices)\",\n    \"1-2\": \"Required for iOS\",\n    \"2-2\": \"Required for Android\",\n    \"3-2\": \"No\",\n    \"1-1\": \"String\",\n    \"2-1\": \"String\",\n    \"3-1\": \"Boolean\",\n    \"3-3\": \"If user has chosen “Do Not Track”. Default value: false\"\n  },\n  \"cols\": 4,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response Parameters\"\n}\n[/block]\nThese are the parameters from ad response\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"status\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The status of the ad response. Returns ‘OK’ when a valid ad is present.\",\n    \"1-1\": \"Number of native ads returned.\",\n    \"1-0\": \"count\",\n    \"2-1\": \"content type of the ad. Possible values today are,\\n\\\"story\\\": This represents simple text and image based native ad,\\n\\\"lead_gen\\\": Any lead generation based native ad, \\n\\\"video\\\": Any video based native ad, \\n\\\"app_install\\\": Any app install based native ad, \\n\\\"banner\\\": Any banner ad\\n\\\"video_outstream\\\": Video only ad\\n\\nNOTE : \\\"lead_gen\\\" and \\\"app_install\\\" types are direct campaigns only, not marketplace\",\n    \"3-1\": \"title of the native ad.\",\n    \"2-0\": \"type\",\n    \"3-0\": \"title\",\n    \"4-1\": \"summary part of the native ad.\",\n    \"4-0\": \"summary\",\n    \"5-0\": \"imageSrc\",\n    \"6-0\": \"video\",\n    \"7-0\": \"url\",\n    \"8-0\": \"target\",\n    \"9-0\": \"backgroundColor\",\n    \"10-0\": \"brandImageUrl\",\n    \"11-0\": \"promotedBy\",\n    \"12-0\": \"promotedByTag\",\n    \"13-0\": \"promotedByUrl\",\n    \"14-0\": \"trackingTags\",\n    \"5-1\": \"URL of the image attached with native ad.\",\n    \"6-1\": \"Returns the video object to with all the asset details. Please refer to table 1.1 for details\",\n    \"7-1\": \"click URL for the whole native ad.\",\n    \"8-1\": \"after click action for the native ad. If it’s ‘_blank’, it should be opened in new window/view. If it’s ‘_parent’ or empty, it should be opened in the same window/view.\",\n    \"9-1\": \"Background color value set in Adsnative Dashboard for the ad unit. This allows you to control the background color of the ad unit from AdsNative Dashboard. You can choose to ignore this value\",\n    \"10-1\": \"URL of the brand image/logo.\",\n    \"11-1\": \"Name of the brand promoting the content.\",\n    \"12-1\": \"Prefix for the brand name configured in AdsNative Dashboard for the current ad unit. For e.g. ‘Promoted by’ or ‘Sponsored by’.\",\n    \"13-1\": \"click URL that needs to be called in case user clicks on either brand name or brand image.\",\n    \"14-1\": \"tags for tracking impression and third-party tracking. These are typically image or script tags that can droppped anywhere in the web page or in case of native platforms, within a 1x1 Web View. If you are looking for an alternative method for your platform, please contact AdsNative team for more options.\",\n    \"15-0\": \"viewableTags\",\n    \"15-1\": \"tags for tracking viewability according to MRC50 standards\",\n    \"16-0\": \"html\",\n    \"16-1\": \"In case of \\\"banner\\\" ad type, this parameter returns the final html to be rendered\"\n  },\n  \"cols\": 2,\n  \"rows\": 17\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Video Object (ad.video)\"\n}\n[/block]\nIn case ad is a video, you'll be getting following video ad object in response\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"sources\",\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Data type\",\n    \"0-1\": \"Array of strings\",\n    \"0-2\": \"List of transcoded video URLs for various video formats such as .mp4, .ogg, .webm. Typically .mp4 file always present and other formats are optionally provided depending on the setup.\",\n    \"1-0\": \"experience\",\n    \"1-1\": \"String\",\n    \"1-2\": \"Video experience that needs to be implemented. Possible values currently,\\n1. 'click_to_play': Allow users to initiate the video play\\n2. 'autoplay_inview': Play the video on mute when video is in user's viewport. Unmute when user fullscreens or hover's the cursor over the video and mute when its out of fullscreen. Video should pause when video is out of viewport.\",\n    \"2-0\": \"vastTags\",\n    \"2-1\": \"Array of strings\",\n    \"2-2\": \"List of VAST urls\",\n    \"3-0\": \"embedType\",\n    \"3-1\": \"String\",\n    \"3-2\": \"Type of the video. Possible values,\\n1. \\\"native\\\": In this case it returns transcoded video URLs in 'sources'\\n2. \\\"youtube\\\": In this case ad server returns youtube video URL in the 'sources'\\n3. \\\"iframe\\\": In this case ad server returns iframe embed url.\",\n    \"4-0\": \"trackingUrls\",\n    \"4-1\": \"Object\",\n    \"4-2\": \"This returns set of tracking URLs which needs to be fired on various events. Please refer to Table 1.1.1 for details\",\n    \"h-2\": \"Description\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Video Tracking object (ad.video.tracking)\"\n}\n[/block]\nIn addition to above video ad object, you'll get following tracking object to track video ads. Typically a GET request needs to be made for individual tracking URLs on respective events \n[block:parameters]\n{\n  \"data\": {\n    \"h-2\": \"Description\",\n    \"h-1\": \"Data Type\",\n    \"h-0\": \"Parameter\",\n    \"0-0\": \"duration\",\n    \"0-1\": \"object\",\n    \"0-2\": \"It returns various tracking URLs which need be fired when user has completed certain duration of the video. \\n1. \\\"complete\\\": Fired when video is completed\\n2. \\\"percentage\\\": Fired when certain percentage of video is completed\\n3. \\\"time\\\": Fired when certain time duration (in seconds) of video is completed\",\n    \"1-0\": \"impression\",\n    \"1-1\": \"Array of strings\",\n    \"1-2\": \"Fired when video is simply loaded on to the page\",\n    \"2-0\": \"clickThrough\",\n    \"2-1\": \"Array of strings\",\n    \"2-2\": \"Fired when user clicks on the video\",\n    \"3-0\": \"view\",\n    \"3-1\": \"Array of string\",\n    \"3-2\": \"Fired as soon as video starts playing\",\n    \"4-0\": \"userActions\",\n    \"4-1\": \"Object\",\n    \"4-2\": \"It returns various tracking URLs which need be fired when user takes various actions,\\n1. \\\"mute\\\": when user initiates mute on video\\n2. \\\"mute\\\": when user unmutes the video\\n3. \\\"fullscreen\\\": when user makes the video fullscreen\\n4. \\\"pause\\\": when user pauses the video\\n5. \\\"resume\\\": when user resumes the video.\"\n  },\n  \"cols\": 3,\n  \"rows\": 5\n}\n[/block]","excerpt":"This API is same as Ads API (web). It has the same endpoint too. However, native apps running on iOS, Android, Apple TV etc. need additional parameters that can be passed in an API call. Also, they need additional meta-data in the response to be able to do necessary ad stitching, especially for video formats. \n\nPlease note, the final ad stitching and rendering of the video is done at the client side.","slug":"ads-api-native-apps","type":"endpoint","title":"Ads API (Apps)"}

postAds API (Apps)

This API is same as Ads API (web). It has the same endpoint too. However, native apps running on iOS, Android, Apple TV etc. need additional parameters that can be passed in an API call. Also, they need additional meta-data in the response to be able to do necessary ad stitching, especially for video formats. Please note, the final ad stitching and rendering of the video is done at the client side.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

app:
required
object
Details of the app making this request
device:
required
object
Details of the device from this request is coming
geo:
required
object
Geo details of the request
user:
required
object
Details of the user accessing your app while making this request
zid:
required
string
This is the ad placement id that can be fetch from your dashboard as shown here : https://dev.getpolymorph.com/docs/publisher-faqs#4-how-to-get-placement-id-
fetch_num:
integer
Number of ads to be returned by API
s2s_tracking:
boolean
To enable/disable server-side impression & click tracking

Examples


Result Format


Documentation

[block:api-header] { "type": "basic", "title": "Request Parameters - Individual Object Parameters" } [/block] **App Object Parameters** [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Required?", "h-3": "Description", "0-0": "app_id", "0-1": "String", "0-2": "No", "0-3": "Application ID", "1-0": "store_id", "1-1": "String", "1-2": "No", "1-3": "Store id, itunes_id in case iOS", "2-0": "ver", "2-1": "String", "2-2": "Yes", "2-3": "Application version", "3-0": "bnid", "3-1": "String", "3-2": "Yes", "3-3": "Bundle ID" }, "cols": 4, "rows": 4 } [/block] **Device Object Parameters** [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Required?", "h-3": "Description", "0-0": "ua", "1-0": "ip", "2-0": "h", "3-0": "w", "4-0": "ort", "5-0": "ct", "6-0": "carrier", "0-1": "String", "0-2": "Yes", "0-3": "User Agent", "1-1": "String", "1-2": "Yes", "1-3": "User's IP address", "2-1": "Int", "3-1": "Int", "4-1": "String", "5-1": "String", "6-1": "String", "2-2": "No", "3-2": "No", "2-3": "Height of device display in pixels", "3-3": "Width of device display in pixels", "4-2": "No", "4-3": "Orientation. \"v\" for vertical, \"h\" for horizontal", "5-3": "Connection type. Accepted values are wifi, 5g, lte, 4g, 3g, 2g", "6-3": "Carrier Name", "5-2": "No", "6-2": "No", "7-0": "al", "7-1": "String", "7-2": "No", "7-3": "Language setting e.g 'en-us'" }, "cols": 4, "rows": 8 } [/block] **Geo Object Parameters** [block:parameters] { "data": { "0-0": "lat", "1-0": "lon", "2-0": "lla", "h-0": "Field", "h-1": "Type", "h-2": "Required?", "h-3": "Description", "0-1": "Float", "1-1": "Float", "2-1": "Float", "0-2": "No", "1-2": "No", "2-2": "No", "0-3": "Latitude of the device", "1-3": "Longitude of the device", "2-3": "Location accuracy" }, "cols": 4, "rows": 3 } [/block] **User Object Parameters** [block:parameters] { "data": { "h-0": "Field", "h-1": "Type", "h-2": "Required?", "h-3": "Description", "0-0": "uuid", "1-0": "idfa", "2-0": "gaid", "3-0": "dnt", "0-1": "String", "0-2": "Yes", "0-3": "Universal unique ID. Pass idfa or gaid when available, otherwise pass a uuid generated by the app to allow things like frequency capping, unique ads rotation, etc.", "1-3": "Id sanctioned for advertiser use (if sending request from iOS devices)", "2-3": "Id sanctioned for advertiser use (if sending request from android devices)", "1-2": "Required for iOS", "2-2": "Required for Android", "3-2": "No", "1-1": "String", "2-1": "String", "3-1": "Boolean", "3-3": "If user has chosen “Do Not Track”. Default value: false" }, "cols": 4, "rows": 4 } [/block] [block:api-header] { "type": "basic", "title": "Response Parameters" } [/block] These are the parameters from ad response [block:parameters] { "data": { "0-0": "status", "h-0": "Parameter", "h-1": "Description", "0-1": "The status of the ad response. Returns ‘OK’ when a valid ad is present.", "1-1": "Number of native ads returned.", "1-0": "count", "2-1": "content type of the ad. Possible values today are,\n\"story\": This represents simple text and image based native ad,\n\"lead_gen\": Any lead generation based native ad, \n\"video\": Any video based native ad, \n\"app_install\": Any app install based native ad, \n\"banner\": Any banner ad\n\"video_outstream\": Video only ad\n\nNOTE : \"lead_gen\" and \"app_install\" types are direct campaigns only, not marketplace", "3-1": "title of the native ad.", "2-0": "type", "3-0": "title", "4-1": "summary part of the native ad.", "4-0": "summary", "5-0": "imageSrc", "6-0": "video", "7-0": "url", "8-0": "target", "9-0": "backgroundColor", "10-0": "brandImageUrl", "11-0": "promotedBy", "12-0": "promotedByTag", "13-0": "promotedByUrl", "14-0": "trackingTags", "5-1": "URL of the image attached with native ad.", "6-1": "Returns the video object to with all the asset details. Please refer to table 1.1 for details", "7-1": "click URL for the whole native ad.", "8-1": "after click action for the native ad. If it’s ‘_blank’, it should be opened in new window/view. If it’s ‘_parent’ or empty, it should be opened in the same window/view.", "9-1": "Background color value set in Adsnative Dashboard for the ad unit. This allows you to control the background color of the ad unit from AdsNative Dashboard. You can choose to ignore this value", "10-1": "URL of the brand image/logo.", "11-1": "Name of the brand promoting the content.", "12-1": "Prefix for the brand name configured in AdsNative Dashboard for the current ad unit. For e.g. ‘Promoted by’ or ‘Sponsored by’.", "13-1": "click URL that needs to be called in case user clicks on either brand name or brand image.", "14-1": "tags for tracking impression and third-party tracking. These are typically image or script tags that can droppped anywhere in the web page or in case of native platforms, within a 1x1 Web View. If you are looking for an alternative method for your platform, please contact AdsNative team for more options.", "15-0": "viewableTags", "15-1": "tags for tracking viewability according to MRC50 standards", "16-0": "html", "16-1": "In case of \"banner\" ad type, this parameter returns the final html to be rendered" }, "cols": 2, "rows": 17 } [/block] [block:api-header] { "type": "basic", "title": "Video Object (ad.video)" } [/block] In case ad is a video, you'll be getting following video ad object in response [block:parameters] { "data": { "0-0": "sources", "h-0": "Parameter", "h-1": "Data type", "0-1": "Array of strings", "0-2": "List of transcoded video URLs for various video formats such as .mp4, .ogg, .webm. Typically .mp4 file always present and other formats are optionally provided depending on the setup.", "1-0": "experience", "1-1": "String", "1-2": "Video experience that needs to be implemented. Possible values currently,\n1. 'click_to_play': Allow users to initiate the video play\n2. 'autoplay_inview': Play the video on mute when video is in user's viewport. Unmute when user fullscreens or hover's the cursor over the video and mute when its out of fullscreen. Video should pause when video is out of viewport.", "2-0": "vastTags", "2-1": "Array of strings", "2-2": "List of VAST urls", "3-0": "embedType", "3-1": "String", "3-2": "Type of the video. Possible values,\n1. \"native\": In this case it returns transcoded video URLs in 'sources'\n2. \"youtube\": In this case ad server returns youtube video URL in the 'sources'\n3. \"iframe\": In this case ad server returns iframe embed url.", "4-0": "trackingUrls", "4-1": "Object", "4-2": "This returns set of tracking URLs which needs to be fired on various events. Please refer to Table 1.1.1 for details", "h-2": "Description" }, "cols": 3, "rows": 5 } [/block] [block:api-header] { "type": "basic", "title": "Video Tracking object (ad.video.tracking)" } [/block] In addition to above video ad object, you'll get following tracking object to track video ads. Typically a GET request needs to be made for individual tracking URLs on respective events [block:parameters] { "data": { "h-2": "Description", "h-1": "Data Type", "h-0": "Parameter", "0-0": "duration", "0-1": "object", "0-2": "It returns various tracking URLs which need be fired when user has completed certain duration of the video. \n1. \"complete\": Fired when video is completed\n2. \"percentage\": Fired when certain percentage of video is completed\n3. \"time\": Fired when certain time duration (in seconds) of video is completed", "1-0": "impression", "1-1": "Array of strings", "1-2": "Fired when video is simply loaded on to the page", "2-0": "clickThrough", "2-1": "Array of strings", "2-2": "Fired when user clicks on the video", "3-0": "view", "3-1": "Array of string", "3-2": "Fired as soon as video starts playing", "4-0": "userActions", "4-1": "Object", "4-2": "It returns various tracking URLs which need be fired when user takes various actions,\n1. \"mute\": when user initiates mute on video\n2. \"mute\": when user unmutes the video\n3. \"fullscreen\": when user makes the video fullscreen\n4. \"pause\": when user pauses the video\n5. \"resume\": when user resumes the video." }, "cols": 3, "rows": 5 } [/block]