Hey I am trying to access the FreeAgent API for the Sandbox account authorised using python script.
"
https://api.sandbox.freeagent.com/v2/company
"
Every thing works fine if i use the Google OAuth2.0 Playground, i.e the response show the following:
Example Data:
{"company":{"type":"UkLimitedCompany","currency":"GBP","mileage_units":"miles","company_start_date":"2010-07-01","sales_tax_registration_status":"Registered"}}
However if i use Python script for accessing the same data, it returns the error at the very last step, at :
"
api_call_headers = {‘Authorization’: 'Bearer ’ + tokens[‘access_token’]}
api_call_response = requests.get(test_api_url, headers=api_call_headers,verify=True)
"
returning response:
"
{“errors”:{“error”:{“message”:“Access token not recognised”}}}"
"
I can only assume the problem might be the with the callback URI, but URI is doing its job just fine by returning the right Authorization code which is exchanged with access_token and refresh_token, everything looks fine but the endpoint is not recognising the access_token. I know Similar topics has been raised by several others, but I haven’t got the solution from any of them, wonder if someone can take a look into this problem. I can send you additional related information if you need.
kind regards, Ammar.