Nav

To Add a Service to Get Only User Names

In this procedure, you add a flow to filter users to get a list of user names. You set up the Transform Message to return the results you want.

  1. Copy and paste the get:/users:api-config flow to create another flow: Select the flow, and then Edit > Copy. Click a blank area of the canvas, and select Edit > Paste.

    A copy of the flow appears at the bottom of the canvas.

  2. In the copy of the flow, select the HTTP listener component, and in the properties editor, change the Path from /placeholder to /placeholder/names.

  3. Drag a Transform Message component from the Mule palette to the right of the HTTP requester.

    define metadata
  4. In the properties editor, change the output code to specify the application/json mime type instead of application/java and add payload.name:

    %dw 1.0
    %output application/json
    ---
    payload.name

Next, test the API Implementation.

In this topic:

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+