This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi, This is David Kao from Performance Motion Devices.
I was using Python to acquire an token from your sever ("">transact.ti.com/.../oauth") with our OAuth 2.0 key.
First, I downloaded all the python templates from here : "git.ti.com/.../python"
Second, I ran API_Accessor.py, without changing any code.
Third, I ran Example1.py, and changed client credentials in the code to retrieves an API access token. but then the terminal says "ERROR: Failed to acquire API access token."
I've tried multiple server location such as "transact.ti.com" "https:/.../oauth" "https://transact.ti.com/v1/oauth/accesstoken"
And I am sure my client credential copied from TI API 2.0 is correct since it can successfully get an token and check inventories while running on Postman.
Thanks
David
Here is the code for PMD version example1.py:
Hi David! Thank you for bringing your question here. :)
I wanted to ask if you are retaining the brackets in the credential variables (client_id and client_secret)? The variable values should not have brackets when you fill them in. Instead, they will look something like the below (using pretend credentials):
client_id = "qwertyuiop"
client_secret = "asdfghjkl"
Also, the server is as given in the original code:
server = "https://transact.ti.com"
This is because the modules fill in the rest of the URL for you, adding whichever paths or parameters are necessary to make the API call.
Please let me know if this works!
**Attention** This is a public forum