Accessing the Salesforce API for the first time... using python
Refer to Set up Authorization:
Once authenticated, every request must pass in the access_token value in the header. It cannot be passed as a request parameter.
Parse for access_token
in request.content. Then use it in Authorization header:
import json, requests
#...
body = json.loads(r.content)
token = body["access_token"]
url = body["instance_url"] + "/services/data/v36.0/limits"
r = requests.get(url, headers = {"Authorization":"Bearer " + token});
print r.content