# REST

Use the REST connector to consume REST services.

## Managing Connector : Add, Edit, or Delete

Follow the [steps in the link](https://docs.novacura.com/flow-connect/working-with-connect/connect-to-systems/managing-connector) as a guideline for connector actions: Add, Edit, and Delete.

## Configuration values

<table><thead><tr><th width="276">Configuration</th><th>Description</th></tr></thead><tbody><tr><td><strong>Agent Group</strong></td><td>Agent group where the connector should be executed</td></tr><tr><td><strong>Base URL</strong></td><td>Base address of the REST service</td></tr><tr><td><strong>Authentication Type</strong></td><td><p>Authentication type defines the authentication mechanism to use while communication with REST service. </p><ul><li><strong>None</strong> - No authentication</li><li><p><strong>Basic Authentication</strong> - Can be used for REST API's protected with basic authentication  and often involves providing a username and password.</p><div><figure><img src="https://1716064794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIgl6sNaTky0iALxYWHH%2Fuploads%2FPUlY3PZtolHvWdrOBFfV%2Fbasic%20auth.png?alt=media&#x26;token=0796c52e-2d76-4a50-b521-b9ee44db6b99" alt="" width="271"><figcaption></figcaption></figure></div></li><li><p><strong>API Key Credentials</strong> - Can be used for REST API's protected with some sort of a API key. Typically the key is sent either via a query parameter or as a header.</p><div><figure><img src="https://1716064794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIgl6sNaTky0iALxYWHH%2Fuploads%2FcqpwZJ5DNoz26FDWpr2L%2FAPI%20key.png?alt=media&#x26;token=13c750ed-e524-4986-b9f6-77798cda1d35" alt="" width="273"><figcaption></figcaption></figure></div></li><li><p><strong>OAuth2 Client Credentials</strong> - Can be used for REST API's protected with OAuth2 client credentials grant type.</p><div><figure><img src="https://1716064794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIgl6sNaTky0iALxYWHH%2Fuploads%2FKKsJiihF8rz67WbAUyMa%2Fclient%20credentials.PNG?alt=media&#x26;token=bbea3bf7-c404-45bf-b194-859d111589e9" alt="" width="272"><figcaption></figcaption></figure></div><ul><li><strong>Token Endpoint</strong> - The URL of the token endpoint</li><li><strong>Client ID</strong> - The client id obtained from app registration</li><li><strong>Client Secret</strong> - The client secret obtained from app registration</li><li><strong>Scopes</strong> - You can add one more scopes separated by space</li></ul></li><li><p><strong>OAuth2 Password Credentials</strong> - Can be used for REST API's protected with OAuth2 password credentials grant type.</p><div><figure><img src="https://1716064794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIgl6sNaTky0iALxYWHH%2Fuploads%2F10xMo0pCiUBjaqN7NNfE%2Fpassword%20credentials.PNG?alt=media&#x26;token=fe3f4e9d-2d1f-4ae1-90c2-261f97425057" alt="" width="268"><figcaption></figcaption></figure></div><ul><li><strong>Token Endpoint</strong> - The URL of the token endpoint</li><li><strong>Client ID</strong> - The client id obtained from app registration</li><li><strong>Client Secret</strong> - The client secret obtained from app registration</li><li><strong>Username -</strong> The username of the resource owner</li><li><strong>Password -</strong> The password of the resource owner</li><li><strong>Scopes</strong> - You can add one more scopes separated by space</li></ul><p></p></li><li><p><strong>OAuth2 Authorization Code Flow</strong> - Can be used for REST API's protected with OAuth2 authorization flow grant type.</p><div><figure><img src="https://1716064794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIgl6sNaTky0iALxYWHH%2Fuploads%2FgrLJH9xBqoiEvpBqYTmj%2Fimage.png?alt=media&#x26;token=e9327a77-9052-4786-8836-b2c107627769" alt="" width="277"><figcaption></figcaption></figure></div><ul><li><strong>Display Name -</strong> The given name of the external system/IDP and it will be used in the client prompt</li><li><strong>Authorization Endpoint</strong> - The URL of the auth endpoint</li><li><strong>Token Endpoint</strong> - The URL of the token endpoint</li><li><strong>Client ID</strong> - The client id obtained from app registration</li><li><strong>Client Secret</strong> - The client secret obtained from app registration</li><li><strong>Scopes</strong> - You can add one or more scopes separated by space</li><li><p><strong>Advanced Section</strong></p><ul><li><p><strong>Extra Query Parameters</strong> - You can add one or more extra query parameters. These parameters provide context, customization, or security enhancements to the authorization process.</p><p>Example: <code>prompt=login</code> forces the authorization server to prompt the user to log in, regardless of any active session</p></li><li><strong>PKCE</strong> - Dictates if PKCE should used in the authorization flow. Typically PKCE is used for securing public clients and mobile applications</li><li><strong>Prefill User Email -</strong> When enabled flow user email address will be used as the pre-fill username/email in the external systems log-in prompt</li><li><strong>Private Session -</strong> When enabled opens a none cookie storing web browser in iOS and Android clients during the auth steps.</li></ul></li><li>You will find the Redirect URIs <a href="../redirect-uris">here</a>.</li></ul></li><li><p><strong>Open ID Authentication</strong> - Can be used for REST API's protected with Open ID connect.</p><div><figure><img src="https://1716064794-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIIgl6sNaTky0iALxYWHH%2Fuploads%2FZ5Hl88XuqDK9B361QNss%2Ftbd.png?alt=media&#x26;token=46e4a3ce-5b37-4df8-a45f-528700a6fcf5" alt="" width="281"><figcaption></figcaption></figure></div><ul><li><strong>Display Name -</strong> The given name of the external system/IDP and it will be used in the client prompt</li><li><strong>Authority URL</strong> - root address that exposes the <code>.well-known/openid-configuration</code> document</li><li><strong>Client ID</strong> - The client id obtained from app registration</li><li><strong>Scopes</strong> - You can add one or more scopes separated by space. By default it is set to openid</li><li><p><strong>Advanced Section</strong></p><ul><li><p><strong>Extra Query Parameters</strong> - You can add one or more extra query parameters. These parameters provide context, customization, or security enhancements to the authorization process.</p><p>Example: <code>prompt=login</code> forces the authorization server to prompt the user to log in, regardless of any active session</p></li><li><strong>Prefill User Email -</strong> When enabled flow user email address will be used as the pre-fill username/email in the external systems log-in prompt</li><li><strong>Private Session -</strong> When enabled opens a none cookie storing web browser in iOS and Android clients during the auth steps.</li></ul></li><li>You will find the Redirect URIs <a href="../redirect-uris">here</a>.</li></ul><p></p></li></ul></td></tr></tbody></table>

## Configure Passthrough proxy

You can configure a passthrough proxy for REST communication in the Agent settings. This configuration is applied per Agent. If your Agent Group includes multiple Agents, you must configure the proxy individually for each one. A passthrough proxy in this case should simply forwards API calls from the connector to the target REST API, and returns the responses back, unchanged. No changes are required in the connector configuration.

To configure the passthrough proxy,

1. In the **Agent Manager** select an agent and select **Details**.

2. **Stop** the agent if its in running state.

3. Select **Open Folder.** This is will open the local file folder where the agent is installed.

4. In the local installation folder find the file named  `appSettings.json` file and open it in you favorite text editor.

5. Add the following configuration at the end and save (make sure you add a comma before this section)

   ```json
    "Proxy": {  
       "Address": "",  
       "Bypass": [],   
       "Username": "",  
       "Password": "",  
       "Domain": ""  
    }
   ```

   The `"Bypass"` field lists addresses or domains **that should not go through the proxy**.&#x20;

6. Restart the Agent.
