Skip to content

DataConnectors

Overview

Data connector endpoints for various integrations

Available Operations

create_connect_session

Create a connection session for OAuth flow (Gmail, Google Sheets, Google Drive) or save connection with credentials (SQL, MongoDB).

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.create_connect_session()

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
integration Optional[str] :heavy_minus_sign: Integration type (e.g., 'google-mail', 'google-drive', 'google-drive-files')
provider_config_key Optional[str] :heavy_minus_sign: Provider config key (e.g., 'mysql', 'mongodb')
username Optional[str] :heavy_minus_sign: Database username (for SQL/MongoDB)
password Optional[str] :heavy_minus_sign: Database password (for SQL/MongoDB)
metadata Optional[models.ConnectSessionRequestMetadata] :heavy_minus_sign: Connection metadata
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.ConnectSessionResponse

Errors

Error Type Status Code Content Type
errors.Error 400 application/json
errors.Error 500 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

list_connections

List all connections for a specific provider type.

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.list_connections(provider_config_key="mongodb")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
provider_config_key models.ProviderConfigKey :heavy_check_mark: Provider config key
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.ConnectionList

Errors

Error Type Status Code Content Type
errors.Error 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

get_connection

Get detailed information about a specific connection.

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.get_connection(connection_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connection_id str :heavy_check_mark: Connection ID
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.Connection

Errors

Error Type Status Code Content Type
errors.Error 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

delete_connection

Remove a connection.

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.delete_connection(connection_id="<id>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connection_id str :heavy_check_mark: Connection ID
integration Optional[str] :heavy_minus_sign: Integration type (for OAuth connectors)
provider_config_key Optional[str] :heavy_minus_sign: Provider config key (for SQL/MongoDB)
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.DeleteConnectionResponse

Errors

Error Type Status Code Content Type
errors.Error 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

get_connection_metadata

Get connection metadata (files, sheets, etc.).

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.get_connection_metadata(connection_id="<id>", provider_config_key="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connection_id str :heavy_check_mark: Connection ID
provider_config_key str :heavy_check_mark: Provider config key
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.ConnectionMetadataResponse

Errors

Error Type Status Code Content Type
errors.Error 404 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

update_connection_metadata

Update connection metadata (files, sheets, connection details, etc.).

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.update_connection_metadata(connection_id="<id>", provider_config_key="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connection_id str :heavy_check_mark: N/A
provider_config_key str :heavy_check_mark: N/A
metadata Optional[models.ConnectionMetadataRequestMetadata] :heavy_minus_sign: N/A
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.ConnectionMetadataResponse

Errors

Error Type Status Code Content Type
errors.Error 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

upload_documents

Upload one or more document files.

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.upload_documents(files=[])

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
files List[models.File] :heavy_check_mark: Multiple files allowed
description Optional[str] :heavy_minus_sign: Description for upload job
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.DocumentUploadResponse

Errors

Error Type Status Code Content Type
errors.Error 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

test_database_connection

Test a database connection before saving.

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.test_database_connection(database_type="mysql", connection={
        "host": "distant-event.com",
        "port": 872827,
        "database": "<value>",
        "username": "Sandrine.Cassin",
        "password": "a77KLKcXHvHrTua",
    })

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
database_type models.TestConnectionRequestDatabaseType :heavy_check_mark: N/A
connection models.TestConnectionRequestConnection :heavy_check_mark: N/A
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.TestConnectionResponse

Errors

Error Type Status Code Content Type
errors.Error 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

get_database_metadata

Test MongoDB connection and fetch available databases.

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.get_database_metadata(connection_string="<value>", database_type="mongodb")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connection_string str :heavy_check_mark: MongoDB connection string
database_type models.DatabaseMetadataRequestDatabaseType :heavy_check_mark: N/A
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.DatabaseMetadataResponse

Errors

Error Type Status Code Content Type
errors.Error 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*

enqueue_sync

Start data synchronization for a connection.

Example Usage

from fermisdk import Fermisdk
import os


with Fermisdk(
    bearer_auth=os.getenv("FERMISDK_BEARER_AUTH", ""),
) as f_client:

    res = f_client.data_connectors.enqueue_sync(connection_id="<id>", provider_key="<value>")

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
connection_id str :heavy_check_mark: N/A
provider_key str :heavy_check_mark: N/A
retries Optional[utils.RetryConfig] :heavy_minus_sign: Configuration to override the default retry behavior of the client.

Response

models.SyncEnqueueResponse

Errors

Error Type Status Code Content Type
errors.Error 400 application/json
errors.FermisdkDefaultError 4XX, 5XX */*