Search code examples
apipython-3.xjawbone

Jawbone API authentication using python


How can i authenticate a user from python for Jawbone UP.With valid credentials is it possible to authenticate from python


Solution

  • email ='your email id'
    pwd  = 'your password'
    data = urllib.parse.urlencode({'email': email, 'pwd':pwd, 'service': 'nudge'})
    data = data.encode('utf-8')
    request = urllib.request.Request("https://jawbone.com/user/signin/login")
    # adding charset parameter to the Content-Type header.
    request.add_header("Content-Type","application/x-www-form-urlencoded;charset=utf-8")
    f = urllib.request.urlopen(request, data)
    #print(f.read().decode('utf-8'))
    j=(f.read().decode('utf-8'))
    b=json.loads(j)
    

    now json object b contains all data about user like name ,weight,etc.......