A few steps are involved when creating connections and recipes and running them:
1.
Create a connection: First, you must connect to your Unqork environment to make API calls using the Integration Gateway. This process requires an account and authorization credentials for access to the Unqork API.
2.
Create a recipe: Recipes are workflow-like steps that perform actions. Recipes have many advanced features that can handle all application integrations and workflow automation scenarios, including conditional triggers, actions, and so on.
3.
Define an endpoint for a recipe: To make an API call to the Unqork service in your applications, you must establish an endpoint. You'll use this endpoint to make the call in a Plug-In component.
4.
Configure a Plug-In component: Set up a Plug-In component to call your recipe's endpoint and perform the recipe's actions.
The first step when creating your Unqork recipe is generating Unqork Access Credentials using the API Access Management page. Then, you'll use the credentials to set up the Unqork connection in the Integration Gateway.
You must have an Unqork Administrator account to create access credentials.
Generate Unqork Access Credentials
This example connects the Unqork API to the Integration Administration recipe. To grant the recipe access to the Unqork API for your environment, create a Creator Access Credential in API Access Management. You'll insert these credentials into the recipe in the next section.
1.
At the top right of the Unqork Designer Platform, click Settings ▾.
2.
Select Administration.
3.
Under Integration, click API Access Management.
4.
On the API Access Management page, click + Create New ▾.
Click Connect. The Connection Status changes to Connected.
Your connection is now established and active for use in your recipe. Next, you'll review how to create your recipe.
Create a Recipe
Recipes let you integrate your connections, set up triggers, and determine the actions and events you want to occur. For this how-to guide, you'll configure a recipe to retrieve the Unqork Get Module Submissions' full payload.
To create a recipe and designate a starting point:
1.
Open the Unqork project.
2.
Click Create ▾.
3.
Select Recipe.
Configure a Starting Point
First, you must configure the starting point, or trigger, for your recipe. With the recipe page now open, configure the following fields:
1.
In the Name field, enter a unique name for the recipe. For example, {{teamName}} - Get Module Submissions.
2.
From the Location* drop-down, specify the project.
3.
From the Pick a starting point* list, select Trigger from an App.
4.
Click Start Building. The recipe page loads.
Configure the Trigger
1.
On the Recipe Canvas, under TRIGGER, click the Select an App and Trigger Event button. A configuration panel displays all your connected apps at the right of the page.
2.
Under Choose an App, in the search field, enter API to filter the list.
3.
Select API Platform by Workato. The TRIGGER step changes to NewAPI requestReal-time.
Configure the First Action
1.
Under ACTIONS, click the (Add Step) button. A list of actions displays.
2.
Click Action in App. The configuration panel displays.
3.
Under Choose an App, search for and select the Unqork Customer API tile. The configuration panel navigates to the Action step.
4.
Under Choose an Action, search for and select Get Module Submissions. The configuration panel navigates to the Connection step.
Connect to the Unqork Customer API
Select the connection set up in the Configure Your Unqork Connection section. Doing so adds the Access Credentials to your API Request.
Click Connect. The configuration panel navigates to the Setup step.
Pass the moduleId Field to the Endpoint
Because you're retrieving a module's submissions using its module ID, you must map it from the TRIGGER step to the ACTIONSSetup step. Mapping this field lets you to pass the module ID value to the endpoint from inside a module.
1.
Select the NewAPI requestReal-timeTRIGGER step. The configuration panel displays.
2.
On the Setup pane, navigate to the Request Schema section.
3.
Click Add fields manually. The Add New Field modal displays.
4.
In the Name* and Label* fields, enter moduleId.
5.
Click Add Field. The field displays under the Request Schema section.
6.
Select the Get Module Submissions in Unqork Customer API step and return to the Setup section.
7.
Click the moduleId* field, the Recipe Data modal expands.
8.
In the Recipe Data modal, navigate to the Request Parameters section.
The third step in the recipe sets the response to Text/XML, and specifies what HTTP status code to display when retrieving data from the endpoint successfully.
1.
Under ACTIONS, click the (Add Step) button. A list of actions displays.
2.
Click Action in App. The configuration panel displays.
3.
Under Choose an App, search for and select the API Platform by Workato tile. This step changes the action to RETURNAPI Response and the configuration panel navigates to the Setup step.
4.
Return to and select the NewAPI requestReal-timeTRIGGER step.
5.
From the right-menu, scroll to the Response* section.
6.
From the Content Type* drop-down, select Text/XML.
7.
Scroll to the Responses* section and click Add Response
8.
In Name field of the Response #1 box, enter response.
9.
From the HTTP status code* drop-down, select 200 - OK. Whenever the API successfully returns the response values, this status code displays.
To learn more about response codes, view our HTTP Status Codes article.
Pass and Convert the Text/HTML Body to the API Response Step
Now that your Recipe has a Response schema add the response fields to the API Response's Setup step.
1.
Select the RETURNAPI Response step. The configuration menu displays the Setup settings.
2.
From the Response* drop-down, select response. The Response body* box displays below.
3.
Hover over the Body field, the Text Formula button displays.
4.
Click the Formula button. The Body field changes background colors and the Recipe Data modal expands.
The recipe is now running and ready for use in Unqork. The final step in the Integration Gateway is to create an endpoint for the recipe.
Configure Your Endpoint
To use your recipe in a Plug-In component, you must create an endpoint in the Integration Gateway. Once created, it displays in the Plug-In component's External Services drop-down.
To configure your endpoint:
1.
At the top left of the Recipe Builder, click the API Platform tab.
2.
From the API Collections panel, select an existing API Recipe collection.
3.
Click + New Endpoint. The Add New Endpoint modal displays.
4.
From the Recipe* drop-down, search for and select your recipe's name.
5.
From the HTTP Method* drop-down, select the method to use for this endpoint. In this case, leave it as the default GET.
6.
In the Endpoint Name* field, enter a unique name for this endpoint. For example, Get Workspace Application. This value displays in the Plug-In component's External Services setting.
7.
In the Endpoint Path* field, enter a unique path for your endpoint. For example, getWorkspaceApplication.
8.
Click Add Endpoint. You return to the API Platform page and the new endpoint tile displays at the top of the page.
9.
On the endpoint tile, click the ··· (options) button.
10.
Select Activate Endpoint. The endpoint's status changes from Never Active to Active.
You endpoint is now active, so you can select it in a Plug-In component.
Configuration
The last step of the process is to configure a module to retrieve Unqork application data using the endpoint. These instructions assume you have a module saved with a title.
Configure the Text Field Component
Configure a Text Field component for entering the ModuleID. This value inputs into the Plug-In component you'll configure in the next section.
1.
In the Module Builder, drag and drop a Text Field component onto the canvas.