HTTP Cleanse Function
Learn about the out-of-the-box HTTP cleanse function.
Use the HttpStatusCleanser
function to cleanse data via an HTTP request to a (external) service. To configure cleansers, see topics Set Cleanse Functions Configuration and topicData cleansing set up.
- This cleanser includes all input mappings defined in the L3 cleanse configuration as query parameters.
- The response is returned in a simple JSON format with key-value pairs and is mapped to the output mapping specified in the L3 cleanse configuration.
- It does not support additional headers (including security tokens), or request bodies for POST requests.
- All options, except for the
URL
andmethod
, are sent as query parameters.
Name | Required | Description |
---|---|---|
url
| Yes | The base URL for the API call. Note: You can specify additional request parameters in the Cleanse function configuration by appending them to the base URL. However, you cannot add custom headers when making the HTTP call. |
method
| No | The HTTP method of the request. One of:
|
Response Format
{
"cleanseAttribute1": "cleansedValue1",
"cleanseAttribute2": "cleansedValue2",
"cleanseAttribute3": "cleansedValue3"
}
Example
- Physical configuration
{ "cleanseFunction": "HttpStatusCleanser", "type": "Http", "options": { "url": "http://saas.loqate.com/rest", "method": "GET", "lqtkey": "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE", "p": "v+g", "opts": "DefaultCountry=USA" } }
This example configures an HTTP Cleanser Function that:- Calls http://saas.loqate.com/rest
- Uses the
GET
method - Passes query parameters such as lqtkey, p, and
opts
. - Passes the input mappings from the cleanse configuration defined in L3 as query parameters.
- L3 configuration
{ "uri": "configuration/entityTypes/Location", "cleanseConfig": { "infos": [ { "uri": "configuration/entityTypes/Location/cleanse/infos/default", "useInCleansing": true, "sequence": [ { "chain": [ { "cleanseFunction": "HttpStatusCleanser", "resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser", "mapping": { "inputMapping": [ { "attribute": "configuration/entityTypes/Location/attributes/AddressLine1", "cleanseAttribute": "Address1", "mandatory": true, "allValues": false } ], "outputMapping": [ { "attribute": "configuration/entityTypes/Location/attributes/AVC", "cleanseAttribute": "AVC", "mandatory": false , "allValues": false }, { "attribute": "configuration/entityTypes/Location/attributes/City", "mandatory": false, "allValues": false, "cleanseAttribute": "Locality" } ] } } ] } ] } ] }, "attributes": [ { "label": "Address Line 1", "name": "AddressLine1", "type": "String", "hidden": false, "important": false, "system": false, "attributeOrdering": { "orderType": "ASC", "orderingStrategy": "LUD" }, "uri": "configuration/entityTypes/Location/attributes/AddressLine1", "skipInDataAccess": false }, { "label": "AVC", "name": "AVC", "type": "String", "hidden": false, "important": false, "system": false, "attributeOrdering": { "orderType": "ASC", "orderingStrategy": "LUD" }, "uri": "configuration/entityTypes/Location/attributes/AVC", "skipInDataAccess": false }, { "label": "City Name", "name": "City", "description": "Most common population center data element within a country (e.g., US city, Canadian municipality)", "type": "String", "hidden": false, "important": false, "system": false, "faceted": true, "searchable": true, "attributeOrdering": { "orderType": "ASC", "orderingStrategy": "LUD" }, "uri": "configuration/entityTypes/Location/attributes/City", "skipInDataAccess": false } ] }
This example maps the HttpCleanser for the Location entity type in your L3 configuration:- Input Mapping (Defines what gets cleansed): Maps the input field from the entity to the cleanser.
- attribute: The original attribute in Reltio (AddressLine1).
- cleanseAttribute: How the attribute is referenced within the cleanser (Address1).
- mandatory: This field must be provided for cleanse to occur.
- allValues: The cleanser only processes the first available value, not all occurrences.
- Output Mapping (Defines what gets returned after cleansing): maps cleansed values back to Reltio attributes.
- AVC: The cleanser outputs a value for AVC but it isn't mandatory.
- City: Mapped from "Locality" in the cleanser.
- Input Mapping (Defines what gets cleansed): Maps the input field from the entity to the cleanser.
- Request
The request URL undergoes additional encoding before the API call is executed.Get http://saas.loqate.com/rest?lqtkey=EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE&p=v+g&opts="DefaultCountry=USA"&Address1="San Jose, California, 95112"
- Response
{ "avc":"V44-I44-P6-100", "Locality":"San Jose" }