Hello everyone is it possible to consume
Hello everyone is it possible to consume file in RestAPI ? if yes can you please let me know how ?
13 Replies
Yes, you can use the BuildShip file storage or the Google Storage node and upload it to your BuildShip or GCS (Google Cloud Storage). You can refer to this tutorial - https://docs.buildship.com/tutorials/gcp-storage.
You can also pass the content to the Rest API's body, api specification - https://docs.buildship.com/basics/api-spec.
not like that I mean in rest API I need to consume file in RestAPI, which comes from request.body ?
Like this?
it'll be formdata with type like this
{
name: String, pdf: File } this content will be in form data inside request.body
name: String, pdf: File } this content will be in form data inside request.body
Yes, you can use this method, if the file is is a URl, you can generate the URL for the uploaded file using BuildShip's "Generate Public Download URL" node.
file is not uri file is in FormData as blob
see this
how can I consume this file in the API ?
see this API is workflow in buildship and I'm using RestAPI Trigger,
now I'm testing buildship API by sending formdata with "statement" and "name" property
"statement" contains any file and the "name" property contains string.
so how can I use this property in buildship to proceed further ?
I see, in Postman your are using multipart/form-data upload, we currently don't support this, it will be added in near future.
For now only solution is to generate a publicly available URL and use it in there.
oh ok so I guess it'll also be not possible to use FormData inside builship to call another API with it right ?
Right, currently not, in near future, it will be possible. We'll update you when this support is available.
Oh great @Gaurav Chadha Thanks for your quick response,
Thank-you very much
as the file upload api is available now, how can i use the buffer instance to make an another api call to open ai that is a mutlipart/data-form api call? please help