This document describes the communication with mobile supply partners. They can send us their mobile inventory/traffic and we will reply with our best ad offer.
With API integration, Publishers and Supply partners are able to quickly and efficiently monetize their mobile apps/traffic, without the need to use an SDK. The API is based on standard HTTP protocol (RESTful call), making integration and maintenance incredibly simple.
The full API specification, and how to integrate it into you mobile app, can be found below.

How to integrate Adcash API

In order to start using the Adcash in­app API, you first need a zone ID.​The zone ID is a unique identifier, which is assigned to every Publisher zone on the Adcash platform, allowing us to track and record
statistics.

Obtaining your Zone ID

If you already have an active zone, and want to use it with the API, follow these steps to locate your zone ID:

  1. Login to your Adcash account
  2. Click Zones​ in the top menu bar
  3. Locate the Zone you wish to start using with our API and look in the ID column: this number is your zone ID​.

If you need to create a new zone for an existing app:

  1. Login to your Adcash account
  2. Select Create new zone​ from the Zones submenu
  3. Choose the app from the dropdown list
  4. Choose the ad type you want to integrate (in­app footer or interstitial)
  5. Click Create new zone
  6. Your zone will then be created and a zone ID generated.

N.B. If you want to receive ads from different formats, e.g. InApp Interstitial, InApp Footer (iOS and Android Apps submitted respectively), you need to have separate zones for each of them.

If you have not yet submitted the app you wish to monetize, please follow the instructions below:

  1. Login to your Adcash account
  2. Select Apps ​from the Account ​menu
  3. Click Add application
  4. Complete the fields displayed on screen and click Submit App
  5. Your app will then be submitted for review by our team and once it has been approved you will be able to create your Zone ID (see above)

N.B. It is very important that the URL included in your mobile app submission is correct. If it is incorrect, your submission may be delayed or rejected.

Creating your ad request URL and query string

Once you have your zone IDs created, next you need to create your ad request URL and the appropriate query string.
The request URL for the API is: http://api.sdk.cash/s2s/api.php
Please note:​ The advertisement request could be submitted as either ​HTTP GET or POST. The mandatory and optional parameters that need to be passed in the query string are detailed below.
You should then use the parameters detailed below to create your query string.

Parameter Value & Description Required Example
r Zone ID for ad unit Yes 1461185
udid IDFA, advertising identifier Yes for iOS: E269C15F-C995-4179-B82D-6FB6AB3288B7
for Android: ifa:9105626d-f083-4dac-a550-600bfb30348c
s2s Server to Server IMPORTANT: Use always 1.5 Yes Always use 1.5
ip IP address of the user. We will determine Geo details (country, city, carrier) Yes 123.98.78.124
ua User-Agent used to determine platform and browser for targeting Yes Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7
sdk_bn App package name Yes com.adcash.sketch
dnt Limited Ad Tracking Yes 0 or 1
sub1 ID of the placement Yes 1234abcd, highly recommended
sub2 ID of the ad network. If you are selling on behalf of another network No 4321abcd

Below is an example of an Adcash API ad request URL and query string:
where HTTP-TOKEN can be obtained from your Adcash Account Manager.

curl -H "HTTP-TOKEN: fd6aa53dd6642783858a0de833439b30" 'http://api.sdk.cash/s2s/api.php?r=1461185&ip=123.98.78.124&ua=Mozilla/5.0%20(Macintosh;%20Intel%20Mac%20OS%20X%2010_11_1)%20AppleWebKit/601.2.7%20(KHTML,%20like%20Gecko)%20Version/9.0.1%20Safari/601.2.7&udid=ifa:3Ad830e1f6-a33b-485c-b171-6cf2fcd6357&s2s=1&sdk=1.5&sdk_bn=com.adcash.sketch&dnt=0'

Ad response API

When your ad request URL is triggered, the response will consist of HTML code containing you advertisement. In Android or iOS, you could use WebView​to display it.

Sample ad responses

Banner

<html> 
     <head> 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
     <meta name="viewport" content="user-scalable=no, width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/> 
     <script type="text/javascript" src="mraid.js"></script> 
     <style type="text/css"> 1
     html, body 
     { 
     margin: 0; 
     padding: 0; 
     width: 100%; 
     height: 100%; 
     } 
     #banner 
     { 
     display: block; 
     margin: auto; 
     text-align: center; 
     z-index: 1000; 
     width: 100%; 
     height: 100%; 
     position: relative; 
     } 
     #banner img 
     { 
     max-width: 100%; 
     max-height: 100%; 
     height: auto; 
     top: 50%; 
     left: 50%; 
     -webkit-transform: translate(-50%, -50%); 
     transform: translate(-50%, -50%); 
     position: absolute; 
     } 
     </style> 
     </head> 
     <body> 
     <div id='banner'> 
     <a href="http://mob.adcash.com/?k=550fdec8b49202645163.4064595&h=d43b4dcdf2f55b2773b5a4b1d2dc9a7e0445139d&ban=2645163&r=409358&iid=14271034321568360355207044324&ci=%3Ds1WWwBBfdkSDJEBKYBHE8VRIN0UXNEVARgCWwBBfJ1TSh0RTdFBdxBBkRgCbZBHE81RKNkQEogFWIBEewBBfVESDN1VDRFQEowHf8xHfwBBfJ1TSh0RTdFBdxBBlRgCbZBHE81RKNkQEogFWIBEewBBfVESDN1VDRFQEowHf8xHfwBBfJ1TSh0RTdFBdxBB8RQX&ps=%3D%3DABfR1RUlkVLNkU5hUSPJVRPJ0QUZFB&pm=EIlSTdEQDJEB&udid=ifa:d830e1f6-a33b-485c-b171-6cf2fcd6357f" target="_blank"><img border="0" src="http://www.adcash.com/ban/4064496/728x90-24d569ef30441ef9eb365d285adb1365.png" /></a> 
     </div> 
     </body> 
  </html>

Interstitial

<html> 
     <head> 
     <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"> 
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
     <meta name="viewport" content="user-scalable=no, width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> 
     <style type="text/css"> 
     html, body { 
     margin: 0; 
     padding: 0; 
     width: 100%; 
     height: 100%; 
     } 
     #banner { 
     display: block; 
     margin: auto; 
     text-align: center; 
     z-index: 1000; 
     width: 100%; 
     height: 100%; 
     position: relative; 
     } 
     #banner img 
     { 
     display: block; 
     position: absolute; 
     /margin: auto;/ 
     top: 0; 
     left: 0; 
     right: 0; 
     bottom: 0; 
     width: 100%; 
     } 
     </style> 
     </head> 
     <body> 
     <div id="banner"> 
     <a href="http://mob.adcash.com/?k=550fdf66d00973593188.4412637&h=4bfe629fc2417465a4d04e7f57d341836a6bdbb8&ban=3593188&r=409357&iid=14271035901568360355862043932&ci=%3D%3DwWbZBHE81RKNkQEogFcQwXFh0QTd1QUBEBKYBHE8lUPJFSHN1VE0FHEQGBKslFcQwXHp0QCRgCWYhEQ4BHE8VRIN0UXNEVARgCXwBBfJ1TSh0RTdFBdxBBlRgCbZBHE81RKNkQEogFWIBEewBBfVESDN1VDRFQEowHf8xHfwBBfJ1TSh0RTdFBdxBB8RQX&ps=%3D%3DABfR1RUlkVLNkU5hUSPJVRPJ0QUZFB&pm=EIlSTdEQDJEB&udid=ifa:d830e1f6-a33b-485c-b171-6cf2fcd6357f" target="_blank"><div id="int_image" style="background: center/contain no-repeat url(http://www.adcash.com/ban/4412538/interstitial_800x600.gif);height:100%" style="margin: auto;"></div></a> 
     </div> 
     <script type="text/javascript"> 
     var isIOS = (/iphone|ipad|ipod/i).test(window.navigator.userAgent.toLowerCase()); 
     var newsdk = true; 
     if (isIOS)//for some reason interstitial webview works differently for ios and android 
     { 
     var img = document.getElementById('int_image'); 
     img.style.margin = 'auto'; 
     } 
     else if(newsdk) 
     { 
     setImageArea(); 
     window.onresize = function() { 
     setImageArea(); 
     }; 
     } 
     function setImageArea() 
     { 
     if (!isIOS) 
     { 
     var screenHeight = screen.height; 
     var density = window.devicePixelRatio; 
     var newHeight = 320; 
     if (typeof(screenHeight) !== "undefined" && typeof(density)) 
     { 
     newHeight = Math.round(screenHeight/density); 
     } 
     var img = document.getElementById('int_image'); 
     img.style.height = newHeight + "px"; 
     } 
     } 
     </script> 
     </body> 
  </html>

Rewarded Video

<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="//adcash.com/vast3.xsd"
      version="3.0">
    <Ad id="46581334">
        <InLine>
            <AdSystem version="1.0">Adcash</AdSystem>
            <Error>
                <![CDATA[http://adcash.com/ad/display.php?stamat=m%7C%2C%2CQiKS43LitGU3B59GH0dEdHP3xP.aef%2Ctk6OPywhzR7HwhgHn16BG1TEVpSsET2msNpJd546rjKwkQ87V-A6EwuiaPgMV1A2tGmojdJgU0Tv5aqwYBoFhdGQcM1EevcNQlaxhyOYx-voy4lqeJtvgR0nZ6fnYOlWpdxCE6hPBThhTLEKM-VLH3iWodPDBckgeEcq0fnjtIKRUX_omSgHpoaTqW_SzNc5ZfUuC3JypIpbPWH_Lx6zA1rn_lC4eE7I_5j5TWCRtf0hNqB9GRbmZYUCvwSir-97fSJIUrWlxExlpFEX8UuS8kgPCSy9UTyotdAAgZ9kflX2O_z2pY01L77c1TDtCPz_jopp1SjZdhJl3n2KKbfzlg%2C%2C&verrorcode=[ERRORCODE]]]>
            </Error>
            <Impression><![CDATA[http://adcash.com/ad/display.php?stamat=m%7C%2C%2CQiKS43LitGU3B59GH0dEdHP3xP.aef%2Ctk6OPywhzR7HwhgHn16BG1TEVpSsET2msNpJd546rjKwkQ87V-A6EwuiaPgMV1A2tGmojdJgU0Tv5aqwYBoFhdGQcM1EevcNQlaxhyOYx-voy4lqeJtvgR0nZ6fnYOlWpdxCE6hPBThhTLEKM-VLH3iWodPDBckgeEcq0fnjtIKRUX_omSgHpoaTqW_SzNc5ZfUuC3JypIpbPWH_Lx6zA1rn_lC4eE7I_5j5TWCRtf0hNqB9GRbmZYUCvwSir-97fSJIUrWlxExlpFEX8UuS8kgPCSy9UTyotdAAgZ9kflX2O_z2pY01L77c1TDtCPz_jopp1SjZdhJl3n2KKbfzlg%2C%2C&vau=[ASSETURI]&vprog=[CONTENTPLAYHEAD]]]></Impression>
            <Creatives>
                <Creative id="17376845" sequence="1">
                    <Linear>
                        <Duration>00:00:10</Duration>
                        <TrackingEvents>
                            <Tracking event="start">
                                <![CDATA[http://adcash.com/ad/display.php?stamat=m%7C%2C%2CQiKS43LitGU3B59GH0dEdHP3xP.aef%2Ctk6OPywhzR7HwhgHn16BG1TEVpSsET2msNpJd546rjKwkQ87V-A6EwuiaPgMV1A2tGmojdJgU0Tv5aqwYBoFhdGQcM1EevcNQlaxhyOYx-voy4lqeJtvgR0nZ6fnYOlWpdxCE6hPBThhTLEKM-VLH3iWodPDBckgeEcq0fnjtIKRUX_omSgHpoaTqW_SzNc5ZfUuC3JypIpbPWH_Lx6zA1rn_lC4eE7I_5j5TWCRtf0hNqB9GRbmZYUCvwSir-97fSJIUrWlxExlpFEX8UuS8kgPCSy9UTyotdAAgZ9kflX2O_z2pY01L77c1TDtCPz_jopp1SjZdhJl3n2KKbfzlg%2C%2C&ve=start&vau=[ASSETURI]&vprog=[CONTENTPLAYHEAD]]]>
                            </Tracking>
                            <Tracking event="skip">
                                <![CDATA[http://adcash.com/ad/display.php?stamat=m%7C%2C%2CQiKS43LitGU3B59GH0dEdHP3xP.aef%2Ctk6OPywhzR7HwhgHn16BG1TEVpSsET2msNpJd546rjKwkQ87V-A6EwuiaPgMV1A2tGmojdJgU0Tv5aqwYBoFhdGQcM1EevcNQlaxhyOYx-voy4lqeJtvgR0nZ6fnYOlWpdxCE6hPBThhTLEKM-VLH3iWodPDBckgeEcq0fnjtIKRUX_omSgHpoaTqW_SzNc5ZfUuC3JypIpbPWH_Lx6zA1rn_lC4eE7I_5j5TWCRtf0hNqB9GRbmZYUCvwSir-97fSJIUrWlxExlpFEX8UuS8kgPCSy9UTyotdAAgZ9kflX2O_z2pY01L77c1TDtCPz_jopp1SjZdhJl3n2KKbfzlg%2C%2C&vau=[ASSETURI]&ve=skip&vprog=[CONTENTPLAYHEAD]]]>
                            </Tracking>
                            <Tracking event="pause">
                                <![CDATA[http://adcash.com/ad/display.php?stamat=m%7C%2C%2CQiKS43LitGU3B59GH0dEdHP3xP.aef%2Ctk6OPywhzR7HwhgHn16BG1TEVpSsET2msNpJd546rjKwkQ87V-A6EwuiaPgMV1A2tGmojdJgU0Tv5aqwYBoFhdGQcM1EevcNQlaxhyOYx-voy4lqeJtvgR0nZ6fnYOlWpdxCE6hPBThhTLEKM-VLH3iWodPDBckgeEcq0fnjtIKRUX_omSgHpoaTqW_SzNc5ZfUuC3JypIpbPWH_Lx6zA1rn_lC4eE7I_5j5TWCRtf0hNqB9GRbmZYUCvwSir-97fSJIUrWlxExlpFEX8UuS8kgPCSy9UTyotdAAgZ9kflX2O_z2pY01L77c1TDtCPz_jopp1SjZdhJl3n2KKbfzlg%2C%2C&vau=[ASSETURI]&ve=pause&vprog=[CONTENTPLAYHEAD]]]>
                            </Tracking>
                            <Tracking event="resume">
                                <![CDATA[http://adcash.com/ad/display.php?stamat=m%7C%2C%2CQiKS43LitGU3B59GH0dEdHP3xP.aef%2Ctk6OPywhzR7HwhgHn16BG1TEVpSsET2msNpJd546rjKwkQ87V-A6EwuiaPgMV1A2tGmojdJgU0Tv5aqwYBoFhdGQcM1EevcNQlaxhyOYx-voy4lqeJtvgR0nZ6fnYOlWpdxCE6hPBThhTLEKM-VLH3iWodPDBckgeEcq0fnjtIKRUX_omSgHpoaTqW_SzNc5ZfUuC3JypIpbPWH_Lx6zA1rn_lC4eE7I_5j5TWCRtf0hNqB9GRbmZYUCvwSir-97fSJIUrWlxExlpFEX8UuS8kgPCSy9UTyotdAAgZ9kflX2O_z2pY01L77c1TDtCPz_jopp1SjZdhJl3n2KKbfzlg%2C%2C&vau=[ASSETURI]&ve=resume&vprog=[CONTENTPLAYHEAD]]]>
                            </Tracking>
                        </TrackingEvents>
                        <VideoClicks>
                            <ClickThrough>
                                <![CDATA[http://adcash.com/ad/display.php?stamat=m%7C%2C%2CQifX4iP-tGU3B_9GH0dEdHP3xP.18f%2CGUKiUXX1ivrBlgmuMWymhqsiPq-ZzvCI7KJUhMwQxZ8_R-DtpI9JFOZpHebOpRCUzR1lRUa-YoPqxR-YYHuimtsclG0GcrBb1fUEgreO7oWh27a9rOdwGOUxx54bNV679JwcuxdsT4Ks_tMxXLqouJHShJxWyM9HcgMmxLSbG58s9FsGR5VSGUctxeIIDkFBHBIOBSv5P4ZKH2ZShu7TgeacOJpoPQv6JF_9c_o3DQ21FBVKMr1gaoHBUqiBoD0NwKtR1BWjTiQQS0G2KV1p9g4EWpfNZSCcQAKqTtDdidbKdl4HmVSkQLRC5MDFKFxg]]>
                            </ClickThrough>
                        </VideoClicks>
                        <MediaFiles>
                            <MediaFile delivery="progressive" bitrate="596" width="426" height="240" type="video/mp4">
                                <![CDATA[http://media.objectdisplay.com/1000008_201705181254480_99982500_1495104888/adcash_test_clip_hi-Low.mp4]]>
                            </MediaFile>
                            <MediaFile delivery="progressive" bitrate="1128" width="854" height="480" type="video/mp4">
                                <![CDATA[http://media.objectdisplay.com/1000008_201705181254480_99982500_1495104888/adcash_test_clip_hi-Medium.mp4]]>
                            </MediaFile>
                            <MediaFile delivery="progressive" bitrate="1628" width="1280" height="720" type="video/mp4">
                                <![CDATA[http://media.objectdisplay.com/1000008_201705181254480_99982500_1495104888/adcash_test_clip_hi-High.mp4]]>
                            </MediaFile>
                        </MediaFiles>
                    </Linear>
                </Creative>
            </Creatives>
        </InLine>
    </Ad>
</VAST>

Native

[{"button":"download","click_url":"http:\/\/adcash.com\/ad\/display.php?stamat=m%7C%2C%2CQhd_dhE6oGU3B09GH0dEdHP3xP.f06%2CLk0U2ydAMUL6HicUA4Dvsw2p6LBGlT7OAi21pgmCB_IwJlYIxuazmPRjiXhfnCEVMQ11O6NDc2XGU6bkZpSCS5lTeiUTQ31gwZx_ppYpw9LbzEN4VKPNf2wuVkg2P7Go3s1Vi5mTedaxcQ30EPejDEww1eY3w1J3B792ia_oKQv85Km1jDRQSINeYI-U1fmk5Qm5Z0Cto1XcCf9i2Lsm4QDwe4cJMqBtKTCuCvAlKoYo_1sReLFVqdQa66Bo9sAxp7q7xRfQg9RGmXDrFXODoCQvZcIYFUnkUy-FZXptvjQUOcPlKLF5sOPQ7xPwS66pqRdJduXn4-kwBoDfduncEyMomjeaabCBAmutKBbqZNQ%2C","description":"Sketch &#39;n&#39; go is a sketch-like drawing app","impression_urls":["http:\/\/adcash.com\/script\/i.php?stamat=m%7C%2C%2CAiImI2d7oGU3BJ9GH0dEdHP3xP.cc8%2C2g71eNZEZ3xU7DheaxestYhYfkxEuYJ9uZYeS-XFOTD1Xb_e2mlXtMAfHePL7-nXtB7A-kOulBDTlmidiQscYT5SvOghxKnb3zwlHftajspqiTrWsqMjbuz6QijBl5v-TtGYcYYmqI47d3HgRMTKcDneJKAFFoJQBQnxMDmnaHMXOHb0wPYivKKp0up646U1lTrJo2PW1NOXSne2uAb7mzhDvfzCz9v5tmCNUYJbePd6P7JN8sjfFCr9k80FVRJij3FDazCdOxfBSxXIG8AL6qcyuYo0UdZyW7d0QFpgsBuFiSSFtKgcylMUMbo779tl3G0szzvsz9H4eP8EgCZ9GcGKmangjATwU77ZDbLFQKn-BsNpRjuiKWUzQWUek_s9R8yOh_6tOm_6aZqdDWXCQA%2C%2C"],"name":"Sketch 'n' go","rating":"3.82","rating_pc":76,"show_rating":1,"images":[{"file":"http:\/\/cloud.cashtrafic.info\/extban\/44288134\/creatives\/16261588\/a1d28d0e59667d15e9ef542b0f02137d_4026.png","is_icon":1},{"file":"http:\/\/cloud.cashtrafic.info\/extban\/44288134\/creatives\/16261588\/c4d72c955418a2325472e51f1541695e_2166.jpg","is_icon":0}]}] 

Error codes

Examples of different error codes

204

In the event of the platform being unable to deliver an Advertiser for your zone, it will respond with a “no content” error code:
Status Code: 204 no content
Example:

urlConnection.getResponseCode()=204

400

In the case of an incorrect request being received, the system will return a “general error” code.
Status Code: 400 Bad Request
Example:

urlConnection.getResponseCode()=400

401

In the case of an unauthorized request being received, the system will return an “unauthorized error” code.
Status Code: 401 Unauthorized (Bad authentication token (HTTP­TOKEN)
Example:

urlConnection.getResponseCode()=401

Please note. The examples provided above are for informational purposes only, and may vary depending on the method you have used to integrate the API into your application.

Incorrect/Missing Zone ID

In the event of the zone ID being missing or incorrect, the system will return the following error:

urlConnection.getResponseCode()=404