Get Document Data By Process API
The Get Document Data By Process API returns the latest copy of process Document for specified process ID. This API uses GET method to return the latest copy of process Document.
Overview of API
-
For Form based processes, the form document will be returned in json or xml format as per the value specified for parameter Format. If format is not specified, application will consider json format as default format.
-
For Excel Workflow the document will be always returned in a Excel format.
Request and Response sample
This API Returns the latest copy of process Document for specified process id. The structure of Request and Response will be like:
Request Data Contract:
No Request Body Required
Following are the parameters for Request URL.
-
DocumentType : This can be Excel/Form.
-
ProcessID: This is the GUID for Process.
-
Result Format(Optional): It can be “json” or “xml”. Works for only Form document.
Below are the samples of Request:
Sample 1
<Route Prefix>/api/v1/Processextn/GetDocumentDataByProcess/Excel/EDE8CF75-248C-407D-A5B8-0209759003D4
Sample 2
<Route Prefix>/api/v1/Processextn/GetDocumentDataByProcess/Form/DC135B5A-DE73-4D84-BCB5-01CB5A0EBFC0
Sample 3
<Route Prefix>/api/v1/Processextn/GetDocumentDataByProcess/Form/DC135B5A-DE73-4D84-BCB5-01CB5A0EBFC0/xml
Response Data Contract:
-
Form Solution(JSON Format):
Form Fields (as added in the Form Solution) data would be returned in JSON format as shown below:
{ "my:myFields": { <<Form Data in json as per Form solution feilds added to the Form solution.>> } }
-
Form Solution(XML Format):
Form Fields (as added in the Form Solution) data would be returned in XML format as shown below:
"<my:myFields xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\" xmlns:pc=\"http://schemas.microsoft.com/office/infopath/2007/PartnerControls\" xmlns:d=\"http://schemas.microsoft.com/office/infopath/2003/ado/dataFields\" xmlns:dfs=\"http://schemas.microsoft.com/office/infopath/2003/dataFormSolution\" xmlns:my=\"http://schemas.microsoft.com/office/infopath/2003/myXSD\" xmlns:xd=\"http://schemas.microsoft.com/office/infopath/2003\">
Form data in xml as per Form solution’s fields added to the Form solution.
</my:myFields>
-
Excel Solution:
This will return the data in base64:
{ “Title”:”DocumentName”, “content”:”base64string” }