- Create a NewTransformationOperation. Delete the Source node from the layout.
- Double-click on the Target and Select Create New Target. The New Target should be of type HTTP that points to the RESTful service.
- Select Options and Create a New Target for the response of the Service call or choose an existing target.
- Set the Content Type accordingly; for this example we are expecting a JSON response.
NOTE: If the service requires HTTP headers they can be set under Advanced Properties.
- Double-click on the transformation, Select Create New Transformation. For this example, the Source is None and the target is JSON.
- For the JSON Schema Select an existing schema or use an example JSON Request to create the Schema.
- Example JSON for request:
- In the Transformation Wizard, map the values you would like to be assigned.
- The operation is complete and it will write the output of the Service call to the target specified in Step 1.
- To Parse the response Create a second Operation to parse the response.
- To create a new operation Right-click on the Operation and Choose On Success -> Operation -> Create New Operation.
- For the example, we have deleted the Target since we will just be saving the response to variables.
- Check the Source list on the left. If you do not have a Source that corresponds to the Target that you used in Step 2, right click on the Target and Choose Copy To Source.
- Double-click on the Target and Choose the Source that corresponds to the Target defined in Step 2.
- Double-click on the Transformation. Choose JSON as the Source and Text as the Target. You will then be given the ability to choose an existing JSON definition or have one created from an example.
- Example JSON Response:
- For the Target text definition you can create new one or use an existing one. For the example we use a single column format with blank as the column name. If you were using this for something more detailed or something where you were not saving the response to a variable, you could create a more suitable response or reuse the JSON format that the REST Service provides.
- In the Transformation Wizard, map the data accordingly.
- In the example we are working with access_token, expires_in, token_type,refresh_token, and refresh_expires_in.
Example of the script used under “blank”: Token and other values are saved into global variables to be used in other operations
- Now you will be able to run the service. You would start with the Operation created on step 1.
Example of what the service should look like: