Google photos recently made a change to their API (I think), on August 1st. They changed the Listing Library Contents from a POST to a GET. And now my code no longer works. https://developers.google.com/photos/library/guides/list
Here is a snapshot of the code:
payload = {"pageSize" : "500", "pageToken" : parsed_json['nextPageToken']}
#payload = {"pageSize" : "500"}
#payload = {"pageToken" : parsed_json['nextPageToken']}
myResponse = requests.get('https://photoslibrary.googleapis.com/v1/mediaItems', headers={"Content-type" : "application/json", "Authorization" : "Bearer " + credentials.access_token}, params=payload)
parsed_json = json.loads(myResponse.content)
This code gives me an error: "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT" }
It seems that if I pass two params to the GET request, I get the error. But if I pass only one param to the GET request, either the pageSize or the pageToken, it works fine. (that code is also included but commented out).
This worked fine until Aug 1 when I think google made a change.
Given I am a new programmer, I feel I am missing something key here, but I cannot figure out what it is at all.
Any help would be much appreciated!