Skip to main content
Version: v1 (Current)

Third-Party Integrations

Overview​

GxP connects external event platforms through provider-specific inbound imports and supported outbound synchronization paths. Inbound data flows through the Import Strategy system, where each provider implements a strategy class that pulls data from the external API and normalizes it into RowDTO objects. Outbound data flows through the Entity Sync system.

Integration identifiers supply origin markers that compatible outbound consumers can use to suppress sync-back. A marker alone does not establish loop prevention for every model or consumer. See the importer guide for mapping and propagation requirements.

For verified source-specific behavior, review Cvent prerequisites and pre-approval type creation, Cvent sessions, Swoogo window limits and Legacy Eventfinity paging. Provider registration does not guarantee every registry type/source combination or complete live delivery.

Import-provider matrix​

ProviderStrategy Import TypesAuth MethodAutomatic ConfigurationConfig FileAttendee Import Key
Cventattendee, attendee_field, agenda_itemOAuth 2.0 (Authorization Code)Supported; verify source/type pathconfig/cvent.phpthird_party_id
Swoogoattendee, attendee_fieldOAuth 2.0 (Client Credentials)Supported; verify completeness limitsconfig/swoogo.phpuuid
Legacy EventFinityattendee, attendee_field, agenda_itemAPI KeySupported; verify source/type pathconfig/legacy_eventfinity.phpthird_party_id
Google RSVP (develop 25e1564)attendeePlatform service-account impersonation plus platform API keySnapshot preparation; verify deployed availabilityconfig/google_rsvp.phpthird_party_id

With reviewed defaults, Swoogo schedules five windows covering row indexes 0–4,999 regardless of reported total; reconcile larger populations before relying on a complete sync. Legacy Eventfinity normally uses 500 rows per page and inclusive end boundaries, with job count derived from metadata. Provider data can move between pages. See the linked importer sections for configuration and replay limits.

The last column describes attendee keys. Other types have their own keys (for example, attendee-field definitions use slug). Check the actual type configuration and recognized column before selecting a matching key. Strategy branches and provider UI availability can also differ; the Swoogo guide describes that distinction.

This matrix covers the import strategies described here, not every integration available in GxP. Google Drive, remote files and HTTP webhook connections have other purposes and setup paths. Use Remote files and HTTP webhooks for those connection types and the sync reference for currently registered outbound service/entity pairs.

Set up a built-in import connection​

  1. Choose the team and source event. Work in the intended team, confirm the external account can read the intended event, and select a supported import type from the matrix. A connected account does not grant access to every provider event or make every GxP module importable.
  2. Connect the provider. Use the provider-specific connection flow below. Keep provider credentials in the supported server-side connection or deployment configuration; the documentation site and portal app code do not need the provider secret to run the import.
  3. Create an import in the target project. Select the connection, supported source/type, event and matching key. Source configuration uses cvent_event_id, swoogo_event_id or the Legacy Eventfinity event context as described in the importer guide. Google RSVP copies its event from the selected connection as described below. Verify the provider identifier and target project before fetching data.
  4. Inspect preparation and preview. Confirm destination fields, remapping, create/update decisions and expected source population. Cvent attendee preparation can create attendee types before approval; Google RSVP setup/preparation can create or alter default attendee fields as described below. To retain manual row review, require review and disable automatic processing.
  5. Approve and verify actual outcomes. Follow Create and review an import, inspect row errors/results and resulting target records, and compare expected provider counts with fetched/imported counts. Approval or a connected token alone is not completion evidence.
  6. Enable automation or outbound sync deliberately. Configure the supported interval only after checking review-bypass behavior and provider completeness limits. Outbound sync requires a registered builder and a configured consuming workflow or service path; creating an inbound connection does not enable bidirectional synchronization by itself.

Provider connection prerequisites​

ProviderConnection flow and checks
CventStart the Cvent OAuth connection from the intended team and finish authorization in the same authenticated admin context. The platform must have a registered Cvent client and matching callback URL. Pending team context is short-lived; if it expires, restart the connection flow rather than replaying a stale callback. Select the intended Cvent event for the import.
SwoogoSupply the Swoogo client ID and client secret in the connection flow. The store path exchanges them for an access token through the Swoogo service; a rejected exchange is a connection failure, not an empty import. Supply swoogo_event_id for the source event.
Legacy EventfinitySupply the API token. Creation detects a configured legacy environment and rejects an invalid token. It fetches available events and records a default event only when exactly one is returned; with multiple events, confirm the intended event context rather than assuming the first one is selected.

Connection credentials and platform OAuth client configuration have different owners. An operator supplies the Swoogo credentials or Legacy Eventfinity token to a team connection. The Cvent OAuth client ID/secret and redirect settings in config/services.php belong to platform deployment configuration; an operator completes Cvent authorization to create the team connection. Do not substitute deployment client secrets for per-connection tokens.

The Cvent callback, Swoogo token exchange and Legacy Eventfinity environment detection make external requests. A successful local declaration or mocked test does not establish that deployed credentials, callback configuration or provider permissions work.

Google RSVP connection and attendee import​

This section describes develop commit 25e1564 reviewed on 2026-10-19. Confirm that the deployed platform offers Google RSVP before scheduling a production import. It is separate from Google Drive connections.

  1. In Google RSVP admin, enable badge printing for the event and select GXP as the partner. This grants the platform service account access to that event.
  2. In the intended team's integration connection flow, choose Google RSVP and enter RSVP Event ID: the 32-character lowercase hexadecimal ID from the event URL (rsvp.withgoogle.com/admin/events/<ID>/dashboard). Enter the ID, not the full URL. No provider credential is typed into this connection form.
  3. Open the full Integrations create page when the embedded connector redirects there. Save the connection. The server probes the event's guest list before saving. An existing connection for the same event ID is rejected even if it belongs to another team; ask the connection administrator to resolve ownership. Event name/time zone are optional metadata: missing labels alone do not prove the guest-list probe failed. The event ID is read-only when editing.
  4. Create a Google RSVP attendee import in the target project and choose this workspace's Google RSVP connection. The event is copied from the connection; do not substitute an unrelated event ID. Other import types are rejected.
  5. Review source headers, destination pairings and create/update decisions, then follow the normal import review and approval flow. Verify actual target records and row errors before enabling automation.

The default attendee key is third_party_id, mapped from guestId. Preset pairings include given/family name, email, company, confirmation code, RSVP state/role and source check-in time. Review check-in pairing explicitly: a detected source column is not permission to assume a local check-in write will occur.

Creating the import and preparing metadata can ensure text fields company, rsvp_state, rsvp_role and confirmation_number exist before row approval. Newly created fields are defaults for all attendee types; existing RSVP state/role fields can also be made defaults. Account for these form/schema effects when trialing an import.

Preparation reads guest pages into a snapshot, and chunk jobs consume that snapshot rather than fetching each page again. The default chunk size is 1,000 rows. Badge configuration controls allowed source columns when available; the client's compatibility fallback for a missing badge-config endpoint allows all columns at that stage. Custom-column metadata and existing project fields still affect destination pairing. Inspect the actual preview rather than assuming every Google field will be imported or redacted.

Incremental fetching uses the source guest updateTime, including retained microsecond precision when consistent with the saved timestamp. The strategy parks a pending cursor; fetching data is not proof that all attendee writes succeeded. Reconcile run settlement, errors and expected population before treating a run as complete.

SymptomNext check
Event ID rejectedSupply exactly 32 lowercase hexadecimal characters; check whether the event already has a connection.
Event access deniedConfirm badge printing and the GXP partner selection for that event.
API key or service-account configuration failureAsk the platform operator to verify deployment configuration and impersonation access. Re-entering the event ID does not repair platform credentials.
Import stops after access is revokedThe strategy disables automatic processing, records a connection sync error and marks the connection disconnected; existing local data is retained. Restore provider access, verify the connection and review the import before re-enabling automation.
Guest data fetch failsInspect the recorded failure rather than interpreting it as an empty source population.
Fields or check-ins differ from expectationsInspect badge-config restrictions, detected headers, destination fields, manual pairings and actual row outcomes.

For operators, authentication uses the platform Google identity to impersonate the registered RSVP service account and request the RSVP OAuth scope. The platform also supplies an API key. These belong in server deployment configuration; portal apps and documentation visitors do not supply or receive them. Detailed IAM and deployment procedures remain in operator runbooks.

The setup and failure paths above were source-reviewed. No live Google credentials, provider connection or attendee writes were exercised for this documentation update.

Access and management boundaries​

The configured integration_token policy mapping declares view_integration_tokens for listing/viewing and manage_integration_tokens for create/update/delete/restore actions. These are configured keys, not proof that every integration endpoint invokes that policy. The checked controller does not use authorizeResource() or explicit policy authorization; its visibility and global-management checks are separate. Verify endpoint permission behavior for the intended role before delegating connection administration.

Team routes use authenticated, verified dashboard context with team-scoping middleware. Existing-token management checks team/global visibility; invisible tokens return 404, while changing a global connection requires a super admin. Ordinary token creation is pinned to the current team. These boundaries do not make a project portal identity, reader credential or public documentation visitor a connection administrator.

Native endpoint checks cover wrong-team reads/updates/deletes/tests/refresh, global visibility, non-super-admin global denials, provider credential validation and refresh dispatch. Their setup grants broad policy access, so they do not establish role-level enforcement of the configured policy keys. In browser flows, inspect validation/session errors as well as the redirect response.

Import permissions are separate from connection management: see import access and review decisions. The generic edit request does not rotate every provider's credentials. Use the supported refresh/reconnect path or implement and test an explicit rotation flow for a new provider; changing display metadata is not credential renewal.

Import Method Constants​

Selected constants from app/Models/Import.php (the excerpt is not the complete provider list):

public static $IMPORT_METHOD_FILE = 'file';
public static $IMPORT_METHOD_COPY = 'copy_paste';
public static $IMPORT_METHOD_LEGACY_EF = 'legacy_ef';
public static $IMPORT_METHOD_CVENT = 'cvent';
public static $IMPORT_METHOD_SWOOGO = 'swoogo';
public static $IMPORT_METHOD_GOOGLE_RSVP = 'google_rsvp';

Integration Identifier Constants​

Used to track origin for compatible sync-back suppression:

public const INTEGRATION_EVENTFINITY = 'eventfinity';
public const INTEGRATION_CVENT = 'cvent';
public const INTEGRATION_SWOOGO = 'swoogo';
public const INTEGRATION_GOOGLE_RSVP = 'google_rsvp';

The importMethodToIntegration() method maps import methods to integration identifiers; this excerpt includes the develop Google RSVP adapter:

public static function importMethodToIntegration(?string $importMethod): ?string
{
return match ($importMethod) {
self::$IMPORT_METHOD_LEGACY_EF => self::INTEGRATION_EVENTFINITY,
self::$IMPORT_METHOD_CVENT => self::INTEGRATION_CVENT,
self::$IMPORT_METHOD_SWOOGO => self::INTEGRATION_SWOOGO,
self::$IMPORT_METHOD_GOOGLE_RSVP => self::INTEGRATION_GOOGLE_RSVP,
default => null,
};
}

Integration Architecture​

OAuth Provider (Socialite) --> IntegrationToken (stored credentials)
|
API Service Class (HTTP client)
|
┌───────────────┴───────────────┐
| |
Import Strategy SyncBuilder
(pull data in) (push data out)

The diagram illustrates OAuth adapters. Google RSVP instead stores event context on the connection and obtains credentials from platform configuration; it does not use a Socialite connection callback or store a user OAuth refresh token there.

The flow for an OAuth-backed inbound sync:

  1. IntegrationToken stores provider credentials and token expiry. Expiry is cast as a datetime, not an encrypted secret; secret storage uses dedicated encrypted handling.
  2. The Import Strategy reads the token, instantiates the provider's API Service Class, and calls the external API.
  3. Raw API responses are flattened, remapped, and converted to RowDTO arrays.
  4. The importer core processes those DTOs through the standard column mapping and row processing pipeline.

Adding a New Integration​

Step 1: Choose authentication and connection handling​

The following scaffold is for an OAuth/Socialite adapter. A platform service-account adapter such as Google RSVP needs server credential provisioning and event-access verification instead.

OAuth Provider (Socialite)​

Extend Laravel Socialite's AbstractProvider and implement the IntegrationProvider interface.

Location: app/Services/Socialite/{Provider}Provider.php

Illustrative abstract scaffold (see CventProvider for the built-in implementation). Replace the example endpoints and implement user lookup before creating a concrete provider. Authentication grants and required token-response fields depend on the actual provider; this scaffold is not a working connection:

namespace App\Services\Socialite;

use App\Services\Socialite\Concerns\IntegrationProvider;
use Laravel\Socialite\Two\AbstractProvider;
use SocialiteProviders\Manager\OAuth2\User;

abstract class NewProviderProvider extends AbstractProvider implements IntegrationProvider
{
protected function getAuthUrl($state)
{
return $this->buildAuthUrlFromBase('https://api.provider.com/oauth/authorize', $state);
}

protected function getTokenUrl()
{
return 'https://api.provider.com/oauth/token';
}

abstract protected function getUserByToken($token);

protected function mapUserToObject(array $user)
{
return (new User)->setRaw($user)->map([
'id' => $user['id'],
'name' => $user['name'] ?? null,
'email' => $user['email'] ?? null,
]);
}

/**
* Exchange the authorization code for tokens.
* Called by the OAuth integration service during callback.
*/
public function getOathData(): array
{
$response = $this->getAccessTokenResponse($this->getCode());
if (! isset($response['access_token'])) {
throw new \RuntimeException('Invalid access token response');
}
return $response;
}

/**
* Map raw token data to IntegrationToken fillable fields.
*/
public function mapToIntegrationToken(array $data): array
{
return [
'access_token' => $data['access_token'],
'refresh_token' => $data['refresh_token'] ?? null,
'token_type' => 'Bearer',
'expires_at' => now()->addSeconds($data['expires_in']),
'provider_name' => 'new_provider',
'admin_id' => $data['admin_id'],
'team_id' => $data['team_id'],
'slug' => \Str::uuid(),
];
}
}

Token mapping must use trusted admin/team context supplied by the authorized callback flow, not provider claims or unrestricted browser input. Confirm expiry and refresh-token behavior against actual responses; registering a Socialite provider or copying the mapper alone does not establish callback state validation, permissions or token refresh acceptance.

The IntegrationProvider interface (app/Services/Socialite/Concerns/IntegrationProvider.php) requires:

interface IntegrationProvider
{
public function mapToIntegrationToken(array $data): array;
}

Before calling Socialite::driver('new_provider'), register that driver with Socialite. The integration provider registry supplies application metadata; it does not register a Socialite driver.

Use app/Providers/SocialiteCventServiceProvider.php as the existing registration pattern: its boot() calls Socialite::extend('cvent', ...) and constructs the concrete provider with the current request, client ID, client secret and resolved redirect URL. Register your equivalent service provider in config/app.php, where the Cvent service provider is registered. Add your provider's credentials and redirect configuration to config/services.php and supply the corresponding environment values. Instantiate your completed concrete provider, not the abstract scaffold above.

The Cvent implementation combines app.domain_dashboard with the configured redirect path and forces HTTPS. Resolve your own callback URL according to your provider configuration, and ensure it exactly matches the callback registered with the external provider. Driver registration, credential configuration and callback route registration are separate requirements.

Step 2: Create OAuth Integration Service​

Handles the redirect/callback flow and token refresh. Stores tokens via IntegrationTokenService.

Location: app/Services/Oath/{Provider}OauthIntegrationService.php

The built-in Cvent flow caches pending team context per admin for 120 seconds, checks for missing/expired context and team identity, consumes that context, then maps tokens using the logged-in admin and resolved team. These checks are separate from provider OAuth state handling and route/permission enforcement; verify the complete callback path for your integration.

The following abstract extension scaffold makes team/state authorization an explicit required hook. Implement that hook to validate and consume pending context, resolve the team and verify the caller's permission. Register the provider's actual redirect/callback routes and test missing, expired and wrong-context callbacks before exposing a concrete service.

namespace App\Services\Oath;

use App\Models\IntegrationToken;
use App\Services\IntegrationTokenService;
use App\Services\Oath\Contracts\RefreshableOauthIntegrationService;
use Illuminate\Http\Request;
use Laravel\Socialite\Facades\Socialite;

abstract class NewProviderOauthIntegrationService implements RefreshableOauthIntegrationService
{
public function __construct(
protected IntegrationTokenService $integrationTokenService
) {}

abstract protected function resolveAuthorizedTeamId(Request $request): int;

public function redirect()
{
return Socialite::driver('new_provider')->redirect();
}

public function handleCallback(Request $request)
{
$user = $request->user();
if (! $user) {
throw new \RuntimeException('Authenticated callback required');
}
$teamId = $this->resolveAuthorizedTeamId($request);
$provider = Socialite::driver('new_provider');
$integrationInfo = $provider->getOathData();
$integrationInfo['admin_id'] = $user->id;
$integrationInfo['team_id'] = $teamId;

return $this->integrationTokenService->create(
$provider->mapToIntegrationToken($integrationInfo)
);
}

public function refreshToken(IntegrationToken $token): IntegrationToken
{
$response = Socialite::driver('new_provider')->refreshToken($token->refresh_token);
return $token->updateOAuthTokens(
accessToken: $response->token,
expiresIn: $response->expiresIn,
refreshToken: $response->refreshToken,
);
}
}

updateOAuthTokens() retains the existing refresh token when the new response supplies null, and retains expiry when no truthy interval is supplied. Confirm your provider's rotation/expiry contract and response object shape. This scaffold establishes declaration requirements; it does not implement OAuth state validation, the required team hook or a real provider connection.

Step 3: Create API Service Class​

HTTP client wrapping the provider's REST API. Uses the IntegrationToken for bearer auth.

Location: app/Services/{Provider}Service.php

The built-in Cvent attendee client streams pages, validates response JSON/data shape, detects repeated cursor cycles and raises unrecoverable errors. A complete platform-context example of consuming those pages is:

use App\Models\IntegrationToken;
use App\Services\CventService;

function streamCventAttendeeRows(IntegrationToken $integrationToken, string $eventId): \Generator
{
$service = new CventService($integrationToken);
foreach ($service->getAttendeesPaged(['event_id' => $eventId]) as $page) {
foreach ($page as $row) {
yield $row;
}
}
}

The caller must supply an authorized token and intended event. This helper consumes Cvent data; a new provider requires its own authenticated client, response schema and pagination contract. Do not assume another API shares Cvent's opaque-token behavior.

In the reviewed Cvent attendee path:

  • A 401 permits one refresh retry per page, with the count reset after a successful page.
  • A 429 permits two rate-limit retries per page. Retry-After seconds or HTTP dates are normalized to a delay between one and 30 seconds.
  • Repeated cursors, malformed JSON, missing data arrays and unrecoverable responses raise errors instead of returning a truncated result as success.
  • Successful earlier pages can already have been consumed before a later failure. Consumers must handle partial staging/retry explicitly; streaming is not an all-or-nothing transaction.

Use an explicit retry loop that can retry the first page even while its next token is null. A continue inside do ... while ($nextToken) can exit immediately after a first-page authentication failure. Verify first-page failures, later-page failures, cursor cycles and exhausted retries with fake HTTP responses before testing a live provider.

Step 4: Create Configuration File​

Location: config/{provider}.php

The configuration file defines integration types, column remapping, importable columns, import keys, and the base URI. Here is the structure based on config/cvent.php:

return [
// Which import types this provider supports
'integration_types' => [
'attendee',
],

// Number of pages fetched per queued job
'job_per_page' => 1,

// Rename API fields to match GXP internal column names
// Maps: source_api_field => gxp_column_name
'remapped_columns' => [
'attendee' => [
'contact.email' => 'contact_email',
'registrationType.code' => 'attendee_type',
'contact._links.profilePicture.href' => 'user_avatar_url',
'checkIn' => 'checked_in_at',
],
'attendee_field' => [
'column_name' => 'slug',
'display_label' => 'name',
'input_type' => 'field_type',
],
],

// Provider-specific header/mapping configuration, consumed by its strategy
// Attendee candidates use dot-path keys with boolean values here;
// attendee_field mappings below use source keys and target column names
'importable_columns' => [
'attendee' => [
'id' => true,
'confirmationNumber' => true,
'contact.firstName' => true,
'contact.lastName' => true,
'contact.email' => true,
'contact.company' => true,
'contact.title' => true,
// ... full list in config/cvent.php
],
'attendee_field' => [
'column_name' => 'slug',
'display_label' => 'name',
'input_type' => 'field_type',
],
],

// Columns to strip from API responses before import
'remove_columns' => [
'attendee' => [
'password',
],
],

// Which column serves as the unique key for upsert matching
'import_keys' => [
'attendee' => 'third_party_id',
'attendee_field' => 'slug',
],

// Provider API base URL
'base_uri' => 'https://api.provider.com/v1/',
];

For comparison, Swoogo uses 'uuid' as its attendee import key and 'https://api.swoogo.com/api/v1' as its base URI. Legacy EventFinity supports multiple environments via an api_base_url map with keys like google_production, aws_production, development, etc.

Step 5: Create Import Strategy​

Extend BaseImportStrategy and implement ImportStrategyInterface.

Location: app/Services/Importer/ImportStrategies/{Provider}ImportStrategy.php

The interface (ImportStrategyInterface) requires three methods:

interface ImportStrategyInterface
{
public function setImport(Import $import);
public function getMetadata(Import $import): StrategyMetadataDTO;
public function getImportData(int $startRow, int $endRow): array;
}

getMetadata() returns a StrategyMetadataDTO:

class StrategyMetadataDTO
{
public int $rowCount;
public array $columnHeaders;
public $remappedColumns;

public function __construct(int $rowCount, array $columnHeaders, ?array $remappedColumns = null)
{
$this->rowCount = $rowCount;
$this->columnHeaders = $columnHeaders;
$this->remappedColumns = $remappedColumns;
}
}

getImportData() returns an array of RowDTO objects:

class RowDTO
{
public int $rowNumber;
public array $row; // associative array of column_name => value
public array $errors = [];

public function __construct(int $rowNumber, array $row, array $errors = [])
{
$this->rowNumber = $rowNumber;
$this->row = $row;
$this->errors = $errors;
}
}

Start with the tested strategy contract example. Its in-memory data is useful for checking DTOs and range boundaries; a live provider adapter must supply the source implementation:

  1. Resolve an authorized integration token and validate source context such as event/project identity before fetching.
  2. Retrieve metadata and return a defined count, header list and optional remapping array. Check that metadata and fetched rows describe the same population.
  3. Implement pagination consistent with the requested row ranges or stage a snapshot when the provider only supports opaque next tokens. Keep retry identity separate from changing page offsets.
  4. Implement provider-specific flattening and value conversion explicitly. flattenArray() and convertToDTOs() are not generic methods supplied by BaseImportStrategy; the provider examples define their own helpers. Return RowDTOs with consistent row numbers and associative source-column values.
  5. Propagate fetch errors rather than turning failed retrieval into an apparently successful empty dataset. Test no-data, multi-page, partial failure, replay and mapping behavior using synthetic provider responses before live acceptance.

The canonical example uses zero-based, start-inclusive/end-exclusive ranges. Existing provider overrides can use other conventions; see chunking before implementing getChunkSize or range overrides. Its getChunkSize hook returns a job count, not rows per job.

Step 6: Register in ImportStrategyFactory​

File: app/Services/Importer/ImportStrategies/ImportStrategyFactory.php

Add the new strategy to the $strategies map:

public function __construct($import)
{
$this->import = $import;
$this->strategies = [
Import::$IMPORT_METHOD_FILE => SpreadsheetImportStrategy::class,
Import::$IMPORT_METHOD_COPY => CopyPasteImportStrategy::class,
Import::$IMPORT_METHOD_LEGACY_EF => LegacyEFImportStrategy::class,
Import::$IMPORT_METHOD_CVENT => CventImportStrategy::class,
Import::$IMPORT_METHOD_SWOOGO => SwoogoImportStrategy::class,
Import::$IMPORT_METHOD_GOOGLE_RSVP => GoogleRsvpImportStrategy::class,
Import::$IMPORT_METHOD_NEW_PROVIDER => NewProviderImportStrategy::class, // <-- add
];
}

Also update the Import model:

  1. Add a new static property:

    public static $IMPORT_METHOD_NEW_PROVIDER = 'new_provider';
  2. Add to importMethods() and the import_method allowlist in Import::createRules(). For automatic operation, review scheduler versus helper eligibility and update autoProcessingImportMethods only where that helper needs the method; factory registration does not establish scheduling support.

  3. Add integration constant and mapping:

    public const INTEGRATION_NEW_PROVIDER = 'new_provider';
    // In importMethodToIntegration()
    self::$IMPORT_METHOD_NEW_PROVIDER => self::INTEGRATION_NEW_PROVIDER,

Step 7: Register provider metadata and credential handling​

File: app/Services/Integrations/IntegrationProviderRegistry.php

Add a definition to the existing provider registry, preserving its current entries. The definition supplies the display label, authentication type, capabilities, whether manual creation is offered, and credential/configuration field schemas. Controllers expose these definitions to the create/edit form; provider options and labels are derived from the registry. Do not replace IntegrationToken::getProviderOptions() with a new hardcoded list.

An additive registry entry has this shape (choose fields and authentication appropriate to your provider):

'new_provider' => [
'label' => 'New Provider',
'auth' => self::AUTH_STATIC_KEY,
'capabilities' => [self::CAPABILITY_SYNC],
'manual_create' => true,
'credential_fields' => [
['name' => 'access_token', 'label' => 'API Key', 'type' => 'password', 'required' => true],
],
'config_fields' => [],
],

The registry can generate credential/config rules from those schemas, but adding a definition does not implement the provider's authentication or storage flow. The current store request explicitly uses generated rules for SFTP, HTTP webhook and Google RSVP branches; verify and wire the validation/storage path for your new provider. Confirm required fields, secret handling and request authorization with positive and negative tests before exposing it.

The create and edit paths differ. StoreIntegrationTokenRequest accepts registry provider keys, requires an Eventfinity access token or Swoogo client ID/secret as appropriate, and applies the provider-specific SFTP/webhook/Google RSVP rules. It pins ordinary creation to the current team; only a super admin's global request keeps a null team. HTTP webhook creation rejects global endpoints. Its authorize() returns true, so that method alone is not evidence of route or caller authorization.

UpdateIntegrationTokenRequest accepts only name, description and metadata from the general model rules. HTTP webhooks additionally accept a guarded config.url; the controller merges that URL into existing configuration. Adding credential fields to the registry does not make them editable through this generic update request. Provide and verify an explicit credential rotation or reconnection flow for your provider.

The controller's update and refresh paths check visibility to the current team (or a global integration), returning 404 for an invisible token. Managing a global integration additionally requires a super admin and otherwise raises a 403 denial. Browser requests can be redirected back with a globalErrors session message by the exception handler; a redirect is not proof the operation succeeded. These are controller checks, not proof of the complete route permission matrix; verify middleware and authorization for each new endpoint. The refresh dispatcher currently selects Cvent and Google Drive services explicitly, so a new refreshable service also needs dispatch registration.

For an OAuth provider, add the corresponding controller/routes and redirect/callback/refresh handling. A static-key or SSH provider instead needs its appropriate credential-entry and connection handling. Capabilities describe intended use; they do not register an import strategy or outbound builder. Keep those registrations and integration-origin handling aligned with the preceding steps.

Step 8: (Optional) Create SyncBuilder for Outbound​

If the integration needs to push data back to the external platform, implement app/Services/Sync/Contracts/SyncBuilder.php and use the provider transport contract. See the implementation reference.

Register the concrete builder in the SyncRegistry singleton configured in app/Providers/AppServiceProvider.php. This registry is separate from integration provider metadata and the import strategy factory. Its key combines service name and the builder's entity type; registering the same pair again replaces the earlier builder. Register each intended entity type explicitly.

The interface requires operation support checks and a request plan, plus remote discovery, identifier extraction/persistence, endpoint construction and discovery-result application. It also requires entity class identification, project-scoped entity lookup and cache invalidation. Implement the whole contract rather than a single outbound HTTP call. Test ambiguous discovery, missing remote identifiers, unsupported operations, project mismatch and duplicate execution alongside successful create/update flows.

Existing registrations cover Eventfinity attendees, Cvent sessions/attendees/enrollments/speakers and Google Drive social-stream posts. An inbound Swoogo strategy does not establish an outbound Swoogo builder. Registration alone proves neither transport success nor authorization; enforce the intended caller and project scope before executing the plan.

IntegrationToken Model​

File: app/Models/IntegrationToken.php

Key Fields​

FieldTypeDescription
idintegerPrimary key
admin_idintegerThe admin who created the connection
project_idinteger (nullable)Scoped to a specific project
team_idinteger, nullableOwning team; null represents a global connection
access_tokenstring (encrypted)OAuth access token, encrypted via encrypt()/decrypt() mutators
refresh_tokenSecret accessorNew writes use the encrypted credentials blob; legacy-column fallback supports existing rows
token_typestringToken type (typically Bearer)
expires_atdatetimeWhen the access token expires
scopestring (nullable)OAuth scopes granted
provider_namestringProvider identifier (cvent, google_drive, etc.)
namestring (nullable)Human-readable label
descriptionstring (nullable)Description of the connection
metadataJSON (cast to array)Flexible JSON for sync state tracking
slugstringURL-friendly identifier (used as route key)
client_idSecret accessor, nullableClient credential stored through encrypted credential handling
client_secretSecret accessor, nullableClient secret stored through encrypted credential handling
credentialsencrypted arrayProvider secret blob; hidden from model serialization
configarrayProvider configuration distinct from secret credentials

The fields above include accessors, not only raw database columns. Secret fields are hidden from standard model serialization, but that does not certify every custom response or log path. Legacy fallback compatibility does not prove that all historical secrets have been backfilled into encrypted storage.

Token Expiry Detection​

// Token is already expired
$token->is_expired; // true if expires_at is in the past

// Token is expiring within 2 minutes (use for proactive refresh)
$token->is_expiring; // true if expires_at minus 2 minutes is in the past

When expiry is absent, both model flags return false; this is not proof that the provider token remains usable. Confirm actual provider responses and refresh capability.

Metadata JSON Structure for Sync State​

The metadata column tracks sync state and error information:

{
"last_sync_at": "2026-04-15T10:30:00+00:00",
"last_sync_status": "success",
"last_error": null,
"last_error_at": null,
"status": "active",
"disconnected": false,
"legacy_event_id": "12345",
"legacy_environment": "google_production"
}

recordSyncSuccess() and recordSyncError() reload the token under lockForUpdate inside a transaction before mutating metadata. Their outcomes differ from the user-facing enable/disable setting:

  • recordSyncSuccess(true) records success and can clear an existing error state. It does not indiscriminately re-enable a connection whose status was disabled.
  • recordSyncSuccess(false) records partial completion and retains error details. A completed run can still contain rejected rows.
  • recordSyncError() stores a redacted message, timestamps the error, marks error outcome and checks the original message for auth-failure patterns.
  • clearDisconnected() removes the disconnected flag through a separate ordinary update; it does not use the locked sync-metadata helper. Recording success alone is not the same operation as clearing disconnection.

Auth Failure Detection​

When recordSyncError() is called, it checks the error message against known auth failure patterns. If matched, the token is automatically flagged as disconnected:

$authFailurePatterns = [
'invalid_grant',
'Token has been revoked',
'Token has been expired',
'Invalid Credentials',
'The OAuth client was not found',
'No refresh token available',
'unauthorized',
'authentication failed',
'access_denied',
'admin_policy_enforced',
];

Refreshing Tokens​

The model provides a unified method for updating tokens after a refresh:

$token->updateOAuthTokens(
accessToken: $newAccessToken,
expiresIn: 3600, // optional, seconds
refreshToken: $newRefreshToken // optional, only if rotated
);

Auto-Processing and Scheduled Imports​

Import Model Fields​

FieldTypeDescription
auto_processing_enabledbooleanEnables automatic eligibility and bypasses manual pre-import staging when true
auto_processing_intervalintegerMinimum interval in seconds (min: 300)
process_after_timestampdatetimeStored integration cursor used by supported source/type filters; not next-run scheduling
last_run_atdatetimeWhen the import last ran
integration_token_idintegerFK to the IntegrationToken used for API access

Auto-Processing Import Methods​

The automatic-method helper lists these integration methods. It is used by fetchActiveAutomatedImports; the minute scheduler has a separate eligibility query:

public static function autoProcessingImportMethods()
{
return [
self::$IMPORT_METHOD_LEGACY_EF,
self::$IMPORT_METHOD_CVENT,
self::$IMPORT_METHOD_SWOOGO,
self::$IMPORT_METHOD_GOOGLE_RSVP,
];
}

ProcessAutomaticImportsJob​

File: app/Jobs/ProcessAutomaticImportsJob.php

This class is an empty placeholder. The minute scheduler invokes the automatic-import command, which calls ImportService::processAutomatedImports. That service scans enabled imports with positive intervals and due last-run times, excluding Cvent agenda imports driven by their session-sync cycle. See automatic scheduling; this helper list is not the scheduler's allowlist.

Delta Sync with process_after_timestamp​

A strategy can use process_after_timestamp as an incremental source cursor. This is source/type-specific: for example, Cvent attendee-field definitions are fetched without that timestamp filter. Within the Cvent attendee strategy, the snapshot fetch passes the formatted cursor to the paged client:

$afterTimestamp = $this->import->process_after_timestamp ?? null;
if ($afterTimestamp) {
$afterTimestamp = $this->formatAfterParameterTimestamp($afterTimestamp);
}

$pages = $this->cventService->getAttendeesPaged([
'event_id' => $cventEventId,
'after' => $afterTimestamp,
]);

The relevant successful settlement promotes the candidate cursor captured before fetching, rather than assuming settlement time covers the whole fetch interval. Provider filters, moving pages and source-type behavior still govern the next population. This does not establish a complete change stream or deletion synchronization; reconcile expected records and per-row results. See cursor and settlement semantics.

Automatic processing also changes the review path: auto_processing_enabled true writes validated rows inline even when requires_review is true. To retain manual staging, automatic processing must be false and review required. Review this behavior before enabling a schedule.

Field Mapping and Flattening​

Nested JSON Flattening​

External APIs often return deeply nested JSON. The CventImportStrategy demonstrates three levels of flattening:

  1. Structural flattening (flattenArray / flattenArrayRow): Converts nested objects to dot-notation keys. Only whitelisted keys are flattened (e.g., contact, event, _links):

    // Input: { "contact": { "email": "test@example.com", "firstName": "Jane" } }
    // Output: { "contact.email": "test@example.com", "contact.firstName": "Jane" }

    $fieldsToFlatten = [
    'event' => true,
    'contact' => true,
    'registrationType' => true,
    '_links' => true,
    // ... more in CventImportStrategy
    ];
  2. Custom field flattening (flattenCustomFields): Extracts the contact.customFields array and promotes each custom field's name as a top-level column:

    // Input: { "contact": { "customFields": [{ "name": "Dietary", "value": "Vegan" }] } }
    // Output: { "Dietary": "Vegan" }
    // Array values are joined with commas
  3. Question/answer flattening (flattenQuestionAnswers): Maps question IDs to their text labels (fetched from the API and cached), then promotes answers as columns:

    // Input: { "answers": [{ "question": { "id": "q1" }, "value": ["Yes"] }] }
    // With question map: { "q1": "Attending Dinner?" }
    // Output: { "Attending Dinner?": "Yes" }

Cvent field names and question labels pass through column-name sanitization; they are not stable unique identifiers. Repeated or truncated labels can overwrite a value in the same row. Custom-field arrays are joined with commas. For question answers, multiple values are joined with commas, an empty answer uses No Answer, and an unmapped question ID uses Unknown Question. These are literal fallback values, not proof that the source contained those answers. Review collisions and missing question metadata before approving a mapping.

Column Remapping​

After flattening, the remapped_columns config renames API field names to GXP-standard column names. This happens at the importer core level using the StrategyMetadataDTO's remappedColumns:

// config/cvent.php
'remapped_columns' => [
'attendee' => [
'contact.email' => 'contact_email', // dot-notation source -> flat target
'registrationType.code' => 'attendee_type',
],
],

// config/swoogo.php
'remapped_columns' => [
'attendee' => [
'email' => 'contact_email',
'reg_type_id' => 'attendee_type',
'id' => 'uuid',
'profile_picture' => 'user_avatar_url',
],
],

Importable Columns​

Cvent importable_columns contributes configured header candidates alongside custom fields and preset mappings. It is not a universal response-field acceptance guarantee; destination model columns, remapping and validation determine writes. Its configured API paths have entries such as:

'importable_columns' => [
'attendee' => [
'id' => true,
'contact.firstName' => true,
'contact.lastName' => true,
'contact.email' => true,
// ... ~60 fields total
],
],

For Swoogo, an empty attendee importable_columns array does not mean every column is written. Metadata selects provider fields and omits headers without recognized project/standard destinations unless remapped; remove_columns also excludes configured headers such as password:

'remove_columns' => [
'attendee' => ['password'],
],

Legacy EventFinity uses a more extensive remove_columns list to strip avatar files, metadata, and internal IDs.

Formatters​

A declared formatter is not evidence that a data path invokes it. The current Cvent strategy declares formatters but getImportData does not call that method; its field/question and session transformations use their explicit processing paths. Legacy Eventfinity calls its per-type formatters when their columns are present in the detected headers. See the verified provider behavior.

Spreadsheet and paste imports use the shared formatRows helper, which matches raw source keys to configuration keys. A remapped source header can bypass a formatter attached to the destination slug. Provider attendee emails use a separate mapped-email normalization helper. See formatter and rule contracts before depending on a transformation.

Fuzzy Column Mapping​

The BaseImportStrategy provides generateFuzzyColumnMappings() which automatically maps incoming column names to GXP column names using:

  1. Exact literal matches
  2. Normalized matches (lowercase, separators collapsed to underscores)
  3. Common aliases from the target model's import configuration (common_remap_columns), distinct from stored source settings
  4. Fuzzy matching with similar_text() at a 90% threshold

The literal pre-pass reserves targets but does not guarantee that final mapping preserves identity. The reproduced first_name/first_names collision is documented in the importer mapping guide. Review the final mapping and explicitly correct ambiguous fields; similarity alone does not establish the intended destination.

Troubleshooting integration imports​

SymptomWhat to check
Socialite cannot resolve the driverRegister the concrete provider with Socialite::extend, register its service provider, and configure credentials and the resolved callback URL. Application registry metadata does not register the driver.
Provider appears in the form but cannot importCheck the strategy factory, import-method allowlist, method-to-integration mapping and supported data type. Registry capabilities alone do not wire these paths.
Credential edits have no effectThe generic update request accepts descriptive fields and the webhook URL exception. Use the provider's explicit rotation/reconnection flow.
Integration is invisible or management returns 403Confirm the current team and token ownership. Invisible tokens return 404 in the checked controller paths; global integration management requires a super admin.
Refresh reports unsupported providerThe refresh dispatcher selects providers explicitly. Implementing the refresh interface alone does not register a new service there.
Scheduled import does not runCheck enabled state, positive interval and last-run timing. Cvent agenda imports use their session-sync cycle. The automatic-method helper and placeholder job do not define the minute scheduler's query.
Rows write without an approval screenAutomatic processing bypasses manual staging. Disable automatic processing and require review when manual approval is intended.
Fields disappear or land in an unexpected columnInspect detected headers, remappings, destination columns and final fuzzy mappings. Check provider label collisions and raw-key formatter matching.
Incremental results omit expected changesConfirm source/type timestamp filtering and cursor settlement; reconcile actual row results. The cursor does not guarantee deletion synchronization or complete source change coverage.
A late page fetch fails after earlier pages arrivedPreserve the failure and inspect row/run outcomes before retrying. Earlier pages can already have been consumed; an empty result must not substitute for a fetch error.

See the importer guide for staging, approval, retry, cancellation and settlement behavior. Test a new adapter with synthetic multi-page and failure responses before live provider acceptance.

Key Files Reference​

Models​

FilePurpose
app/Models/Import.phpImport model with method/integration constants
app/Models/IntegrationToken.phpOAuth credential storage with encryption

Socialite Providers​

FilePurpose
app/Services/Socialite/CventProvider.phpCvent OAuth 2.0 provider
app/Services/Oath/Providers/SwoogoProvider.phpSwoogo OAuth provider
app/Services/Socialite/Concerns/IntegrationProvider.phpInterface for mapToIntegrationToken()

OAuth Integration Services​

FilePurpose
app/Services/Oath/CventOauthIntegrationService.phpCvent redirect/callback/refresh
app/Services/Oath/SwoogoOathIntegrationService.phpSwoogo client-credential token acquisition/storage
app/Services/Oath/GoogleDriveOauthIntegrationService.phpGoogle Drive OAuth (non-import)

API Service Classes​

FilePurpose
app/Services/CventService.phpCvent REST API client
app/Services/SwoogoService.phpSwoogo REST API client
app/Services/GoogleRsvp/GoogleRsvpClient.phpRSVP event/guest client using platform credentials
app/Services/GoogleRsvp/GoogleRsvpAccessTokenProvider.phpRSVP service-account impersonation and token cache
app/Services/LegacyEventfinityService.phpLegacy EF REST API client

Import Strategies​

FilePurpose
app/Services/Importer/ImportStrategies/ImportStrategyInterface.phpStrategy contract
app/Services/Importer/ImportStrategies/BaseImportStrategy.phpFuzzy mapping, formatting, sanitization
app/Services/Importer/ImportStrategies/ImportStrategyFactory.phpResolves import method to strategy class
app/Services/Importer/ImportStrategies/CventImportStrategy.phpCvent import with field/question flattening
app/Services/Importer/ImportStrategies/SwoogoImportStrategy.phpSwoogo import
app/Services/Importer/ImportStrategies/GoogleRsvpImportStrategy.phpRSVP attendee snapshot import
app/Services/Importer/ImportStrategies/LegacyEFImportStrategy.phpLegacy EventFinity import

DTOs​

FilePurpose
app/Services/Importer/DTOs/StrategyMetadataDTO.phpRow count + column headers + remapped columns
app/Services/Importer/DTOs/RowDTO.phpSingle row of import data with row number

Configuration​

FilePurpose
config/cvent.phpCvent API config, column mappings, import keys
config/swoogo.phpSwoogo API config, column mappings, import keys
config/google_rsvp.phpRSVP supported type, chunk size, field mappings and key
config/legacy_eventfinity.phpLegacy EF config, multi-environment base URLs, throttle settings

Controllers​

FilePurpose
app/Http/Controllers/Admin/IntegrationTokenController.phpCRUD for integration tokens
app/Http/Controllers/Admin/OathProviders/CventOauthController.phpCvent OAuth flow
app/Http/Controllers/Admin/OathProviders/GoogleDriveOauthController.phpGoogle Drive OAuth flow

Jobs​

FilePurpose
app/Jobs/ProcessAutomaticImportsJob.phpEmpty placeholder; automatic processing uses command/service scheduling