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

https://help.catalytic.com/docs/custom-integrations/

Method Signature

create(string $name, string $type, array $config): Integration

Parameters

ParameterTypeDescription
$namestringThe display name to apply to the Integration
$oauthConfigIntegrationConfigurationThe oauth configuration settings for the integration
returnsIntegrationThe created Integration

IntegrationConfiguration

NameTypeDescription
clientIdstringClient ID of the OAuth Application
clientSecretstringClient Secret of the OAuth Application
tokenPathstringToken Path of the OAuth Application
revokePathstringToken Revocation Path of the OAuth Application
authorizeBaseUrlstringThe base URL of the OAuth Application
sitestringThe website of the OAuth Application
scopesstring[]The list of Scopes to apply to Connections using the Integration
useBodyAuthbooleanBoolean indicating whether auth params should be sent to OAuth app in body

Example

<?php

/*
 * This example demonstrates creating a custom Integration
 */

require_once(__DIR__ . './vendor/autoload.php');

use Catalytic\SDK\CatalyticClient;
use Catalytic\SDK\Entities\IntegrationType;

$catalytic = new CatalyticClient();
$oauthConfig = array(
  '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' => array('read', 'write'),
  'useBodyAuth' => false
);
$integration = $catalytic->integrations()->create('My Custom Integration', $oauthConfig);

echo $integration->getName() . ":" . PHP_EOL;