Use Connections

In Integration Hub, connections define authentication details and API requests. After you create and configure a connection, you can use it in NiCE CXone.

Execute Requests from Integration Hub

You can execute a request from the Integration Hub connection where it's defined. Only manual requests can be executed from Integration Hub.

  1. In NiCE CXone, click the app selector and select Automation & AIIntegration Hub.

  2. Click the connection you want to work with from My Connections on the left side of the page.

  3. On the Requests tab, click Test next to the request you want to execute. A page pops up and displays the response from the connected web service.

  4. Select and copy the contents of the response from the page if you want to keep it.

  5. Click Cancel when you're done reviewing the response.

Use Authentication in a Script

Connections can store authentication details. You can use them in your script anywhere you need them. They can be used on their own or along with a request.

  1. In NiCE CXone, click the app selector and select Studio.

  2. Open the script you want to add the request to.

  3. Add a ConnectAuth action to the script.

  4. In the connectName property of ConnectAuth, enter the name of the connection you want to use. If you don't know the connection name: 

    1. Click open editor Icon of a window. on ConnectAuth to open Integration Hub.
    2. Under My Connections, click the check mark An icon of a check mark. next to the connection you want to use.
    3. Click Yes to assign it to the action.

    Instead of using the name of a specific connection in the connectName property, you can use variable substitution. Create a variable to hold the connection name, then use script logic to pass the name to ConnectAuth.

  5. Save your changes.

Use a Manual Request in a Script

You can use a manual request in your script anywhere you need to make the API call. The request must be defined in an Integration Hub connection.

The script may need more editing to handle the response returned from the resource the request connects to. Additionally, the ConnectRequest action may require additional configuration.

  1. In NiCE CXone, click the app selector and select Studio.

  2. Open the script that you want to use the request in.

  3. Add a ConnectRequest action to the script.

  4. In the connectName and requestName properties, enter the names of the connection and request you want to use. If you don't know the names: 

    1. Click open editor Icon of a window. on ConnectRequest to open Integration Hub.

    2. Under My Connections, click the check mark An icon of a check mark. next to the connection you want to use.

    3. Click Yes to assign it to the action.

    4. Select the connection you just assigned to ConnectRequest.

    5. On the Requests tab, click the box for the request you want to assign to this action and click OK.

    Instead of using the name of a specific connection and request in the connectName and requestName properties, you can use variable substitution. Create variables to hold the names, then use script logic to pass the names to ConnectRequest.

  5. To use a variable from the linked connection in the script, enclose the name of the variable in double brackets, like this:[[variableName]].

Use a Studio or Hybrid Request in a Script

To use a Studio request, you first add it to an Integration Hub connection, and then to a script using the ConnectRequest action. To use a hybrid request, create a manual request instead of a Studio, then connect it to your script just as you would a Studio request.

The details of the request may be changed by inputs from Studio, so those details are often built in a SNIPPET action so they can be passed to the ConnectRequest action.

The script may need more editing to handle the response returned from the resource the request connects to. Additionally, the ConnectRequest action or the Snippet action may require additional configuration.

  1. Create a Studio request or a manual request in Integration Hub and build a request object in your script, if you haven't already done so.

  2. In Studio, open the script that contains the request you want to use.
  3. Add a ConnectRequest action to the script after the Snippet action that holds the request object and connect them.
  4. In the connectName property of ConnectRequest, enter the names of the connection you want to use. If you don't know the name: 

    1. Double-click ConnectRequest to open Integration Hub.

    2. Under My Connections, click the check mark An icon of a check mark. next to the connection you want to use.

    3. Click Yes to assign it to the action.

    4. Select the connection you just assigned to ConnectRequest.

    5. On the Requests tab, click the box for the request you want to assign to this action and click OK.

    Instead of using the name of a specific connection and request in the connectName properties, you can use variable substitution. Create a variable to hold the name, then use script logic to pass the name to ConnectRequest.

  5. Select the ConnectRequest action and configure the RequestPayload field with the name of the variable that holds the JSON request. You defined this variable in the Snippet.
  6. To use a variable from the linked connection in the script, enclose the name of the variable in double brackets, like this:[[variableName]].

  7. If your connection requires authorization, add and configure the ConnectAuth action in your script.

Use a Hybrid Request in a Script

  1. Create a manual request in an Integration Hub connection.
  2.