def get_token():
headers = {'Content-Type': 'application/x-www-form-urlencoded'}
data = {'client_id': 'XXX', 'client_secret': 'XXX', 'grant_type': 'client_credentials', 'scope': 'data:read'}
response = requests.post('https://developer.api.autodesk.com/authentication/v1/authenticate', headers=headers, data=data)
return response.json()['access_token']
print('Bearer ' + get_token())
response_form_templates = requests.get('https://developer.api.autodesk.com/construction/forms/v1/projects/:projectId/form-templates', headers={'Authorization': 'Bearer ' + get_token()})
print(response_form_templates.json())
print(response_form_templates)
I'm trying to use python requests to simply get back the form-templates and all I'm getting back is a 401 response and a message saying "Authorization failed". The few print statements in there are from my trying to debug what's going wrong, but with my client_id and client_secret in there, it gives me those errors.
Any idea as to what could be wrong would be really helpful, thanks.
