DAPP Online Api Integration Document

Catalogue

1.Integration Process

  1. Contact Our BD to create an account for you.
  2. The system will assign the sid, token, app_id4, adslot_id.
  3. Please follow the document for integration.
  4. Join debugging.

2.Attention

When you request ads in real time, fill in as many optional parameters as possible which can help us search the most match ads for you and increase your revenue. However, if you can`t get the value of optional parameters, please do not fill it in, which will indirectly reduce the revenue.

The ads request allows the server to initiate the request, but it must bring the real IP of client. The impression, click and conversion data must be reported by client, or it will be judged as fake users, which will indirectly reduce the revenue.

3.API

3.1 Ads Request

3.1.1 Request URL

PS: The system will assign the sid and token.

3.1.2 Request Method

POST

Header: Content-Type Value: application/json

3.1.3 Request Paramters

Parent ObjectObject / ParameterTypeRequiredDescription
idstringYesPublisher request id
appobjectYesObject APP.
appapp_idstringYesAPP ID, system assigned.testing app_id: 95caecceb1066c2b52665a2c85a959e4
appapp_bundle_idstringYesFor Android device, this is the package name. For IOS device, this is the bundle id.
appapp_namestringYesAPP Name
appstore_urlstringRecommendApp store URL for an installed app
appapp_categorystringNoString of IAB content categories that describe the current page or view of the app. Refer to list 5.1 APP Category Type
appapp_interaction_typearrayNoThe Interaction type supported by the app. Refer to list 5.2 APP Interaction Type
adslotobjectYesObject Ad slot.
adslotadslot_idstringYesAd slot id, system assigned. testing adslot_id. banner: 12001, native: 12002
adslotbannerobjectNoObject Banner/Interstitial.
adslot.bannerwidthintYesExact width in device independent pixels.
adslot.bannerheightintYesExact height in device independent pixels.
adslot.bannerpositionintNoBAd position on screen. Refer to list 5.3 Banner Type
adslotnativeobjectNoObject Native.
adslot.nativeassetsarrayYesArray assets for all you needed to generate the ad. Including Object title, Object img and Object data.
adslot.native.assetsidintYesThe id of asset for sorting all assets. which is marked by yourself.
adslot.native.assetsrequiredintYesMarking whether the asset you requested is required or not.where “1” = yes, “0” = no
adslot.native.assetstitleobjectNoObject Title
adslot.native.assets.titlelenintNoThe max lenght of title.
adslot.native.assetsimgobjectNoObject Img.
adslot.native.assets.imgtypeintYesThe type of image. where “1” = icon, “2” = logo, “3” = poster, “0” = known to be other.
adslot.native.assets.imgwidthintYesThe width of image.
adslot.native.assets.imgheightintYesThe height of image.
adslot.native.assetsdataobjectNoObject data. The description of ad or button.
adslot.native.assets.datatypeintYesData categories. Refer to list 5.4 Assets Data Type
adslot.native.assets.datalenintNoThe max lenght of data.
userobjectYesObject User
useruser_idstringYesThe user id defined by the publisher which must uniquely identify a user.
useripstringYesIPv4 address closest to device.
usergenderintYesGender, where “1” = male, “2” = female, “0” = known to be other.
useryobintNoYear of birth as a 4-digit integer.
deviceobjectYesObject Device
deviceuser_agentstringYesUser Agent
devicedevice_idarrayRecommendArray device id
device.device_idtypeintYesThe of device id. where “1” = IMEI, “2” = MAC address, “0” = known to be other.
device.device_ididstringYesValue of id.
deviceadvertising_idobjectYesObject advertising id
device.advertising_idtypeintYesType of advertising id.where “4” = Android GAID, “5” = IOS IDFA, “0” = known to be other.
device.advertising_ididstringYesValue of id.
devicegeoobjectRecommendObject Geo
device.geolatitudestringRecommendlatitude
device.geolongitudestringRecommendlongitude
device.geocountrystringRecommendCountry code using ISO-3166-1-alpha-3
device.geoRegionstringRecommendRegion code using ISO-3166-2 2-letter state code if USA.
devicedevice_typeintYesDevice type categories. Refer to list 5.5 Device Type
devicelanguagestringYesLanguage. Refer to list 5.6 Language
deviceosintYesDevice operating system. where “1” = IOS, “2” = Android, “0” = known to be other.
deviceos_versionstringYesDevice operating system version.
devicebrandstringNoThe brand of device.
devicemodelstringNoThe model of device.
devicescreen_widthintRecommendPhysical width of the screen in pixels.
devicescreen_heightintRecommendPhysical height of the screen in pixels.
devicescreen_densityintNoScreen size as pixels per linear inch.
devicecarrier_idstringYesCarrier id. Mobile carrier as the concatenated MCC-MNC code (e.g., “310-005” identifies Verizon Wireless CDMA in the USA). Refer to list MCC & MNC Code
devicewireless_network_typeintYesNetwork connection type. where “1” = WIFI, “2” = 2G, “3” = 3G, “4” = 4G, “5” = 5G, “0” = known to be other.
regsobjectYesObject Regs.
regscoppaintYesFlag indicating if this request is subject to the COPPA regulations established by the USA FTC, where 0 = no, 1 = yes.
regsgdprintNoFlag indicating if this request is subject to the GDPR regulations established by the EU, where 0 = no, 1 = yes.
tmaxintNoMaximum time in milliseconds allowed for response to be received including Internet latency to avoid timeout.
secureintNoFlag to indicate if the impression requires secure HTTPS URL creative assets and markup, where 0 = non-secure, 1 = secure. If omitted, the secure state is unknown, but non-secure HTTP support can be assumed.

3.1.4 Request Sample

3.1.4.1 Banner / Interstitial request sample

{
  "id": "fgasikutgasurebuifgsiuafgisua",
  "app": {
    "app_id": "95caecceb1066c2b52665a2c85a959e4",
    "app_bundle_id": "4767426574632874",
    "app_name": "Es File",
    "store_url": "https://play.google.com/store/apps/details?id=com.estrongs.android.pop",
    "app_category": "IAB20",
    "app_interaction_type": [
      1,
      2
    ]
  },
  "adslot": {
    "adslot_id": "12001",
    "banner": {
      "width": 320,
      "height": 50,
      "position": 1
    }
  },
  "user": {
    "user_id": "dsygfyad",
    "ip": "106.38.48.52",
    "gender": 1,
    "yob": 1990
  },
  "device": {
    "user_agent": "Mozilla/5.0*****",
    "device_id": [
      {
        "type": 1,
        "id": "2536643785678345673845"
      },
      {
        "type": 2,
        "id": "5C-FF-35-0B-95-B5"
      }
    ],
    "advertising_id": {
      "type": 4,
      "id": "ghdakgdhajgdajydg"
    },
    "geo": {
      "latitude": 56.223,
      "longitude": 112.848
    },
    "device_type": 1,
    "os": 1,
    "language": "zh",
    "os_version": "9.0.1",
    "brand": "xiaomi",
    "model": "hongmi",
    "screen_width": 640,
    "screen_height": 1136,
    "screen_density": 326,
    "carrier_id": "460-000",
    "wireless_network_type": 4
  },
  "regs": {
    "coppa": 0,
    "gdpr": 0
  },
  "tmax": 200,
  "secure": 1
}

3.1.4.1 Native request sample

{
  "id": "fgasikutgasurebuifgsiuafgisua",
  "app": {
    "app_id": "95caecceb1066c2b52665a2c85a959e4",
    "app_bundle_id": "4767426574632874",
    "app_name": "Es File",
    "store_url": "https://play.google.com/store/apps/details?id=com.estrongs.android.pop",
    "app_category": "IAB20",
    "app_interaction_type": [
      2
    ]
  },
  "adslot": {
    "adslot_id": "12002",
    "native": {
      "plcmttype": 1,
      "assets": [
        {
          "id": 1,
          "required": 1,
          "title": {
            "len": 256
          }
        },
        {
          "id": 2,
          "required": 1,
          "img": {
            "type": 1,
            "width": 75,
            "height": 75
          }
        },
        {
          "id": 3,
          "required": 1,
          "img": {
            "type": 3,
            "width": 320,
            "height": 240
          }
        },
        {
          "id": 4,
          "required": 1,
          "data": {
            "type": 2,
            "len": 256
          }
        }
      ]
    }
  },
  "user": {
    "user_id": "dsygfyad",
    "ip": "106.38.48.52",
    "gender": 1,
    "yob": 1990
  },
  "device": {
    "user_agent": "Mozilla/5.0 (Linux; U; Android 2.3.6; it-it; GT-S5570I Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1 (Mobile; afma-sdk-a-v6.1.0),gzip(gfe)",
    "device_id": [
      {
        "type": 1,
        "id": "2536643785678345673845"
      },
      {
        "type": 2,
        "id": "5C-FF-35-0B-95-B5"
      }
    ],
    "advertising_id": {
      "type": 4,
      "id": "dfc59c16-4435-48cb-98a9-9bdd06108077"
    },
    "geo": {
      "latitude": 56.223,
      "longitude": 112.848
    },
    "device_type": 1,
    "os": 1,
    "language": "CN",
    "os_version": "9.0.1",
    "brand": "xiaomi",
    "model": "hongmi",
    "screen_width": 640,
    "screen_height": 1136,
    "screen_density": 326,
    "carrier_id": "460-000",
    "wireless_network_type": 4
  },
  "regs": {
    "coppa": 0,
    "gdpr": 0
  },
  "tmax": 200,
  "secure": 1
}

3.1.5 Response Parameters:

Parent ObjectObject / ParameterTypeRequiredDescription
err_nointYesError No. Refer to list 5.7 Err No and Msg
err_msgstringYesError Message
dataidstringYesAd id
dataadsarrayNoArray ads
data.adsbanner_adobjectNoObject Banner / Interstitial
data.ads.banner_adhtml_snippetstringYesHtml snippet
data.ads.banner_adwidthintYesExact width in device independent pixels.
data.ads.banner_adheightintYesExact height in device independent pixels.
data.ads.banner_adimptrackersarrayYesArray impression tracker.
data.adsnative_adobjectNoObject Native.
data.ads.native_adassetsarrayYesArray assets
data.ads.native_ad.assetsidintYesThe id of asset for sorting all assets. which is marked by yourself.
data.ads.native_ad.assetsrequiredintYesMarking whether the asset you requested is required or not.where “1” = yes, “0” = no
data.ads.native_ad.assetstitleobjectNoObject Title
data.ads.native_ad.assets.titletitlestringNoTitle
data.ads.native_ad.assetsimgobjectNoObject Img.
data.ads.native_ad.assets.imgwidthintYesThe width of image.
data.ads.native_ad.assets.imgheightintYesThe height of image.
data.ads.native_ad.assets.imgurlstringYesThe url of image.
data.ads.native_ad.assetsdataobjectNoObject data.
data.ads.native_ad.assets.datavaluestringYesThe value of data.
data.ads.native_adtarget_urlstringYesTarget url(click url or tracking url)
data.ads.native_adimptrackersarrayYesArray impression tracker.
data.ads.native_adclicktrackersarrayYesArray click tracker.
data.adsdeeplink_infoobjectNoObject Deeplink
data.ads.deeplink_infodeeplink_urlstringYesDeeplink Url
data.ads.deeplink_infofallback_urlstringYesDeeplink Fallback Url. When deeplink failed, use the deeplink fallback url.

3.1.5 Response Sample

3.1.5.1 Banner / Interstitial response sample

{
  "data": {
    "ads": [
      {
        "banner_ad": {
          "html_snippet": "<!DOCTYPE html> <html> <head> <title></title> <meta name='viewport' content='user-scalable=0, minimum-scale=1.0, maximum- scale=1.0'/> <style type='text/css'> body {margin: 0; overflow: hidden;} </style> </head> <body> <style>.im_1664_ads-lbl,.im_1664_ads-lbl img{position:absolute;bottom:0;right:0;pointer-events:none;z-index:1000000000000000}.im_1664_ads-lbl img{width:26px;height:16px}</style> <div class='im_1664_ads-lbl'><img src='http://i.l.inmobicdn.net/ifctpads/IFC/CCN/assets/AdsiconHDPI1472034285.png'></div> <style> .inmC { margin-left: auto; margin-right: auto; display: block; }</style> <a href='https://play.google.com/store/apps/details?id=com.offline.miniocr' target='_top' style='text-decoration:none;'> <img border='0' class='inmC' src='http://dev-report.doadx.com/static/img/320_50.jpg' height='50' width='320' /> </a> <style>body{margin:0}</style> <img src='http://et-cn.w.inmobi.com/c.asm/C/t/ectjuimhah/1blu/w/4k/lx/m/r/0/0/ eyJVSUQiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIyNjYzRUEiLCJJREEiOiJGQzBGMzQ0NS0wRkNFLTQwRUUtODY0Ni0zQ0E4QkIy NjYzRUEifQ~~/ca0d9776-0159-1000-ee66-38a46c1e0093/-1/411p/-1/0/0/40.71269989013672,74.00589752197266,0.0/13779426/NW/2t/0/api/3.0.0/dir/ Y29tLmlubW9iaS5kZW1vYXBw/ FvCTCRYAFta48rroVFcAAAAAAADwPzQAEhg4NUxNdTREejQ0MmxZS3lZSXpNWHVkMG4yZUZuVEUxZ0gzZ1haQzlzS3g2ZC9tM2Qwd0grc3hRPT0YB kJBTk5FUhwUABQCHBwW_7-36r-itPJrFtndsvyC1-PgIwAWxN7fpp2TiM- yARUAEgAAOQUiFAAWloqp6t9RKD1wZXJmLWFkcG9vbC1za3lob29rcHJvZDUwMDJfcGVyZl9oa2cxX3BlcmYtYWRwb29sX3NreWhvb2twcm9kFAQSJpr 5FhwVAgAsFQIAUwEm8JMJFQASGAUwLjA3NQA=/-1/AA==/7/844b2836?m=18' width='1' height='1' style='display:none;' /> </body></html><img src=\"https://apac-trk.doadx.com/imp?&info=w4CM90WYmAjLw0TbmIDO5gjLw0TbiZSM9knYmETPmBnJOh0Q9MmJxADMyETPwZCNllTN5EWN4MmMhVjN2ITNiJzY2YDMxIWZjNWZhNWN50TYmgjMmRmNwADMlNzMzEWY5MWMyEDOllTZ3IGM0MGZycjY9Enc_w4nc&price=${AUCTION_PRICE}\"  width=\"1\" height=\"1\" style=\"display:none;\">",
          "img_url": "",
          "width": 320,
          "imptrackers": [
            "http://apac-trk.doadx.com/imp?&info==AjLw0TbmAjLw0TbiZCMwETP5JmJy0jZwZSPjZCMxkjM2ETPwZCNllTN5EWN4MmMhVjN2ITNiJzY2YDMxIWZjNWZhNWN50TYmcDZ4ATZ2YGNilTOidjZkFTYzQGZzUmM4ADO1M2NjVGZ9Enc_"
          ],
          "height": 50
        }
      }
    ],
    "id": "fgasikutgasurebuifgsiuafgisua"
  },
  "err_msg": "Success",
  "err_no": 1000
}

3.1.5.1 Native response sample

{
  "data": {
    "ads": [
      {
        "native_ad": {
          "assets": [
            {
              "id": 1,
              "title": {
                "title": "The Vicious Cycle Of Vaginal Infections"
              },
              "required": 1
            },
            {
              "img": {
                "width": 50,
                "url": "https://images2.zemanta.com/p/srv/sha/00/af/6c/28902411fa70b73aca75b2da2730553a99.jpg?w=75&h=75&fit=crop&crop=faces&fm=jpg",
                "height": 50
              },
              "id": 2,
              "required": 1
            },
            {
              "img": {
                "width": 600,
                "url": "https://images2.zemanta.com/p/srv/sha/00/af/6c/28902411fa70b73aca75b2da2730553a99.jpg?w=75&h=75&fit=crop&crop=faces&fm=jpg",
                "height": 280
              },
              "id": 3,
              "required": 1
            },
            {
              "data": {
                "value": "Restore and maintain a healthy balance of good bacteria and yeast for a healthy vagina"
              },
              "id": 4,
              "required": 1
            }
          ],
          "clicktrackers": [
            "https://do_global/track/url",
            "https://apac-trk.doadx.com/clk?&info=w4CM90WYmAjLw0TbmIDO5gjLw0TbiZSM9knYmETPmBnJOh0Q9MmJyADMyETPwZCNllTN5EWN4MmMhVjN2ITNiJzY2YDMxIWZjNWZhNWN50TYmAjNkZWO1cjN1cDOmJWZjJ2MjFGNwQzMzYjM5ETNidDM9Enc_w4nc&price=${AUCTION_PRICE}"
          ],
          "target_url": "https://r1.zemanta.com/r/u1qm61onnbb4/b1_rubicon/478563/7124557/C4NAONQHHBYL3S7WLF4ZSZFV2GCZFYDDINNXKVCYIRNEUYD76UZIU4TKSAJW5I6DUMYFEUW4AAP7HS7NCZP73SQOS4HY3VM5P76JCBIBX2GK7HGI2H5D3ZW2WT7XPKB2JM3G5VQUBQZSLQEITY7G2Y3D4XR7PO5YSC7WMQPTQVI3VIVYDYVSUMEIHQFGKDQZ55VIVS7AH73YDIBYA4O7PS4QPYK2YTNWBJJR4FCXMHCWD2X2DGSBYZGUFRWXOMA7C4UUZN2X2HWAXIT4PAZN7EYS5M7JQC2MGYPXC4NIB7XX476P7JOKRDVAXQRZGBHPCFB2JID3ZUBK77TXGWWS2J5L32MWS2R3FGYIXFNUOCGWEXKX765X5OAA4HL35XPQWEBWX2JLNM4O7T6UJ2YCDTBDH5FXATJUOO2OI7SGHQKTZOCT2PKYMEHAURNFNYTQ5FZNIE5FTAIGGIXCOWIWKWZBPU/",
          "imptrackers": [
            "https://apac-trk.doadx.com/imp?&info=w4CM90WYmAjLw0TbmIDO5gjLw0TbiZSM9knYmETPmBnJOh0Q9MmJyADMyETPwZCNllTN5EWN4MmMhVjN2ITNiJzY2YDMxIWZjNWZhNWN50TYmAjNkZWO1cjN1cDOmJWZjJ2MjFGNwQzMzYjM5ETNidDM9Enc_w4nc&price=${AUCTION_PRICE}"
          ]
        }
      }
    ],
    "id": "fgasikutgasurebuifgsiuafgisua"
  },
  "err_msg": "Success",
  "err_no": 1000
}

4. JS Tag

4.1 Attention

  • Doadx JS Tag supports the following ad formats: Banners、Interstitial.
  • You need to replace [adDivId] with the Div ID where the ad should be placed. Please use unique Div ID on one page.
  • The system will assign the [sid] [token] [app_id] [adslot_id] . You need to replace them with your own values.
  • You need to replace [app_bundle_id] with your actual package name or bundle id.
  • You need to replace [width] with an exact width in device and replace [height] with an exact height in device.

4.2 JS Network Tag in Mopub

  • Follow the instructions and use the below html tag to configure a third party network tag in Mopub.
  • The below html tag include the required parameters, you can append any of the recommended or optional parameters to increase your revenue. Please make sure to review and read through 3.1.3 Request Paramters.

Mopub JavaScript Network HTML

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
</head>
<body>

    <!-- Make sure you have replaced [adDivId] [sid] [token] [app_id] [adslot_id] [app_bundle_id] [width] [height] with your own values before setting it up in Mopub -->

    <!-- COPY FROM HERE - : JS Tag START -->

    <!-- [adDivId] The Div ID where the ad should be placed -->
    <div id="[adDivId]"></div>
    <script>
        var data = {
            "adDivId": "[adDivId]", // [adDivId] The Div ID where the ad should be placed
            "sid": "[sid]", // [sid] DAPP sid
            "token": "[token]", // [token] DAPP token
            "app": {
                "app_id": "[app_id]", // [app_id] DAPP app_id
                "app_bundle_id": "[app_bundle_id]" // [app_bundle_id] For Android device, this is the package name. For IOS device, this is the bundle id.
            },
            "adslot": {
                "adslot_id": "[adslot_id]", // [adslot_id] DAPP adslot_id
                "banner": {
                    "width": [width], // [width] Exact width in device independent pixels.
                    "height": [height] // [height] Exact height in device independent pixels.
                }
            },
            "user": {
                "ip": "%%IPADDRESS%%"
            },
            "device": {
                "user_agent": "%%USERAGENT%%",
                "device_id": [{
                    "id": "%eudid!"
                }],
                "advertising_id": {
                    "id": "%eudid!"
                }
            }
        };
        (function () {
            var script = document.createElement('script');
            script.onload = script.onreadystatechange = function () {
                if (script.readyState && /loaded|complete/.test(script.readyState)) {
                    script.onload = script.onreadystatechange = undefined;
                }
                script = undefined;
                DoadxJS.loadAd(data, function () {
                    // success passback
                    console.log("SUCCESS");
                }, function () {
                    // Mopub passback
                    loaded = true;
                    window.location = "mopub://failLoad";
                });
            };
            script.onerror = function () {
                script.onerror = undefined;
                document.body.removeChild(script);
                script = undefined;
            };
            script.type = 'text/javascript';
            script.charset = 'UTF-8';
            script.src = 'https://xyz.doadx.com/static/bundle.js?t=' + new Date().getTime();
            document.body.appendChild(script);
        })();
    </script>

    <!-- COPY TILL HERE -  : JS Tag END -->

    <!-- Make sure you have replaced [adDivId] [sid] [token] [app_id] [adslot_id] [app_bundle_id] [width] [height] with your own values before setting it up in Mopub -->

</body>
</html>

5.Appendix

5.1 APP Category Type

valueDescription
IAB1Arts & Entertainment
IAB2Automotive
IAB3Business
IAB4Careers
IAB5Education
IAB6Family & Parenting
IAB7Health & Fitness
IAB8Food & Drink
IAB9Hobbies & Interests
IAB10Home & Garden
IAB11Law, Gov’t & Politics
IAB12News
IAB13Personal Finance
IAB14Society
IAB15Science
IAB16Pets
IAB17Sports
IAB18Style & Fashion
IAB19Technology & Computing
IAB20Travel
IAB21Real Estate
IAB22Shopping
IAB23Religion & Spirituality
IAB24Uncategorized
IAB25Non-Standard Content
IAB26Illegal Content

5.2 APP Interaction Type

valueDescription
0Phone Call
1Download
2Deeplink

5.3 Banner Type

valueDescription
0Unknown
1Above the Fold
2DEPRECATED - May or may not be initially visible depending on screen size/resolution
3Below the Fold
4Header
5Footer
6Sidebar
7Full Screen

5.4 Assets Data Type

valueDescription
2The description of ad.
12The description of click button.
OtherClick for more

5.5 Device Type

valueDescription
0unknown
1Phone
2Tablet
3TV
4Other

5.6 Language

valueDescription
CNChinese
ENEnglish
JAJapanese
KOKorean
DEGerman
FRFrench
PTPortuguese
ITItalian

5.7 Err No and Msg

valueDescription
1000Sucess
1001Token error
1010Request JSON Body cannot be parsed correctly
1011Adslot obj has an error or doesn't exist
1012User obj has an error or doesn't exist
1013App obj has an error or doesn't exist
1014Device obj has an error or doesn't exist
1015Reg obj has an error or doesn't exist
2001hava no ad