Passing data to Google Storage API
curl -X POST --data-binary @OBJECT_LOCATION -H 'Authorization: Bearer OAUTH2_TOKEN' -H 'Content-Type: OBJECT_CONTENT_TYPE' 'https://storage.googleapis.com/upload/storage/v1/b/BUCKET_NAME/o?uploadType=media&name=OBJECT_NAME'as described in the Google Cloud Storage API documentation here: https://cloud.google.com/storage/docs/uploading-objects
I am able to replicate everything except the actual passing of the data (the --data-binary @OBJECT_LOCATION part).
First off, I don't know where I am actually supposed to define this parameter:
[Screen Shot 2021-11-16 at 12.38.09 PM.png]
You can see that I tried setting 'data-binary' as a param, but this is almost certainly wrong.
Second, the @OBJECT_LOCATION parameter is actually the local location of the file on my computer, so this probably wouldn't work anyway since Xano.
In reality, the file that I am trying to pass to Google Cloud Storage is downloadable from a url. My goal is to write a script that hits the url, gets the file, and then uploads it to Google Storage. I'm not sure if this is even doable from Xano - maybe I just have to write a script to do this - but I figure I'd ask.
Working with APIs
1 reply