X

The Integration blog covers the latest in product updates, best practices, customer stories, and more.

Little known way to change connections in an integration

Arif Rafique
Director, Software Development

Sometimes we want to change the connection(s) we are using in an integration. We may have the following use cases:

  • We have created an integration which uses connection A but want to replace that with connection B.
  • We have imported an integration which uses a Oracle Sales Cloud connection (Sample sales cloud) but we have already a Oracle Sales Cloud connection configured (My Sales Cloud) in our system and want to use that connection instead of using the connection that came with the integration.
  • We have cloned an integration and in the cloned integration we want to use a different connection.

In this blog, I will show you the trick to replace connection(s) in an integration !

Couple of points to remember before updating the connection in an integration.

  • The integration can't be in locked or activated state.
  • Only connection of same adapter type can be replaced. You can't replace a connection of Oracle Sales Cloud adapter with a connection of FTP adapter type.

I will utilize the integration update REST API to replace the connection. As an example, I will use the Incident details from Service Cloud Integration which is delivered as sample in OIC and uses 'Sample Service Cloud'  as one of the connections. I will replace the 'Sample Service Cloud' connection with 'My Service Cloud' connection which I had already configured.

  • First, I will use the retrieve integration REST API to see the details of the 'Incident details from Service Cloud' integration. You can use curl or Postman REST client.

  • As you can see from the dependencies section, this integration uses two connections and following are the Identifiers for them
    • MY_REST_ENDPOINT_INTERFAC
    • SAMPLE_SERVICE_CLOUD
  • Now, I will use the update Integration REST API to replace the 'SAMPLE_SERVICE_CLOUD' with 'MY_SERVICE_CLOUD' (this is the identifier of the 'My Service Cloud' connection). You can find the identifier of an connection by going to the connection list page and clicking on the info icon for that connection. In the body of the REST API you will need to provide the dependencies details. You can copy and paste the dependencies that you got from the first REST API call. Make sure to use X-HTTP-Method-Override = PATCH in the HTTP header.

You can go to the Integration list page and hover your mouse over the connection. You will see the integration is now using the 'My Service Cloud' Connection.

 

 

Join the discussion

Comments ( 5 )
  • Venkat Bollina Monday, November 12, 2018
    Hi Arif,
    This is an interesting option to update connectors in integration. I tried updating the connector in an integration, unfortunately it did not worked for me. I was able to update integration statuses using REST API successfuly, but not able to change connectors. the API responding with 200 when posted for connector change, but connector not getting updated.
    Does this have any dependency on specific OIC version? i am using User Managed OIC instance with Version: 18.3.5.0.0 (180918.1047.15760)
  • Arif Wednesday, November 28, 2018
    Yes, you will need OIC version 18.4.1 (181017.0400.17560) or later for this feature.
    Thanks
  • Anand Friday, December 21, 2018
    hi Arif, really a great option from API rather than doing in IAR, tried and worked like a charm, Thanks!
  • Shrikrishna Wednesday, February 27, 2019
    HI Arif,

    I am trying for the same option. Getting below error in response. Using OIC version : 19.1.3.0.0.

    {
    "status": "HTTP 400 Bad Request",
    "title": "Failed to save integration configuration because the size of the dependencies attribute doesn't match with existing.",
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1"
    }
  • Arif Monday, March 4, 2019
    Hi Shrikrishna,
    Please make sure the number of the connections are the same (under dependencies) in your POST call as you got from GET REST API call. Copy and paste the dependencies for the connection that you got from the GET integration REST API call and then only change the connection id you want to replace. For example, you got the following dependency from the get integration REST call
    {
    "dependencies": {
    "connections": [
    {
    "id": "RIGHTNOW_OLD"
    },
    {
    "id": "SOAP_SALESCLOUD"
    }
    ]
    }
    }
    You want to replace RIGHTNOW_OLD with RIGHTNOW_NEW. The body of the POST need to be
    {
    "dependencies": {
    "connections": [
    {
    "id": "RIGHTNOW_NEW"
    },
    {
    "id": "SOAP_SALESCLOUD"
    }
    ]
    }
    }
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.