Risk Cloud API: Viewing Fields
Updated on: January 17, 2022
API Authentication
Prior to any interaction with Risk Cloud's APIs we will need to obtain an Access Token for the Authorization header. Instructions on how the Access Token can be obtained can be found here.
Background
When working with the Risk Cloud via the API, it is common to require IDs for Fields for accomplishing tasks such as updating Records.
The following endpoint will return an array of Field objects that exist within a given Workflow.
Usage
Obtaining all Fields of a Workflow can be accomplished in two steps:
-
Obtaining a Workflow ID
-
Requesting the Workflow's Fields
Obtaining a Workflow ID
To obtain Workflow IDs in your environment (more information on this endpoint can be found in Viewing Applications, Workflows, and Steps), make the following request.
curl --request GET 'https://your-company.logicgate.com/api/v1/applications?generic=true' \ --header 'Authorization: Bearer {ACCESS_TOKEN}'
The response will contain an array of all Applications. Workflow IDs can be located as the values for id properties for "workflow" objects in that JSON.
[ { ... "workflows": [ { ... "id": null } ] } ]
Requesting the Workflow's Fields
Now that you have obtained a Workflow ID, you can obtain a list of all Fields on that Workflow.
curl --request GET 'https://your-company.logicgate.com/api/v1/fields/workflow/{workflowId}/values' \ --header 'Authorization: Bearer {ACCESS_TOKEN}'
The response will contain a list of all Fields that exist within the given Workflow. The Field IDs of which can be used for updating Records or viewing current Field values.
[ { "active": true, "convertibleTo": [ "string" ], "created": "2019-08-24T14:15:22Z", "currentValues": [ { "active": null, "archived": null, "created": null, "defaultField": null, "discriminator": null, "empty": null, "field": null, "fieldId": null, "id": null, "idOrTransientId": null, "isDefault": null, "numericValue": null, "priority": null, "textValue": null, "transientIdOrId": null, "updated": null, "valueType": null } ], "defaultValues": [ { "active": null, "archived": null, "created": null, "defaultField": null, "discriminator": null, "empty": null, "field": null, "fieldId": null, "id": null, "idOrTransientId": null, "isDefault": null, "numericValue": null, "priority": null, "textValue": null, "transientIdOrId": null, "updated": null, "valueType": null } ], "discrete": true, "fieldType": "TEXT", "global": true, "id": "string", "label": "string", "labels": [ "string" ], "name": "string", "operators": [ "EQUALS" ], "tooltip": "string", "updated": "2019-08-24T14:15:22Z", "validTypeForCalculationInput": true, "valueType": "string", "workflow": { "active": true, "allowGroups": true, "application": {}, "applicationId": "string", "created": "2019-08-24T14:15:22Z", "fields": [ null ], "id": "string", "name": "string", "primaryField": {}, "priority": 0, "recordPrefix": "string", "requireGroups": true, "sequence": {}, "sla": {}, "steps": [ null ], "updated": "2019-08-24T14:15:22Z", "userGroups": [ null ], "workflowMaps": [ null ], "workflowType": "[", "xpos": 0, "ypos": 0 }, "workflowId": "string" } ]