How can I download the files generated by Assistant API?

So I have an API call to the assistant and it generates the output as multiple pdfs.

It only shows the File IDs, which endpoint can I use to download and upload them to the Gdrive?

PS: I used the “/v1/files/{{fileID}}/content” endpoint and it didn’t give me any good result, just a Zip file with a bunch of random files in it.

1 Like

To download the PDFs generated, you’ll need to use the endpoint /v1/files/{{fileID}}/download for fetching individual files instead of a zipped bundle. You can then upload them using the Google Drive API’s /upload/drive/v3/files endpoint. Be sure to set the correct headers and file format for both APIs.

Nope it didn’t work. Did a get request to /v1/files/{{file-id}}/download and got an error.

When I do the same request to /v1/files/{{file-id}}/cotent, it works.

Odd, also the download thing isn’t listed on OpenAI API as well

1 Like