OGLuciferPrime
OGLuciferPrime9mo ago

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
Gaurav Chadha
Gaurav Chadha9mo ago
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.
OGLuciferPrime
OGLuciferPrime9mo ago
not like that I mean in rest API I need to consume file in RestAPI, which comes from request.body ?
Gaurav Chadha
Gaurav Chadha9mo ago
Like this?
OGLuciferPrime
OGLuciferPrime9mo ago
it'll be formdata with type like this {
name: String, pdf: File } this content will be in form data inside request.body
Gaurav Chadha
Gaurav Chadha9mo ago
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.
No description
OGLuciferPrime
OGLuciferPrime9mo ago
file is not uri file is in FormData as blob
OGLuciferPrime
OGLuciferPrime9mo ago
see this
No description
OGLuciferPrime
OGLuciferPrime9mo ago
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 ?
Gaurav Chadha
Gaurav Chadha9mo ago
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.
OGLuciferPrime
OGLuciferPrime9mo ago
oh ok so I guess it'll also be not possible to use FormData inside builship to call another API with it right ?
Gaurav Chadha
Gaurav Chadha9mo ago
Right, currently not, in near future, it will be possible. We'll update you when this support is available.
OGLuciferPrime
OGLuciferPrime9mo ago
Oh great @Gaurav Chadha Thanks for your quick response, Thank-you very much
Sam
Sam4mo ago
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