User Authorization Required when trying to download report with API call
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm writing a Python script that runs a series of reports daily. So far, the script successfully runs the report, waits for it to finish, then stores the link to the file in a variable called fileURL. When I run the following request:
{"status":"unauthenticated","errors":[{"message":"user authorization required"}]}
I've included the access token as a parameter of the request header, so how can I authenticate this request?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Update in case anyone in the future comes across this:
Once the report is finished running (status = complete) there is a JSON value called "attachments" that you can get as a dictionary. Inside of the dictionary there is a value called "url" which returns a url to the file that you can download with a GET request. The relevant part of the code I used is below:
#The following chunk is ran in a recursive function - run status, check to see if statusID = complete - if so, continue, if not, sleep and then call the function again
#url = the HTTP url that I used to run the report