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
- 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.