Download Binary File using Rest API Extension

1
0
-1

Hi,

I'm using Bonita Community 7.0.2. I have a requirement to download a binary file (like an MS-Excel file) from another service. Is there a way to return the binary file in the response using the Rest API Extension ?

Regards

Comments

Submitted by yannick.lombardi on Thu, 08/27/2015 - 08:58

I don't think it is possible to return a file with a Rest API.
But with Bonita Rest API you can get the URL of the file. With this URL, you can download the file.

To do this, you need to get your file as a Document in your process.
Then, you can use this API :
http://documentation.bonitasoft.com/bpm-api-1#casedocument

It returns the URL of the file.
To finish you can use the Link Widget in your form to create a download link with the file URL.

2 answers

1
0
-1

Thanks all.

1
0
-1

I think this is really a question for the other system.

From what you are saying,

  1. You are using Bonitasoft to send a REST query to the other system
  2. The other system is supposed to return the (binary or otherwise) file
  3. The you can download it and save it on your computer

You need to find out if the other system (you don't say what it is) is able to respond to the query, does it for example have a GET response to deliver the document. If not then I doubt you'll be able to do this, if it does then yes there will be a way of doing it.

Notifications