Ad Request API Documentation
The API accepts simple GET OR POST requests, with optional / required parameters in the query string portion of the URL. The parameters must be encoded as name/value pairs using the standard HTTP URL-encoding principles.
Response format
The response format for all requests is a JSON object.
Whether a request succeeded is indicated by the HTTP status code. A 2xx status code indicates success, whereas a 4xx status code indicates failure.
Ad-Request URL
All API access is over HTTPS or HTTP, you'll need to issue a HTTP GET or POST Request to the following URL:
http://mobile.mng-ads.com/?[requiredandoptionalkeyvaluepairs]
Ad-Request Parameters
Parameter name | Required? | Format | Description |
---|---|---|---|
rt | Yes | string, api_mediation or appsfire-v2-api | appsfire-v2-api for nativead only (app install) |
u | Yes | string, URL-encoded User Agent | Pass the url-encoded User Agent of the requesting device in this parameter. e.g. &u=Mozilla%2F5.0+%28iPhone%3B+U%3B+C. |
s | Yes | string | Zone code. This parameter should be the unique Publisher ID of your mobile application or website. |
i | Yes for rt=api , rt=appsfire-v2-api, api_mediation only | string | use api_mediation for S2S mediation, api for use Madvertise adserving only or appsfire-v2-api in order to use appsfire only |
v | Yes | string | Version of the client sdk. For logging purpose in the web server logs |
c_mraid | No | 0/1 | Specify whether your mobile site / app is able to show MRAID ad responses. |
c_vast | No | 0/2 | Specify whether your mobile site / app is able to show VAST2 or VAST3 ad responses. API can return vastinline with c_vast=2 and only external url for c_vast=1 |
o[idfa] | No | string | Id(s) of the device / user. iOS |
o[andadvid] | No | string | Google Advertising ID |
o[ip] | No | string | alias of i parameter |
lat | Yes, if available | Decimal | The Users Geo-Location (latitude in degrees WGS84). |
lon | Yes, if available | Decimal | The Users Geo-Location (longitude in degrees WGS84). |
connection_type | No | string | Connection type. One of those values UNKNOWN, WIFI, 3G, 4G |
seenad[adid1] | No | Integer for key, Timestamp for value | Use for capping, this array contains ads seen with associated timestamp. &seenad[adid1]=timestamp1 &seenad[adid2]=timestamp2 Each adid is available response of Ad request |
gender | No | string, M/F | Gender of the user. M for male, F for female. |
age | No | Integer | The user's age, if available |
zip | No | String | The user's zip code, if available |
jsvar | Yes if rt=javascript | String | The name of javascript variable, Ad is returned in this variable in order to inject the code on publisher mobile site. |
w | No | integer | DThe Width of your Ad Space. This is also the maximum banner size that our servers will return. Useless for appsfire nativead |
h | No | integer | The Height of your Ad Space. This is also the maximum banner size that our servers will return. Useless for appsfire nativead |
carrier | No | String | Carrier name of mobile end-user |
appName | No | string | Name of app where SDK in used |
bundleId | No | string | packageName for android and ituneId for IOS |
locale | No | string | language code used on phone (e.g fr) |
accept_retargeting | Yes for rt=android_app_json or ios_app_json | int | default value is 1, it must be set to 0 if the user has limited ad tracking ( Google AdvertisingIdClient) or IOS advertisingTrackingEnabled |
osVersion | No | string | version of OS e.g 9.1 |
tgt | No | urlencoded string | Keyword targeting allows you to display ads only when specific keywords or key/value pairs are passed in the ad request e.g adobeSegmentId%3D1%3Bcat%3Ddemo for adobeSegmentId=1;cat=demo |
c_video | No | 0/1 | Specify whether your mobile site / app is able to show video |
gdpr | yes | 0/1 | 0: not in GDPR scope or 1: in GDPR scope |
consent[0][format]= | yes | IAB | We manage IAB consentString only |
consent[0][value] | yes | BONlRnIONlRnIAAABAENAAAAAAAAoAA | Encoded consent String IAB spec |
Interstitials
curl http://mobile.mng-ads.com?rt=android_app&v=6.0.0&u=Dalvik%2F1.6.0%20(Linux%3B%20U%3B%20Android%204.3%3B%20GT-I9300%20Build%2FJSS15J)&s=[YOUR_PLACEMENT_ID]&o%5Bandadvid%5D=732503e0-f8df-498b-b9a9-0cbce96394ec&long=5.9889615&lat=43.1377518&age=25&gender=M&c.mraid=1
Interstitial Image Ad
{
"type": "interstitial",
"format": "image",
"mraid": false,
"vast": false,
"content": "<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\"><style>* { -webkit-tap-highlight-color: rgba(0,0,0,0);} img {width:100%} body {margin: 0; padding: 0}</style></head><body style=\"margin:0;padding:0;\"><a id=\"mAdserveAdLink\" href=\"http://mobile.mng-ads.com/click/1455397457X56X169X10X309X15X5180317X36X8525X0X2X2X8525X0X1X0X5180317X30Hb2e601d82d4f19a1bdfb2863702fe7063e106f17?o[andadvid]=41c7fa2a-e967-46fd-9520-9869d4a10c9d\" target=\"_self\"><img id=\"mAdserveAdImage\" src=\"http://cdn.mng-ads.com/25b3b31f81909a7584866fbd9f7c7434309.jpg\" border=\"0\" style=\"width:100%;max-width:360px;height: 592px;\"/></a></body></html>",
"contentUrl": "http://cdn.mng-ads.com/25b3b31f81909a7584866fbd9f7c7434309.jpg",
"clickurl": "http://mobile.mng-ads.com/click/1455397457X56X169X10X309X15X5180317X36X8525X0X2X2X8525X0X1X0X5180317X30Hb2e601d82d4f19a1bdfb2863702fe7063e106f17?o[andadvid]=41c7fa2a-e967-46fd-9520-9869d4a10c9d",
"impurl": [
"http://mobile.mng-ads.com/display/1455397457X56X169X10X309X15X5180317X36X8525X0X2X2X8525X0X1X0X5180317X30Hb2e601d82d4f19a1bdfb2863702fe7063e106f17"
],
"impscript": [
"<img src=\"http:\/\/secure-cert.imrworldwide.com\/cgi-bin\/m?ci=nlsnci535&am=3&at=view&rt=banner&st=image&ca=nlsn13134&cr=crtve&pc=madvertise_plc0001&ce=madvertise&r=[timestamp]\" style=\"display:none\"\/> "
],
"refresh": "0",
"clicktype": "inapp",
"preload": 0,
"autoclose": 0,
"adid": "169",
"tagline": null,
"background": "#FFFFFF",
"adspaceWidth": "768",
"adspaceHeight": "1024",
"orientation": "portrait",
"closePosition": "top-right",
"closeAppearanceDelay": "0",
"duration": "0",
"animation": "none"
}
Interstitial Html Ad
{
"type": "interstitial",
"format": "html",
"mraid": false,
"vast": false,
"content": "<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\"><style>* { -webkit-tap-highlight-color: rgba(0,0,0,0);} img {width:100%} body {margin: 0; padding: 0}</style></head><body style=\"margin:0;padding:0;\"><div style=\"width:100%;max-width:360px;height: 592px;\"><!DOCTYPE html>\r\n<html>\r\n <head>\r\n <title>Demo</title>\r\n <meta charset=\"utf-8\">\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\r\n <meta name=\"description\" content=\"Demo project\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\r\n <style type=\"text/css\"></style>\r\n </head>\r\n <body>\r\n <table>\r\n<thead>\r\n<tr>\r\n<th><strong>Macro</strong></th>\r\n<th><strong>Description</strong></th>\r\n</tr>\r\n</thead>\r\n<tbody>\r\n<tr>\r\n<td>mngads:click</td>\r\n<td>our click url</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:deviceid</td>\r\n<td>Id(s) of the device / user. iOS or Google Advertising ID</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:userlat</td>\r\n<td>The Users Geo-Location (latitude in degrees WGS84).</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:userlon</td>\r\n<td>The Users Geo-Location (longitude in degrees WGS84).</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:adid</td>\r\n<td>Creative ID (identifier for your banner id associated to the click id)</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:locale</td>\r\n<td>anguage code used on phone (e.g fr)</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:os</td>\r\n<td>OS of user</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:osVersion</td>\r\n<td>version of OS e.g 9.1</td>\r\n</tr>\r\n<tr>\r\n<td>mngads:bundleId</td>\r\n<td>packageName for android and ituneId for IOS</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n </body>\r\n <script type=\"text/javascript\"></script>\r\n</html></div></body></html>",
"contentUrl": "",
"clickurl": "http://mobile.mng-ads.com/click/1455397844X56X250X10X470X15X5180317X36X8525X0X2X2X8525X0X1X0X5180317X30H0fd023b2cda14df07f97a2c4f13a5ead6377099e?o[andadvid]=41c7fa2a-e967-46fd-9520-9869d4a10c9d",
"impurl": [
"http://mobile.mng-ads.com/display/1455397844X56X250X10X470X15X5180317X36X8525X0X2X2X8525X0X1X0X5180317X30H0fd023b2cda14df07f97a2c4f13a5ead6377099e"
],
"impscript": [
"<img src=\"http:\/\/secure-cert.imrworldwide.com\/cgi-bin\/m?ci=nlsnci535&am=3&at=view&rt=banner&st=image&ca=nlsn13134&cr=crtve&pc=madvertise_plc0001&ce=madvertise&r=[timestamp]\" style=\"display:none\"\/> "
],
"refresh": "0",
"clicktype": "inapp",
"preload": 0,
"autoclose": 0,
"adid": "250",
"tagline": null,
"background": "#FFFFFF",
"adspaceWidth": "0",
"adspaceHeight": "0",
"orientation": "portrait",
"closePosition": "top-right",
"closeAppearanceDelay": "0",
"duration": "0",
"animation": "none"
}
Interstitial VAST video
For inline VAST contentUrl is empty and xml VAST available on content
{
type: "interstitial",
format: "vast",
mraid: false,
content: "",
contentUrl: "http://ads.stickyadstv.com/www/delivery/swfIndex.php?reqType=AdsSetup&protocolVersion=2.0&zoneId=206813",
clickurl: "https://mobile.mng-ads.com/click/...?o%5Bidfa%5D=2CF0B5BB-59AC-4232-8A43-80E050E8B2AF&gender=M&carrier=Free&model=iPhone+6+Plus",
impurl: [
"https://mobile.mng-ads.com/display/....?o%5Bidfa%5D=2CF0B5BB-59AC-4232-8A43-80E050E8B2AF&gender=M&carrier=Free&model=iPhone+6+Plus"
],
"impscript": [
],
refresh: "0",
clicktype: "inapp",
preload: 0,
autoclose: 0,
adid: "4293",
publisherid: "3180317",
tagline: null,
background: "#FFFFFF",
adspaceWidth: "0",
adspaceHeight: "0",
"adchoiceposition": "top-right",
"orientation": "portrait",
"closePosition": "top-right",
"closeAppearanceDelay": "0",
"duration": "0",
"videosettings": {
"autoplay": 1,
"audio": "muted",
"blur": 1,
"radius": "15",
"opacity": "0"
}
}
Banners
curl http://mobile.mng-ads.com?rt=android_app&v=6.0.0&u=Dalvik%2F1.6.0%20(Linux%3B%20U%3B%20Android%204.3%3B%20GT-I9300%20Build%2FJSS15J)&s=[YOUR_PLACEMENT_ID]&o%5Bandadvid%5D=732503e0-f8df-498b-b9a9-0cbce96394ec&long=5.9889615&lat=43.1377518&age=25&gender=M&c.mraid=1&x=360&y=50
Banner Image Ad
{
"type": "banner",
"format": "image",
"mraid": false,
"vast": false,
"content": "<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\"><style>* { -webkit-tap-highlight-color: rgba(0,0,0,0);} img {width:100%} body {margin: 0; padding: 0}</style></head><body style=\"margin:0;padding:0;\"><a id=\"mAdserveAdLink\" href=\"http://mobile.mng-ads.com/click/1455398033X56X1308X10X1858X15X5180317X35X8525X0X2X2X8525X0X1X0X5180317X30H8a28a98565c212c2fe6b4f609b575a032486f651?o[andadvid]=41c7fa2a-e967-46fd-9520-9869d4a10c9d\" target=\"_self\"><img id=\"mAdserveAdImage\" src=\"http://cdn.mng-ads.com/10/1308-1858.jpg\" border=\"0\" style=\"width:100%;max-width:360px;height: 592px;\"/></a></body></html>",
"contentUrl": "http://cdn.mng-ads.com/10/1308-1858.jpg",
"clickurl": "http://mobile.mng-ads.com/click/1455398033X56X1308X10X1858X15X5180317X35X8525X0X2X2X8525X0X1X0X5180317X30H8a28a98565c212c2fe6b4f609b575a032486f651?o[andadvid]=41c7fa2a-e967-46fd-9520-9869d4a10c9d",
"impurl": [
"http://mobile.mng-ads.com/display/1455398033X56X1308X10X1858X15X5180317X35X8525X0X2X2X8525X0X1X0X5180317X30H8a28a98565c212c2fe6b4f609b575a032486f651",
"http://www.mobilenetworkgroup.com/test"
],
"impscript":[
"<img src=\"http:\/\/secure-cert.imrworldwide.com\/cgi-bin\/m?ci=nlsnci535&am=3&at=view&rt=banner&st=image&ca=nlsn13134&cr=crtve&pc=madvertise_plc0001&ce=madvertise&r=[timestamp]\" style=\"display:none\"\/> "
],
"refresh": "0",
"clicktype": "inapp",
"preload": 0,
"autoclose": 0,
"adid": "1308",
"tagline": null,
"background": "#FFFFFF",
"adspaceWidth": "320",
"adspaceHeight": "50"
}
Banner Html Ad
{
"type": "banner",
"format": "html",
"mraid": false,
"vast": false,
"content": "<!DOCTYPE html><html><head><meta name=\"viewport\" content=\"width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0\"><style>* { -webkit-tap-highlight-color: rgba(0,0,0,0);} img {width:100%} body {margin: 0; padding: 0}</style></head><body style=\"margin:0;padding:0;\"><div style=\"width:100%;max-width:360px;height: 592px;\"><script type=\"text/javascript\" src=\"http://ec2-52-12-133-166.us-west-2.compute.amazonaws.com/banner/web/bn.js?id=dbb9359\"></script></div></body></html>",
"contentUrl": "",
"clickurl": "http://mobile.mng-ads.com/click/1455397972X56X1959X10X2672X15X5180317X35X8525X0X2X2X8525X0X1X0X5180317X30H5fb7db83f5f905eb5e73e2319d9b343208317c2c?o[andadvid]=41c7fa2a-e967-46fd-9520-9869d4a10c9d",
"impurl": [
"http://mobile.mng-ads.com/display/1455397972X56X1959X10X2672X15X5180317X35X8525X0X2X2X8525X0X1X0X5180317X30H5fb7db83f5f905eb5e73e2319d9b343208317c2c"
],
"refresh": "0",
"clicktype": "inapp",
"preload": 0,
"autoclose": 0,
"adid": "1959",
"tagline": null,
"background": "#FFFFFF",
"adspaceWidth": "0",
"adspaceHeight": "0"
}
appsfire NativeAd
curl http://mobile.mng-ads.com/?rt=appsfire-v2-api&i=78.232.65.223&u=Mozilla%2F5.0%20(Linux%3B%20U%3B%20Android%205.0.2%3B%20fr-fr%3B%20XT1072%20Build%2FLXB22.99-24.12)%20AppleWebKit%2F533.1%20(KHTML%2C%20like%20Gecko)%20Version%2F4.0%20Mobile%20Safari%2F533.1&s=[YOUR_PLACEMENT_ID]&v=6.0.0&c_mraid=1&o%5Bandadvid%5D=4908b7b8-08aa-4a08-8003-031c2d7f1ae9&accept_retargeting=0&connection_type=WIFI&long=5.9888646&lat=43.1378641&macAddress=e4%3A90%3A7e%3A18%3A01%3Adb&w=360&h=592&carrier=&appName=MNGAdsServer&bundleId=com.mngads.mngadsserver&locale=fr&osVersion=5.0.2
{
"type":"nativeAd",
"title":"Star Wars\u2122: Galaxy of Heroes",
"description":"May the force be with you!",
"categoryid":"JEUX DE R\u00f4LES",
"category":"Jeux de r\u00f4les",
"iconurl":"https:\/\/lh3.googleusercontent.com\/64RrPLGYj_V9e9Ku8bEemPY_cMEhdKpYkUBA49XczVAQBl1-6B8nEf-4paL2EPXQpbI",
"iconsurl":[
],
"bundleid":"com.ea.game.starwarscapital_row",
"clickurl":"http:\/\/mobile.mng-ads.com\/click\/1453475776X56X1819X287X2504X15X5180317X1912X8525X0X6X2X8525X0X1X0X5180317X30H82c262207653dc0643fa3cb475daca48d9a75b8c?o[andadvid]=4908b7b8-08aa-4a08-8003-031c2d7f1ae9&pfid={mngadspfid}",
"impurl":[
"http:\/\/mobile.mng-ads.com\/display\/1453475776X56X1819X287X2504X15X5180317X1912X8525X0X6X2X8525X0X1X0X5180317X30H82c262207653dc0643fa3cb475daca48d9a75b8c"
],
"refresh":"0",
"autoclose":0,
"price":"0",
"adid":"1819",
"publisherid": "3180317",
"autoplay": 0,
"screenshotUrls":[
"https:\/\/lh3.googleusercontent.com\/6vhbqD1-dM9Q4mazbpdiFjgLGgs-YkxkCCOC7XbnPhUFhIsqJpcN68MGGracVpdmgQA=h256-rw",
"https:\/\/lh3.googleusercontent.com\/nUnXJUQNuilIXKnZNxrfm4abk5TVzdATASqKBtC-h2tkljULjwT_us_JuY-3Td66UIku=h256-rw",
],
"videoUrls": [
"https://creative.mng-ads.com/media/viking.mp4"
],
"closePosition":"top-left",
"closeAppearanceDelay":"0",
"duration":"0",
"userRatingCount":"627208",
"averageUserRating":4.5885605812073,
"contentRating":"PEGI\u00a012"
}
No ad available
When there is no ad available for your ad-request, the following JSON is returned:
{
error: "No available ad"
}
Appsfire direct clickurl
We can provide an appsfire clickurl. This url is used to run a specific appsfire campaign without ad-request API call. This url can be used as:
Parameter name | Required? | Format | Description |
---|---|---|---|
s | Yes | string | Zone code. This parameter should be the unique Publisher ID of your |
adid | Yes | int | Adunit ID. This parameter is provided by mng/appsfire team per campaign |
o[idfa] | No | string | Id(s) of the device / user. iOS |
o[andadvid] | No | string | Google Advertising ID |
arg1 | Custom Value 1 | string | e.g clicid={arg1} if you need to retrieve your clickid |
arg2 | Custom Value 2 | string | |
arg3 | Custom Value 3 | string | in most case we use to store your publisherId (sub publisherId for us) |
arg4 | Custom Value 4 | string | in most case we use to store your publisherId (sub sub publisherId for us) |
arg5 | Custom Value 5 | string | |
arg6 | Custom Value 6 | string | |
arg7 | Custom Value 7 | string | |
arg8 | Custom Value 8 | string | |
arg9 | Custom Value 9 | string | |
arg10 | Custom Value 10 | string |
https://mobile.mng-ads.com/appsfireclicks/?adid=1&s=/3180317/interstitial/af&o[andadvid]=4908b7b8-&arg1={YOUR_CLICKID}&arg2={YOUR_CUSTOM_VALUE}&arg3={YOUR_PUBLISHERID}&arg4={YOUR_CUSTOM_VALUE}
Appsfire impression url
Impression pixel redirect URL for S2S connected sources that contains parameters similar to appsfireclicks
https://mobile.mng-ads.com/performancedisplay/?adid=1&s=/3180317/interstitial/af&o[andadvid]=4908b7b8-&arg1={YOUR_CLICKID}&arg2={YOUR_CUSTOM_VALUE}&arg3={YOUR_PUBLISHERID}&arg4={YOUR_CUSTOM_VALUE}
Postback Settings
If you want to be notified when conversion occurs fill the URL of your server that our system should call.
http://myserver.com/postback/?clicid={arg1}&campaign={arg2}&revenu={price}
Available params for postback url are:
Macro | Description | Example |
---|---|---|
{unixtimestamp} | Number of seconds since the epoch | 1457427080 |
{idfa} | IDFA (Identifier for advertising - iOS) | 4C8A85C6-AEEE-425B-9DBA-B02C1A9CAB55 |
{andadvid} | GAID (Google Advertising ID - Android) | 732503e0-f8df-498b-b9a9-0cbce96394ec |
{ip} | DEVICE IP (IP address of the device) | 216.58.212.78 |
{device} | Device (Device model) | iPhone 6 |
{mngadsclickid} | CLICK ID (Internal unique click ID) | 1446566252X5388...cc4bbe9f50fa |
{appid} | the application id as it appears in Google play or App store | 543864084 or com.baobab.android.grandmatips |
{price} | revenue generated by postback for you | 3.10 |
{arg1} | Custom Value 1 added on clickurl | e.g clicid={arg1} if you need to retrieve your clickid |
{arg2} | Custom Value 2 added on clickurl | |
{arg3} | Custom Value 3 added on clickurl | |
{arg4} | Custom Value 4 added on clickurl | |
{arg5} | Custom Value 5 added on clickurl | |
{arg6} | Custom Value 6 added on clickurl | |
{arg7} | Custom Value 7 added on clickurl | |
{arg8} | Custom Value 8 added on clickurl | |
{arg9} | Custom Value 9 added on clickurl | |
{arg10} | Custom Value 10 added on clickurl |
If you need clicid={arg1} on your postback url, you must add on clickurl from ad-request
http://mobile.mng-ads.com/click/1457424571X5101X2020X525X2737X5754X2330955X42914X8525X0X6X2X8525X0X34X0X2330955X30Hf86ba4d0210f2cc68441065df8a75d53656be378?o[andadvid]=4908b7b8-08aa-4a08-8003-031c2d7f1ae9&arg1={yourclickid}