|
ProtocolV2
Client/Server Protocol v2
AdWhirl Client/Server Protocol v2This document describes the AdWhirl client/server protocol v2. All communication is over HTTP, and all responses from the server are in JSON, so it is easy to implement a client for your platform of choice. If you run your own AdWhirl server instance, substitute *.adwhirl.com hostnames below with your hostname. Common FieldsSome fields that are used throughout the different requests.
Ad Network TypesEach ad network has a type value and a prefix. If you wish to include an additional network, please check with us first so we can give you an unused value.
Configuration RequestUpon initialization, application asks server for configuration information.
Response Fields:
Example Request Sent from the iPhone SDK, version 2.0.0 http://mob.adwhirl.com/getInfo?appid=35819838213a49a990e1050dd32d940d&appver=200&client=1 Example Response {
"extra":{"location_on":0,"background_color_rgb":{"red":255,"green":255,"blue":255,"alpha":1},"text_color_rgb":{"red":0,"green":0,"blue":0,"alpha":1},"cycle_time":30000,"transition":8},
"rations":[{"nid":"f90c2559167b4225aa5fff0e9a013cbb","nname":"admob","type":1,"weight":80,"priority":1,"key":"a213789152"},
{"nid":"e636a224704947b6b34cd17299f0047e","nname":"custom","type":9,"weight":20,"priority":2,"key":"__CUSTOM__"}]
}Custom Ad RequestClients send the following request to serve an AdWhirl custom ad. Location and location_timestamp are optional.
Response fields:
Example Request http://cus.adwhirl.com/custom.php?appid=35819838213a49a990e1050dd32d940d&nid=20e05c8704e0102d96dc5b26aef5c1e9&uuid=00000000000000000000000000000000&country_code=en_US&location=11.325432,-42.787399&location_timestamp=1265154619.172145&appver=200&client=1 Example Response {
"img_url":"http:\/\/s3.amazonaws.com\/adrollo-custom-images\/f2efe20429570a780d4581c9ad35417a.jpg",
"redirect_url":"http:\/\/www.yourlinkhere.com",
"metrics_url":"http:\/\/www.adwhirl.com\/exclick.php?nid=20e05c8704e0102d96dc5b26aef5c1e9&uuid=00000000000000000000000000000000&country_code=en_US&appver=200",
"ad_type":"1",
"ad_text":"",
"launch_type":1,
"webview_animation_type":4
}Metrics NotificationA metrics request should be sent after each impression and click.
Example Request http://met.adwhirl.com/exmet.php?appid=35819838213a49a990e1050dd32d940d&nid=f90c2559167b4225aa5fff0e9a013cbb&type=1&uuid=00000000000000000000000000000000&country_code=en_US&appver=200&client=1 |
In your configuration request example: http://mob.adwhirl.com/getInfo?aid=35819838213a49a990e1050dd32d940d&appver=200&client=1
I tried something similar, but it told me I had to use appid, not aid. I changed it and it worked.
Also, doing a custom ad request as you suggested, fails with: Unable to determine nid from appId
Why is the metrics Example Request's URL different than the metrics URL given in the Example Response for custom ad request? It looks like there is a mistake in the custom ad response example, isn't it?
bm
Hi. Where in which repository is
http://met.adwhirl.com/exmet.php
http://met.adwhirl.com/exclick.php http://cus.adwhirl.com/custom.php
and the other endpoints that are php files?
@ari6733, they're in the servers-mobile repo, and aren't actually php files. See: http://code.google.com/p/adwhirl/source/browse/src/Invoker.java?repo=servers-mobile
I don't understand the purpose of the nid field. If each network has a unique type and each app has a unique key for a network, what is the nid field used for? What does 'unique identifier for application's ad network mean?'. If this is a unique nw identifier, then what is type? oops too many ques. srry.