Actions

PublicAPIs

From SVG Media

Api Document Version 2

Objective - The objective of the document is to give you a detailed explanation about the working of the application programming interface which is being used to display various different kinds of creative in mobile app.

Usage of the Api - In order to make the api more versatile the api can be used from the Native Target SDK as well as from the other SDK by just using the appropriate format of the api call.

Display formats - Api can be used in order to support various different formats of the creative display.Following list shows various different creative types. 1.By Banner (i.e a particular banner . Static) 2.By Adwall (i.e linking of different Icon Images in order to give a proper Adwall. Start Index to Size) 3.Smart Add (i.e displaying of different ads based on some different criteria in order to increase the revenue) 4.Smart Adwall (i.e displaying of different adwall based on some different criteria in order to increase the revenue)


Get Hash Code -

In order to get the hashcode please login to your account in tyroocentral platform and follow the steps given in Appendix C


Creatives Types Supported - 1. Banner 2. Interstitial 3. Expandable 4. Dialog 5. Icon Images for adwall.



Url for sending the request -

www.tyroocentral.com/www/api/v3/API.php

The request will send by the post method. Flow Diagram For Api Hit -


Various request parameter for the response - The request parameters are in the form of JSON. You can request multiples creatives which you want to show in different screens in order to maintain a precaching of creatives to improve the speed of image display.


{

 "apiVersion": "2",
 "requestSource": "PUBLIC",
 "deviceX": "720",
 "deviceY": "1184",
 "language": "en",
 "deviceLanguage": "en",
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",
 "ads": [
   {
     "adViewId": "smartBanner",
     "excludedCreatives": [
       
     ],
     "startIndex": 0,
     "sendRepeat": false,
     "size": 10,
   }
 ],
 "isMobile": "true"

}


For more info of every node please see APPENDIX - B

● For Banner

{

 "apiVersion": "2",
 "requestSource": "PUBLIC",
 "deviceX": "720",
 "deviceY": "1184",
 "language": "en",
 "deviceLanguage": "en",
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",
 "ads": [
   {
     "adViewId": "smartBanner",
     "excludedCreatives": [
       
     ],
     "startIndex": 0,
     "sendRepeat": false,
     "size": 10,
     "isAdWall": false
   }
 ],
 "isMobile": "true"

}


● For Interstitial {

 "apiVersion": "2",
 "requestSource": "PUBLIC",
 "deviceX": "720",
 "deviceY": "1184",
 "language": "en",
 "deviceLanguage": "en",
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",
 "ads": [
   {
     "adViewId": "smartInterstitial",
     "excludedCreatives": [
       
     ],
     "startIndex": 0,
     "sendRepeat": false,
     "size": 10,
   }
 ],
 "isMobile": "true"

}



● For Expandable {

 "apiVersion": "2",
 "requestSource": "PUBLIC",
 "deviceX": "720",
 "deviceY": "1184",
 "language": "en",
 "deviceLanguage": "en",
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",
 "ads": [
   {
     "adViewId": "smartExpandable",
     "excludedCreatives": [
       
     ],
     "startIndex": 0,
     "sendRepeat": false,
     "size": 10,
   }
 ],
 "isMobile": "true"

}


● For Dialog {

 "apiVersion": "2",
 "requestSource": "PUBLIC",
 "deviceX": "720",
 "deviceY": "1184",
 "language": "en",
 "deviceLanguage": "en",
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",
 "ads": [
   {
     "adViewId": "smartDialog",
     "excludedCreatives": [
       
     ],
     "startIndex": 0,
     "sendRepeat": false,
     "size": 10,
   }
 ],
 "isMobile": "true"

}


● For Adwall

For adwall you have two option as follows-


1. Particular Adwall To use particular adwall please go to adwall tab from tyroocentral platform and make a new adwall. Get the zoneid of that particular adwall and place it in adViewId in ads node.

{

 "apiVersion": "2",
 "requestSource": "PUBLIC",
 "deviceX": "720",
 "deviceY": "1184",
 "language": "en",
 "deviceLanguage": "en",
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",
 "ads": [
   {
     "adViewId": "12344",
     "excludedCreatives": [
       
     ],
     "startIndex": 0,
     "sendRepeat": false,
     "size": 10,
   }
 ],
 "isMobile": "true"

}


2. Smart Adwall

{

 "apiVersion": "2",
 "requestSource": "PUBLIC",
 "deviceX": "720",
 "deviceY": "1184",
 "language": "en",
 "deviceLanguage": "en",
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",
 "ads": [
   {
     "adViewId": "smartAdwall",
     "excludedCreatives": [
       
     ],
     "startIndex": 0,
     "sendRepeat": false,
     "size": 10,
   }
 ],
 "isMobile": "true"

}










Response from the api -

● Banner

{

 "success": true,
 "updatelist": [
   {
     "placementid": "smartBanner",
     "adwallid": "",
     "imageattributes": [
       {
         "type": "small",
         "imageurl": "http:\/\/tyroocentral.com\/www\/delivery\/avw.php?zoneid=2081&bannerid=1723464840&deviceX=720&deviceY=1184&isMobile=true&appid=&type=small&cb=INSERT_RANDOM_NUMBER_HERE&mobility=1ab2"
       }
     ],
     "bannerid": "171234840",
     "refreshtime": -1,
     "targeturl": "http:\/\/localhost\/www\/delivery\/ckt.php?bannerid=1762345840&affid=1907&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams="
   }
 ]

}

● Interstitial

{

 "success": true,
 "updatelist": [
   {
     "placementid": "smartInterstitial",
     "adwallid": "",
     "imageattributes": [
       {
         "type": "large",
         "imageurl": "http:\/\/srv.tyroodr.com\/www\/delivery\/avw.php?zoneid=2081&bannerid=17614993&deviceX=720&deviceY=1184&isMobile=true&appid=&type=large&cb=INSERT_RANDOM_NUMBER_HERE&mobility=1ab2"
       }
     ],
     "bannerid": "17614993",
     "refreshtime": -1,
     "targeturl": "http:\/\/srv.tyroodr.com\/www\/delivery\/ckt.php?bannerid=17614993&affid=1907&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams="
   }
 ]

}


● Expandable

{

 "success": true,
 "updatelist": [
   {
     "placementid": "smartExpandable",
     "adwallid": "",
     "imageattributes": [
       {
         "type": "small",
         "imageurl": "http:\/\/srv.tyroodr.com\/www\/delivery\/avw.php?zoneid=2081&bannerid=17614999&deviceX=720&deviceY=1184&isMobile=true&appid=&type=small&cb=INSERT_RANDOM_NUMBER_HERE&mobility=1ab2"
       },
       {
         "type": "large",
         "imageurl": "http:\/\/srv.tyroodr.com\/www\/delivery\/avw.php?zoneid=2081&bannerid=17614999&deviceX=720&deviceY=1184&isMobile=true&appid=&type=large&cb=INSERT_RANDOM_NUMBER_HERE&mobility=1ab2"
       }
     ],
     "bannerid": "17614999",
     "refreshtime": -1,
     "targeturl": "http:\/\/srv.tyroodr.com\/www\/delivery\/ckt.php?bannerid=17614999&affid=1907&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams="
   }
 ]

}

● Dialog

{

 "success": true,
 "updatelist": [
   {
     "placementid": "smartDialog",
     "adwallid": "",
     "dialogattributes": {
       "title": "Hello Dialog",
       "message": "Single Button",
       "buttoncount": 1,
       "buttonattributes": [
         {
           "btntype": "positive",
           "label": "Click to Go"
         }
       ]
     },
     "imageattributes": {
       "type": "dialog",
       "imageurl": "http:\/\/srv.tyroodr.com\/www\/delivery\/avw.php?zoneid=2081&bannerid=17622487&deviceX=720&deviceY=1184&isMobile=true&appid=&type=small&cb=INSERT_RANDOM_NUMBER_HERE&mobility=1ab2&it=1",
       "height": 0,
       "width": 0
     },
     "bannerid": "17622487",
     "refrestime": -1,
     "targeturl": "http:\/\/srv.tyroodr.com\/www\/delivery\/ckt.php?bannerid=17622487&affid=1907&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams="
   }
 ]

}


● By Adwall

{

 "success": true,
 "updatelist": [
   {
     "placementid": "68",
     "adwallid": "9296",
     "imageattributes": {
       "type": "small",
       "imageurl": "http:\/\/cdn.tyroodr.com\/326a2a014d5ce076925351997ec7a7a8_resized_hdpi.png"
     },
     "adwallappattributes": {
       "title": "99 Acres",
       "subtitle": "The new 99acres Android app is here to take your property search experience mobile. Now you can search and discover properties even on the go. 99acres mobile app makes it extremely easy to search buy, sell or rent property in India.",
       "actiontype": "click"
     },
     "bannerid": "17615003",
     "refreshtime": -1,
     "targeturl": "http:\/\/srv.tyroodr.com\/www\/delivery\/ckt.php?bannerid=17615003&affid=1907&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams="
   },
   {
     "placementid": "68",
     "adwallid": "9296",
     "imageattributes": {
       "type": "small",
       "imageurl": "http:\/\/cdn.tyroodr.com\/c9a0850349b8209a260b4ae997089b0e_resized_hdpi.png"
     },
     "adwallappattributes": {
       "title": "Candy Crush Saga",
       "subtitle": "Candy Crush Saga, from the makers of Pet Rescue Saga & Farm Heroes Saga!",
       "actiontype": "click"
     },
     "bannerid": "17615007",
     "refreshtime": -1,
     "targeturl": "http:\/\/srv.tyroodr.com\/www\/delivery\/ckt.php?bannerid=17615007&affid=1907&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams="
   }
 ]

}


Using Native Target Api -

Description - Using the api to get the appropriate response.

public void postData() {

   // Create a new HttpClient and Post Header
   HttpClient httpclient = new DefaultHttpClient();
   HttpPost httppost = new HttpPost("http://www.tyroocentral.com/www/api/v3/API.php");
   try {
       // Add your data
       List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
       nameValuePairs.add(new BasicNameValuePair("requestParams", "jsonRequest"));
       httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
       // Execute HTTP Post Request
       HttpResponse response = httpclient.execute(httppost);
      
   } catch (ClientProtocolException e) {
       // TODO Auto-generated catch block
   } catch (IOException e) {
       // TODO Auto-generated catch block
   }

}


Example

Lets go through an example for the detail understanding.

public void postData() {

   // Create a new HttpClient and Post Header
   HttpClient httpclient = new DefaultHttpClient();
   HttpPost httppost = new HttpPost("http://www.tyroocentral.com/www/api/v3/API.php");
   String jsonRequest  = “”; //Add ur Json request Here
   try {
       // Add your data
       List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
       nameValuePairs.add(new BasicNameValuePair("requestParams", "jsonRequest"));
       httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
       // Execute HTTP Post Request
       HttpResponse response = httpclient.execute(httppost);
      
   } catch (ClientProtocolException e) {
       // TODO Auto-generated catch block
   } catch (IOException e) {
       // TODO Auto-generated catch block
   }

}



Appendix A

Details of the json response.

1. Json Response of the Expandable Ad Output.


{

 "success": true,(Resembles that the api hit was successful)
 "updatelist": {
   "ImageAttributes": [
     {
       "type": "small",(Resembles that the ImageAttributes are for banner Ad)
       "imageurl": "http://localhost/tc/www/delivery/avw.php?zoneid=11&bannerid=17604598&deviceX=1080&deviceY=1920&isMobile=true&appid=&type=small&cb=INSERT_RANDOM_NUMBER_HERE&mobility=1ab2",(Resembles that the ImageUrl is for banner Ad)
      
     },
     {
       "type": "large",(Resembles that the ImageAttributes are for Interstitial Ad)
       "imageurl": "http://localhost/tc/www/delivery/avw.php?zoneid=11&bannerid=17604598&deviceX=1080&deviceY=1920&isMobile=true&appid=&type=large&cb=INSERT_RANDOM_NUMBER_HERE&mobility=1ab2",(Resembles that the ImageUrl is for banner Ad)
      
     }
   ],
   "bannerid": "17604598",(Resembles the banner id of Ad)
   "refreshTime": -1,(Resembles the refresh time of Ad)
   "targetUrl": "http://localhost/www/delivery/ckt.php?bannerid=17604598&affid=7&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams=" (Resembles the target Url of Ad)
 }

}

2. Json Response of the Dialog Ad Output.

{

 "success": true,(Resembles that the api hit was successful)
 "updatelist": {
    "DialogAttributes": {(Resembles the Dialog Attributes)
     "title": "Title",(Resembles the title of the dialog)
     "message": "Message",(Resembles the message of the dialog)
     "buttonCount": 2,(Resembles the number of buttons of the dialog)
     "ButtonAttributes": [(Resembles the button Attributes of the dialog)
       {
         "btnType": "positive",(Resembles the button Type)
         "label": "yes"(Resembles the button Label)
       }
     ]
   },
   "bannerText": "Message",(Resembles the banner text of Ad)
   "refreshTime": -1,(Resembles the Refresh Time of Ad)
   "targetUrl": "http://localhost/www/delivery/ckt.php?bannerid=17604723&affid=7&subid1=&subid2=&subid3=&subid4=&subid5=&optionalParams="(Resembles the target Url of the Ad)
 }

}













APPENDIX B

{

 "apiVersion": "2", (Resembles api version for the request)
 "requestSource": "PUBLIC",(Resembles that the request is from public api)
 "deviceX": "720",(Resembles the device width)
 "deviceY": "1184",(Resembles the device height)
 "language": "en",(Resembles the language requested from application)
 "deviceLanguage": "en",(Resembles the device language of the user)
 "hashCode": "QEfsvzlPUxYgTztRTOi8OkZMC0Lo/hITQjjsQhI+ErfCDz1DDwm1vgwTFg0ZQjwOO7u/CBAQQAPk6z5IQxDrGAwN",(Resembles the hashcode of the user)
 "ads": [
   {
     "adViewId": "smartDialog",(Resembles the requested creative type)
     "excludedCreatives": [
       12345677,
     ],(Resembles the banners which are not requested)
     "startIndex": 0,(Resembles the startIndex used only in adwall)
     "sendRepeat": false,(Resembles that whether you want one creative in the request or two)
     "size": 10,(Resembles the size used only in adwall)
   }
 ],
 "isMobile": "true"(Resembles the request is from mobile)

}










APPENDIX - C

Step 1 -



Step 2 -

Step 3 -