I'm using the 2018 version of the Google Photos API to upload images and media as documented here: "Uploading Bytes"
When I upload a new image or video I never get an upload token in the body of the response. It's always an empty body, which according to the above link means that the bytes have already been uploaded (but this is a new upload).
Here's an example request/response:
request:
POST https://photoslibrary.googleapis.com/v1/uploads
request headers:
authorization: Bearer abcd1234
X-Goog-Upload-Protocol: raw
X-Goog-Upload-File-Name: 20140317T082917_001.jpg
content-type: application/octet-stream
content-length: 1292868
accept: application/json
-----------------------------------------------------
response: OK [200]
response headers:
Alt-Svc: [quic=":443"; ma=2592000; v="44,43,39,35"]
Server: [UploadServer]
X-GUploader-UploadID: [AEnB2UqT6y8KyZNCPyAaFeCj7I_ABIlwLJQMpltYzQ7D8blW4v3uKSlMT7dbNjFV0i_7ApzoR-i26ZtZ9kHkB7bI8n8ojgOnNA]
Content-Length: [510]
Date: [Sun, 05 Aug 2018 11:19:15 GMT]
Content-Type: [text/plain]
response body:
null
I've also tried using the value returned in the X-GUploader-UploadID
header, but that causes a 500
error.
Can someone provide a working example of how to upload bytes to the Google Photos API?
Thank you!