- 2 Minutes to read
-
Print
-
DarkLight
-
PDF
Custom Connection
- 2 Minutes to read
-
Print
-
DarkLight
-
PDF
A custom connection is one that can be used by Actions.
It is called “custom” because it is flexible in terms of the parameters it can be configured with. This is because each Action may require different details, as all REST APIs are not created equal.
Custom connections can be used in REST Action, Multi-Action or Data Source to Target rivers that use REST Actions as a source.
Custom connections are not mandatory and the connection option can be left empty in each of the above river types.
When to Use Custom Connections
The custom connection is, in essence, a collection of variables. There are two major differences when comparing parameters set in a custom connection to the variables set in an Action river:
-
In custom connections, there is the option to encrypt values. This can be useful when there is a need to use sensitive information such as passwords and tokens.
-
In custom connections, the paramaters are stored as variables at the connection level, opposed to in a specific Action river. This means that the variables stored in a connection can only be used in the rivers that utilize the connection.
Thus, a custom connection is useful when there is a need to use the same connection in multiple rivers, as the parameters will only need to be set once. In addition, if there is a need to use sensitive information, it can be easily encrypted in the connection.
How to Use a Custom Connection in an Action
Any connection parameter in the custom connection will be added to the variables list of the action that is using this connection.
After having a selected custom action in the Action, it is possible to use its details simply by typing {} in any valid input in the action (just like using any other variable of the Action).
The connection variables are set with the prefix “connection” . These can be used in any input that is required to send the connection details, such as headers or in the body of the request.
Create a new custom connection
- Add a Connection Name .
- Insert the name of connection parameter in the Key input and the value of the connection parameter in the Value input.
- Any connection parameter that contains sensitive information can be hidden using the Is Password checkbox.
- Add as many connection parameters as required. All of these keys will then be available as variables any REST river (Actions, Multi-Actions, REST Data Source to Target).
OAuth2 Connection
Rivery supports OAuth2.0 connections to REST APIs. To submit an OAuth2.0 request from Rivery, do the following:
Add Rivery's callback URL to the settings of the app you are authenticating.
Callback URL: https://console.rivery.io/api/oauthcallback/custom
- Click on the button Open OAuth2 Authentication and fill out the form. The required elements are as follows, and can usually be found in the developer documenation of the API:
- Authentication URL - URL provided by the service to initiate authentication request.
- Access token URL - URL provided by the service to request an access token.
- Client ID - The public identifier for the app.
- Client Secret - Passphrase to authorize the app.
- If the form was filled in properly a popup will appear with a prompt to authenticate to the API. Log in to the service and tp receive an access token/refresh token.
- Any details that were received from the OAuth2 will be added automatically as connection parameters.
Example of Microsoft connection:
The values wrapped in curly brackets are referencing custom connection parameters.