Risk Cloud API: Export Record Data
Updated on: January 17, 2022
Exporting Record data via the Risk Cloud API is a common use case. While the endpoints in Risk Cloud API: Record Search cover how to return and filter record data in a JSON format, there are use cases where CSV or XLSX formats are convenient.
In this article, we will walk through the steps necessary for obtaining CSV and XLSX data exports of your records via the Risk Cloud API.
- Obtain the
layout-id
that you would like applied as the columns for the CSV or XLSX export - Obtain the
application-id
,workflow-id
, andstep-id
that you would like to export record data for - Select the
status
that you would like to export record data for - Retrieve Record Export
Authentication
Obtain your API Access Token to get started, and for more on exporting record data and layouts, refer to our Help Center articles Export Record Data and Overview of Layouts.
Step 1: Obtain the layout-id
The layout represents the field columns of the CSV or XLSX export. The layout-id
can be obtained from the Risk Cloud web application or via the Risk Cloud API. If you already know your layout-id
you may continue to Step 2: Obtain application-id
, workflow-id
, and step-id
Using the Risk Cloud application
The most straightforward way to find a layout ID is to open the desired layout from the builder page located at Build > Layouts in the Risk Cloud web application, then take the ID from the end of the URL.
https://your-company.logicgate.com/build/layouts/{layout-id}
Using the Risk Cloud API
The Retrieve Layouts endpoint returns all layouts that the user is entitled to, either as an Admin, Builder, or Step Permission Set grantee. If no layouts are returned, check the permissions of the requesting API user to ensure that proper permissions are granted.
This will return an array of layout objects, each looking like the following. Parse the layout objects by properties like workflow
, application
, or title
until you have located the intended layout.
{ "id": "a1b2c3d4", "active": true, "created": 1595957773409, "updated": 1617645014337, "title": "[Reg Compliance] Assessments", "defaultLayout": true, "workflow": { "id": "e5f6g7h8", "active": true, "created": 1592837365474, "updated": 1676386494460, "name": "Risk and Impact Assessments", "recordPrefix": "Assessment", "allowGroups": false, "requireGroups": false, "xpos": 26, "ypos": 288, "priority": 2, "sla": { "enabled": false, "duration": 0 }, "allowAec": false, "steps": [ ], "sequence": null, "application": { "id": "i8j9k0l1", "active": true, "created": 1567164504184, "updated": 1702410681371, "name": "RCX: Regulatory Compliance", "createdBy": null, "color": "#00a3de", "icon": "fas__fa-university", "type": "REGULATORY_COMPLIANCE", "sourceApplicationId": "m2n3o4p5", "sourceEnvironment": "grc", "permissionsEnabled": false, "imported": true, "copied": false, "live": true, "calcsV2": true, "currency": "USD", "uxriEnabled": true }, "userGroups": [ ], "primaryField": null, "workflowType": "WORKFLOW" }, "layoutType": "Display" }
2. Obtain the application-id
, workflow-id
, and step-id
Application, workflow, and step IDs can be obtained from the Risk Cloud web application or via the Risk Cloud API. If you already know your application-id
, workflow-id
, and step-id
you may continue to Step 3: Select Status.
Using the Risk Cloud application
The most straightforward way to find application, workflow, and step IDs is via the Risk Cloud web application.
Application ID
Open the desired application from the builder page located at Build > Applications in the Risk Cloud web application, then take the ID from the end of the URL.
https://your-company.logicgate.com/build/applications/{application-id}
Workflow ID
Open the desired application containing the workflow from the builder page located at Build > Applications in the Risk Cloud web application, then select the edit gear icon on the top-right corner of the Workflow to open the Workflow Editor modal. The workflow ID will be displayed under the Workflow ID label.
Step ID (Optional)
Open the desired step from the builder page located at Build > Applications > (Select a Step) in the Risk Cloud web application, then take the ID from the end of the URL.
https://your-company.logicgate.com/build/steps/{step-id}
Using the Risk Cloud API
Applications, workflows, and steps all have endpoints in our Risk Cloud API v2, which provide a paginated means of iterating through all resources entitled to the API user.
To search for an application, use the Retrieve Applications endpoint.
To search for an application, use the Retrieve Workflows endpoint.
To search for an application, use the Retrieve Steps endpoint (optional).
3. Select Status (optional)
Exported records may also be filtered by the status of the Record for a more granular selection. Record statuses that can be filtered are: INACTIVE
, NOT_ASSIGNED
, ASSIGNED
, IN_PROGRESS
, and COMPLETE
.
4. Retrieve Record Export
In this step, we will use the layout-id
, application-id
, and workflow-id
(with optional step-id
, and status
) found in the previous steps to export the records.
Additionally, csv
in the path may be swapped for xlsx
to switch the returned format of the spreadsheet.
Sample Request Body
{ "layout": "layout-id", "applications": ["application-id"], "workflow": "workflow-id", "statuses": ["IN_PROGRESS"], "step": "step-id" }
Response
A CSV or XLSX representation of the records, with field columns reflecting the provided layout.