Sample Python Code for Reporting
The following is sample Python code for reporting using UDID, MAC, ODIN, IFA:

import hmac

import hashlib

import base64

from urllib import urlencode, urlopen

 

app_token = "93d29fe5d41541e7af30a1f6e6551659"

app_secret = "0b846fa56611497596bde28d752f263e"

device   = "af4a1778ea9e138ef4cd13c0bc6dbdb560e3caaa"

ifa = "EFA299E8203742BD9E39BC08471142B6"

mac = "d8d1cba2a7a7"

odin = "04f6e929111b132880d656a0480cb5091cfd6ad0"

nonce  = "1857940124"

 

api = "http://partner-api.playhaven.com/v4/advertiser/open?{args}"

identifiers = {"device": "af4a1778ea9e138ef4cd13c0bc6dbdb560e3caaa",

               "mac": "d8d1cba2a7a7",

               "odin": "04f6e929111b132880d656a0480cb5091cfd6ad0",

               "ifa": "EFA299E8203742BD9E39BC08471142B6",

               }

 

sig_str_format = "{identifiers}:{token}:{nonce}"

sorted_ids = sorted(identifiers.keys())

ids = [identifiers[key] for key in sorted_ids]

id_value_str = ':'.join(ids)

print "id_value_str: %s" % id_value_str

sig_str = sig_str_format.format(identifiers=id_value_str,

                                token=app_token,

                                nonce=nonce)

sig = hmac.new(app_secret, sig_str, hashlib.sha1)

digest_str = base64.urlsafe_b64encode(sig.digest()).strip("=")

uri_params = {'device': identifiers['device'],

              'token': app_token,

              'sig4': digest_str,

              'nonce': nonce,

              'd_mac': identifiers['mac'],

              'd_odin': identifiers['odin'],

              'd_ifa': identifiers['ifa']

              }

url = api.format(args=urlencode(uri_params))

print url

print urlopen(url).readlines()