This is a step-by-step guide to exporting Records and their Field data as a CSV or XLSX file using common Risk Cloud endpoints.
In order to properly export Records and their Field data, we first need to gather information on the Layout ID, Application ID, and Workflow ID. Then, we will construct out a JSON body with this information to make a proper POST request for exporting Records.
Obtain Proper API Authentication
Prior to any interaction with Risk Cloud's APIs we will need to set the authorization header. Instructions on how this can be accomplished can be found here.
The Layout ID can be obtained by either looking for the ID in the URL when in the Layout’s edit modal or by using the following endpoint.
This will return a list of all Layouts. Now, parse this array of Layouts until you find your Layout, and place the Layout ID into your JSON object:
Application and Workflow
The Application ID can be found using the following endpoint:
This will return a list of all active Applications with their Workflows. Similarly to Layout, parse this array until you find your Application and Workflow and add this Application ID and Workflow ID into your JSON object. The JSON object should look like this:
Note: The key for Applications is plural "application" and is an array of string IDs. Additionally, to export all Records in one Application, across all Workflows in that Application, use a Global Layout and do not specify a Workflow in your JSON body.
Statuses and Steps
With our current JSON body, we will be exporting all Records in the Workflow. What if we wanted to be more granular with our Record selection? Good news!
The next keys in our JSON object, “statuses” and “steps” is optional. This key allows us to filter to the Records with one of the following specific statuses: INACTIVE, NOT_ASSIGNED, ASSIGNED, IN_PROGRESS, COMPLETE. The Step ID can be pulled via the browser’s URL. If you decided to use one of these statuses and specify a Step, your JSON object would look like this:
Now you can use the JSON object above as the body of the request to retrieve the Field information and values for your selected Layout, Application, Workflow, Steps, and Record statuses.
Note: To export as an XLSX document, change “csv” to “xlsx” in the request URL.
Please sign in to leave a comment.