I have subscribed to an API which gave me an authorization token and the following curl command:
curl -X GET --header "Accept: application/json" --header "Authorization: Bearer 37d5a9ac5442ba9f594a8ca1421a27b" "https://blah/blah/blah"
This curl works in terminal and returns some json when I run it. Now I need to work with the returned json so I wanted to either do this request in JS or python. Here's my python attempt:
url = "https://blah/blah/blah"
headers = {
"Accept": "application/json",
"Authentication": "Bearer 37d5a9ac5442ba9f594a8ca1421a27b"
}
response = requests.get(url, headers=headers)
print(response.text)
This responds with:
{"fault":{"code":900902,"message":"Missing Credentials","description":"Required OAuth credentials not provided. Make sure your API invocation call has a header: \"Authorization: Bearer ACCESS_TOKEN\""}}
What am I doing wrong? I don't have an explicit username and password like other answers to similar questions suggest.