Create an Integration
Create a custom Integration with which Connections can be created. To create a new Integration, you must provide your own application authentication parameters.
Learn More about Custom Integrations
Method Signature
Integration create(String name, IntegrationConfiguration oauthConfig);
Parameters
Parameter | Type | Description |
---|---|---|
name | String | The display name to apply to the Integration |
type | String | The type of the integration. Currently only oAuth2 is supported |
oauthConfig | IntegrationConfiguration | The oauth configuration settings for the integration |
returns | Integration | The created Integration |
IntegrationConfiguration
IntegrationConfiguration
Name | Type | Description |
---|---|---|
clientId | String | Client ID of the OAuth Application |
clientSecret | String | Client Secret of the OAuth Application |
tokenPath | String | Token Path of the OAuth Application |
revokePath | String | Token Revocation Path of the OAuth Application |
authorizeBaseUrl | String | The base URL of the OAuth Application |
site | String | The website of the OAuth Application |
scopes | List<String> | The list of Scopes to apply to Connections using the Integration |
useBodyAuth | Boolean | Boolean indicating whether auth params should be sent to OAuth app in body |
Example
/*
* This example demonstrates creating a custom Integration
*/
import org.catalytic.sdk.CatalyticClient;
import org.catalytic.sdk.entities.Integration;
import org.catalytic.sdk.entities.IntegrationConfiguration;
public class Program {
public static void main(String[] args) throws Exception {
// Create and initialize the Catalytic SDK Client
CatalyticClient catalytic = new CatalyticClient();
IntegrationConfiguration oauthConfig = new IntegrationConfiguration(
"myOauthId",
"myOauthSecret",
"/token",
"/revoke",
new URI("https://example.com/"),
new URI("https://example.com/oauth"),
Arrays.asList("read", "write")
);
// Create a new oauth Integration
Integration integration = catalytic.integrations().create("Example Integration", oauthConfig);
System.out.println("Integration name: " + integration.getName());
}
}
Updated almost 4 years ago