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(IntegrationCreationRequest creationRequest);
async Task<Integration> CreateAsync(IntegrationCreationRequest creationRequest);
Parameters
Parameter | Type | Description |
---|---|---|
creationRequest | IntegrationCreationRequest | The request containing Integration configuration metadata |
returns | Integration | The requested Integration |
IntegrationCreationRequest
IntegrationCreationRequest
Name | Type | Description |
---|---|---|
Name | string | The display Name to apply to the Integration |
Type | IntegrationType | The Type of the Integration. Currently only OAuth2 is supported |
Config | IntegrationConfiguration | The configuration settings for the 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 | Uri | The base URL of the OAuth Application |
Site | Uri | The website of the OAuth Application |
Scopes | List<string> | The list of Scopes to apply to Connections using the Integration |
UseBodyAuth | bool | Boolean indicating whether auth params should be sent to OAuth app in body |
Example
/*
* This example demonstrates creating a custom Integration
*/
using Catalytic.Sdk.Entities;
namespace Catalytic.Sdk.Examples
{
class Program
{
static void Main(string[] args)
{
var catalytic = new Catalytic.Sdk.CatalyticClient(AccessToken.Default);
var request = new IntegrationCreationRequest {
Name = "My Custom Integration",
Type = IntegrationType.OAuth2,
Config = new IntegrationConfiguration {
ClientId = "MY_OAUTH_CLIENT_ID",
ClientSecret = "MY_OAUTH_CLIENT_SECRET",
TokenPath = "/oauth2/token",
RevokePath = "/oauth2/revoke",
AuthorizeBaseUrl: "https://example-oauth-app.com/oauth2/authorize",
Site = "https://api.example-oauth-app.com",
Scopes = new List<string> { "read", "write" },
UseBodyAuth = false
}
};
var integration = await catalytic.Integrations.CreateAsync(request);
Console.WriteLine(integration.Name);
}
}
}
Updated almost 4 years ago