How to get Authorization and Date headers

As we tried to auth api as per documentation we cant able to generate authorization and date headers. Any valid JAVA code is there to generate that ?

Take a look at the Java API client samples on GitHub.

I was unable to reproduce the authorization and data using the python code

import base64, email, hmac, hashlib, urllib
def sign(method, host, path, params, skey, ikey):
Return HTTP Basic Authentication (“Authorization” and “Date”) headers.
method, host, path: strings from request
params: dict of request parameters
skey: secret key
ikey: integration key

# create canonical string
now = email.Utils.formatdate()
canon = [now, method.upper(), host.lower(), path]
args = []
for key in sorted(params.keys()):
    val = params[key]
    if isinstance(val, unicode):
        val = val.encode("utf-8")
        '%s=%s' % (urllib.quote(key, '~'), urllib.quote(val, '~')))
canon = '\n'.join(canon)

# sign canonical string
sig =, canon, hashlib.sha1)
auth = '%s:%s' % (ikey, sig.hexdigest())

# return headers
return {'Date': now, 'Authorization': 'Basic %s' % base64.b64encode(auth)}

Please can you help

Regards ,

Is there any solution for this just for a reminder.