Custom Ad Implementations via the 140 Proof API

140 Proof's API is REST –based and includes native bindings for iOS, PHP and Ruby. Publishers who wish to create custom implementations of 140 Proof social ads can fetch and display 140 Proof ads in a web-page or app by making a pair of calls: one call to /ads/user.json (or /ads/user.xml), and then a second call to a 140 Proof callback method when a user interacts with the ad.

NOTE. All custom implementations of the 140 Proof social ad unit must comply with all requirements in our Publisher Display terms of service. Please contact us if you have any questions or difficulties with your custom implementation and we'll be happy to help.

api.140proof.com/ads/user.format

Returns an ad for the requested user. Returns a 404 if the user does not exist, if the app ID is invalid, or if a targeted ad cannot be found for the user.

Supported Response Formats:
html, js, json, xml
Supported HTTP Methods:
GET
Parameters:
  • hb. Required. The public, numeric ID of Twitter user. Do not pass the alphanumeric screen_name, eg. "@jm3". Screen_names can change, but user IDs remain constant.
  • app_id. Required. The numeric ID of your application, as provided by 140 Proof. Use "Test" while testing.
  • unique_id. Required. A unique, anonymous number or string. Format varies by device platform and OS; contact your developer relations rep for details regarding what to pass here depending on your platform: developers @ 140proof . com.
  • width. Required ( html format only). The width, in pixels, of the requested ad unit (possible values: 960, 640, 480, 320, 240).
  • lat. Optional. The user's current latitude. Note: The valid ranges for latitude is -90.0 to +90.0 (North is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, or if there not a corresponding long parameter with this request.
  • long. Optional. The user's current longitude. Note: The valid ranges for longitude is -180.0 to +180.0 (East is positive) inclusive. This parameter will be ignored if outside that range, if it is not a number, or if there not a corresponding lat parameter with this request.
  • lang. Optional. Restricts ads to the given language, specified by an ISO 639-1 code.
  • jsonp. Optional. Specify the name of a callback function for a js response.
Usage examples:
curl "http://api.140proof.com/ads/user.html?hb=59593&app_id=test&unique_id=aaa-bbb-ccc&width=480"
curl "http://api.140proof.com/ads/user.js?hb=59593&app_id=test&unique_id=aaa-bbb-ccc&jsonp=callback"
curl "http://api.140proof.com/ads/user.json?hb=59593&app_id=test&unique_id=aaa-bbb-ccc"
curl "http://api.140proof.com/ads/user.xml?hb=59593&app_id=test&unique_id=aaa-bbb-ccc"

Example JSON Response