cancel
Showing results for 
Search instead for 
Did you mean: 

Attaching Documents

lbds
Champ in-the-making
Champ in-the-making
I am attempting to call the rest-api to attach a text document to a workflow task.  Currently, I am allowing the user to select a file to upload at which point I attempt to call the attachments rest-api for that task.  My question is how I get the file itself loaded into ACT_GE_BYTEARRAY (I believe that is where the file is stored).  Any help would be useful as I'm having difficulties understanding the documentation.
4 REPLIES 4

trademak
Star Contributor
Star Contributor
You can use the TaskService createAttachment method for that.

Best regards,

frederikherema1
Star Contributor
Star Contributor
To get the content back out, you can use taskService.getAttachmentContent(..). In REST, you can use:


GET runtime/tasks/{taskId}/attachment/{attachmentId}/content

It will be streamed back in the mime-type it was uploaded with…

lbds
Champ in-the-making
Champ in-the-making
Is there a way to call the rest-api to attach the documents or do I have to use the use the TaskService createAttachment method? 

Thanks!

frederikherema1
Star Contributor
Star Contributor
Please take a look at the userguide in the REST-section. Under the Tasks subsection, you can find a link to the docs for adding an attachment to a task…