pythonoauthupwork-api

upwork-api client.auth.get_request_token() returns (null,null)


I am moving my first steps with the upwork API in python, but I am stuck at the first steps.
I am following the tutorials but I cannot get the tokens from oauth.

upwork.ca_certs_locater.LINUX_PATH = 'C:\\Users\\somedir\\cacert.pem'
client = upwork.Client(upwork_key, upwork_secret)
print("Please to this URL (authorize the app if necessary):")
print(client.auth.get_authorize_url())
print("After that you should be redirected back to your app URL with " +
"additional ?oauth_verifier= parameter")

the upwork library seems installed correctly, the .pem file is also loaded correctly and I think I can connect to the server. The API keys are correctly enabled, checked with the support.
However client.auth.get_authorize_url() returns empty parameters and auth.get_request_token() returns (null,null). What can be wrong? How do I enable logging to check where all gets stuck?

client.auth.get_authorize_url() returns:  
"https://www.upwork.com/services/api/auth?oauth_token=None"

client.auth.auth.get_request_token() returns:
(None, None)  

I am using python 3.6


Solution

  • Unfortunately, this is a "known" issue that may happen when Python3 is in use - README says: "These are Python (2, and 3 which is "supported" via unofficial PR #27 and not guaranteed) bindings for Upwork Public API".

    Could you please try with Python 2.x