In this article, two REST clients are created. One will retrieve a token and store it in a technical attribute while the second will have this attribute as input to use in its Authentication header. The Product Retail Demo model is used in this article.

  1. Use the 1st REST client in an Enricher and store its output in an attribute
  2. Use the 2nd REST client in another Enricher and the attribute in the authentication header.
  1. First, the REST endpoints need to be tested in a 3rd party application like Postman.
{
                  "label": "Integration Key",
                  "description": "Key used for data integration",
                  "username": "INTEG_REST",
                  "roles": [
                        "DataSteward", "semarchyConnect"
                            ],
}
  • HTTP Header Authorization: Basic c2VtYWRtaW46c2VtYWRtaW4=
  • The actual value can be retrieved from the Code snippet:

         

  • Create a second request of type GET. 


  1. In this, create 2 REST clients: 

  • One for retrieving or creating an API key
  • One for retrieving data from one of our endpoints

To Create the first REST client- 

 {
                  "label": "Integration Key",
                  "description": "Key used for data integration",
                  "username": "INTEG_REST",
                  "roles": [
                        "DataSteward", "semarchyConnect"
                      ],
                }
  • HTTP Header- Authorization: Basic c2VtYWRtaW46c2VtYWRtaW4=

 

  • Create a new attribute for storing of the API key.
  • Next, create an enricher for REST API –
  • Enrichment scope to none.
  • Filter condition- Name is not null
  • Provide only the output field as the newly created attribute(KeyValue).

 

 


    Create a 2nd REST Client to use the value of the 1st REST client –

 

  •  KeyValue field is coming from the 1st REST client’s output and Input field is for the filter condition on the Name field.


3. Create an Enricher for this 2nd REST client :-

 


4. After configuring both REST clients in the Enricher, call them in the correct order using the Stepper.

 


5. The whole configuration can now be tested directly in the UI: -

  • Create a new product in Product business view.
  • See the KeyValue which is generated from the 1st Enricher.

 


  • While typing the name of the product, the count on the name using the filter can be seen in the Filter     name field which is caused by 2nd enricher.