Enricher is a component that can be used for calling web services and returning their response or a part of it. This JSON can be returned as it is or "enriched" into another JSON. It is built into Audit, but can also be used as a separate component in another systems.
In order to be called by enricher the web service should match the following requirements:
{
"parameter": "value"
}
it is not recommended by RESTful specifications to use POST for data retrieval, but it can be done in some circumstances
Below are a few examples of enricher configurations with different parameters.
{
"name": "weather",
"type": "http",
"url": "https://weather.nu/external_api",
"httpMethod": "GET",
"bearerToken": "b09e2254-6ade-4e44-9c98-25eefed5599a",
"input": {
"parameters": [
{
"name": "country",
"type": "selector",
"value": "$.address.country"
},
{
"name": "date",
"type": "selector",
"value": "$.date"
}
]
},
"output": {
"resultSelector": "",
"injectAs": "$.weather"
}
}
{
"name": "weather",
"type": "http",
"url": "https://weather.nu/external_api",
"httpMethod": "GET",
"authorizationServerUrl": "https://oauth.weather.nu",
"oAuth2CertificateThumbprint": "1d4b45e90df21fce012c9a804a5b7c166326c6cf",
"oAuth2ClientId": "some_id",
"requiredScopes": [
"weather:read"
],
"input": {
"parameters": [
{
"name": "country",
"type": "selector",
"value": "$.address.country"
},
{
"name": "date",
"type": "selector",
"value": "$.date"
}
]
},
"output": {
"resultSelector": "",
"injectAs": "$.weather"
}
}
{
"name": "weather",
"type": "http",
"url": "https://weather.nu/external_api",
"httpMethod": "GET",
"authorizationServerUrl": "https://oauth.weather.nu",
"oAuth2ClientId": "weather-client",
"oAuth2ClientSecret": "RAcmIxj0Tsn3_-GZjp6OomL-xRxoae9kZHvx81zLNj8",
"requiredScopes": [
"weather:read"
],
"input": {
"parameters": [
{
"name": "country",
"type": "selector",
"value": "$.address.country"
},
{
"name": "date",
"type": "selector",
"value": "$.date"
}
]
},
"output": {
"resultSelector": "",
"injectAs": "$.weather"
}
}