1

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

Vitomakes
  • 315
  • 4
  • 12

1 Answers1

1

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

mnovozhylov
  • 311
  • 1
  • 3
  • in the end I worked it around using requests-oauthlib, which works fine https://github.com/requests/requests-oauthlib Once authentication is sorted out, the upwork API are not so complex to deserve a dedicated wrapper IMHO. – Vitomakes Mar 06 '19 at 13:37
  • 1
    @Vitomakes: You might want to make this into an answer. Also, can you perhaps, show us the steps you used `requests-oauthlib`? ;) – nocibambi Jan 15 '20 at 13:49
  • there is pull request that support oauth python 3 compatibility. but not merged yet. https://github.com/upwork/python-upwork/pull/39. Since, python 2.x was dead on january 2020, I think we should move code to be compatible with python 3 – aijogja May 17 '20 at 17:04
  • @ijogja, the Pull Request #39 was closed because Upwork works on a new library fully compatible with Python 3. Please, stay tuned. – mnovozhylov May 19 '20 at 05:48