07-21-2020 11:08 AM
Hi Friends,
I am trying to explore Cisco Webex REST API with Python and somehow I am stuck in Authentication error. I have successfully created token ID(just mentioned 'xyzxyz' as refernce) , but not sure how to input in GET request. Can someone help please?
Code:
import requests
r=requests.get('https://webexapis.com/v1/people?email=godwin.nivin@gmail.com', headers={'Authentication': 'xyzxyz'}, verify=False)
print(r.content)
Error:
b'{"message":"The request requires a valid access token set in the Authorization request header.","errors":[{"description":"The request requires a valid access token set in the Authorization request header."}],"trackingId":"ROUTER_5F172C02-CCA6-01BB-4D40-AC12DF264D40"}'
Process finished with exit code 0
07-08-2022 05:58 AM
Instead of "Authentication" in your header, use "Authorization" with token.
token = 'Bearer ****'
headers = {
"Authorization" : token,
"Content-Type" : "application/json"
}
Note: The token **** could be obtained from the https://developer.webex.com/docs/getting-started page after you login.
05-05-2021 11:16 AM
You can try this by adding Bearer before inserting the Authentication header ("xyzxyz")
import requests
r=requests.get('https://webexapis.com/v1/people?email=godwin.nivin@gmail.com', headers={'Authentication': 'Bearer xyzxyz'}, verify=False)
print(r.content)
07-27-2020 04:31 AM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide