Handling Dynamic Fields
Handle dynamic response fields like data_enrichments and computed objects in RiskOS™ API responses based on workflow configuration.
Dynamic data_enrichments
data_enrichmentsNote:
Integrating with the
data_enrichmentsobject is only necessary to access raw module data (for example, for analytical purposes). For the complete response schema, see the Evaluation API reference.
In the example API response below:
- The initial workflow calls only the
phoneRiskandemailRiskmodules. - As a result, the
data_enrichmentsarray in the API response will contain two entries, one for each enrichment module called.
{
"id": "yiu1y231-g7h8-6c7d-1e2f-3a4b5c6d7e8f",
"eval_id": "6dc8f39c-ecc3-4fe0-9283-fc8e5f99e816",
"...": "...",
"data_enrichments": [
{
"enrichment_name": "Socure Phone Risk",
"enrichment_endpoint": "https://sandbox.dev.socure.com/api/3.0/EmailAuthScore",
"enrichment_provider": "Socure",
"status_code": 200,
"request": { "...": "..." },
"response": { "...": "..." }
},
{
"enrichment_name": "Socure Email Risk",
"enrichment_endpoint": "https://sandbox.dev.socure.com/api/3.0/EmailAuthScore",
"enrichment_provider": "Socure",
"status_code": 200,
"request": { "...": "..." },
"response": { "...": "..." }
}
]
}In the example API response below:
- The workflow configuration was updated to include the eCBSV module.
- As a result, the
data_enrichmentsarray in the API response now includes a third entry corresponding to the eCBSV module.
{
"id": "yiu1y231-g7h8-6c7d-1e2f-3a4b5c6d7e8f",
"eval_id": "6dc8f39c-ecc3-4fe0-9283-fc8e5f99e816",
"...": "...",
"data_enrichments": [
{
"enrichment_name": "Socure Phone Risk",
"enrichment_endpoint": "https://sandbox.dev.socure.com/api/3.0/EmailAuthScore",
"enrichment_provider": "Socure",
"status_code": 200,
"request": { "...": "..." },
"response": { "...": "..." }
},
{
"enrichment_name": "Socure Email Risk",
"enrichment_endpoint": "https://sandbox.dev.socure.com/api/3.0/EmailAuthScore",
"enrichment_provider": "Socure",
"status_code": 200,
"request": { "...": "..." },
"response": { "...": "..." }
},
{
"enrichment_name": "Socure eCBSV",
"enrichment_endpoint": "https://sandbox.dev.socure.com/api/3.0/EmailAuthScore",
"enrichment_provider": "Socure",
"status_code": 200,
"request": { "...": "..." },
"response": { "...": "..." }
}
]
}By following these guidelines, you can build a robust and resilient integration with RiskOS™ APIs, effectively leveraging dynamic data structures and enrichment results.
Note:
The
computedobject is an optional response field that can be enabled via feature flags. It contains all fields that are calculated during workflow evaluation (e.g., outputs from matrix rule steps, transformation functions, etc.).This object is especially useful when custom transformations are applied in a workflow. Because it reflects the real-time structure of your evaluation logic, the contents of computed can change frequently with updates to the workflow. If you plan to use this object, we recommend discussing your use case with your RiskOS™ Technical Account Management team.
Updated about 1 month ago
