接続管理API

Version 26.1.9516


接続管理API


The Connection Management API supports the following actions:

The following sections describe each of these actions.

List All Connections in a Specified Workspace

The following command returns a list of all connections within a workspace in Sync:

GET http://<SyncHost>/api.rsc/v2/workspaces/{workspace-id}/connections

Path Parameter

Name Description
workspace_id (required) Identifies the specific workspace from which to retrieve the list of connections.

Example Request

curl "https://localhost:8181/api.rsc/v2/workspaces/default/connections

Retrieve a Specified Connection

The following command retrieves a specified connection:

GET http://<SyncHost>/api.rsc/v2/connections/{connection-id}

Path Parameter

Name Description
connection_id (required) Identifies the connection that you want to retrieve.

Request Example

curl "https://localhost:8181/api.rsc/v2/connections/550e8400-e29b-41d4-a716-446655440000"

Create a Connection in a Specified Workspace

The following command creates a new connection in a specified workspace:

POST http://<SyncHost>/api.rsc/v2/workspaces/{workspace_id}/connections

Path Parameter

Name Description
workspace_id (required) Identifies the specific workspace from which to retrieve the list of connections.

Body Parameters

Name Description
Name (required) Specifies the name of the connection.
Connector Specifies the type of connector that is used (for example, Salesforce).
Connector Version Specifies the version of the connect (for example, 25.0.9000).
Properties.* Specifies a list of connection properties.
Settings.Metadata_Refresh_Interval Specifies the metadata cache refresh interval. Valid intervals are Never, Hourly, Daily, and Start_of_Job.
Settings.Logfile_Verbosity Specifies the log verbosity level. Valid values are None, Error, Info, Transfer, and Verbose.
Settings.Use_CData_Callback_URL Specifies whether to use the CData callback URL for OAuth connections.
Labels Specifies a list of all labels for a connection.

Request Example

{
  "name": "MySourceConnection",
  "connector": "quickbooks",
  "settings": {
    "CompanyID": "12345",
    "User": "admin"
  }
}

Update a Connection

The following command updates an existing connection:

PUT http://<SyncHost>/api.rsc/v2/connections/{connection-id}

Note: You cannot update a connection that is in use in a running job.

Path Parameter

Name Description
connection_id (required) Identifies the connection that you want to update.

Body Parameters

Name Description
Name Specifies the name of the connection to update.
Properties.* Specifies a list of connection properties (merges with existing settings).
Settings.* Specifies a list of connection settings (merges with existing settings).
Connect_version Specifies the version for the connection.

Note: Connection properties and setting are merged, not replaced.

Example Request

{
  "name": "QuickBooks-Production-Updated",
  "settings": {
    "metadata_refresh_interval": "daily"
  }
}

Delete a Connection

The following command removes a connection:

DELETE http://<SyncHost>/api.rsc/v2/connections/{connection-id} 

Note: You cannot delete a connection that is in use in a running job.

Path Parameter

Name Description
connection_id (required) Identifies the connection that you want to delete.

Test a Connection

The following command tests a previously created connection:

POST http://<SyncHost>/api.rsc/v2/connections/{connection_id}/test

Note: The response is either a success message or an error message.

Path Parameter

Name Description
connection_id (required) Identifies the connection that you want to test.

List All Tables for a Connection

The following command retrieves a list of available tables for a connection:

POST  http://<SyncHost>/api.rsc/v2/connections/{connection_id}/tables

Path Parameter

Name Description
connection_id (required) Identifies the connection for which you want to retrieve tables.

Query Parameters

Name Description
Schema Filters tables by schema.
Include_Table_Types Specifies which table types to include. Values include TABLE, VIEW, and SYNONYM. This parameter can include multiple values (for example, include_table_types=TABLE,VIEW).
Reset_Metadata Specifies whether Sync should reset the metadata before retrieving tables.

List Table Columns for a Connection

The following command lists available columns for a table:

GET  http://<SyncHost>/api.rsc/v2/connections/{connection_id}/tables/{table_name}/columns

Path Parameters

Name Description
connection_id (required) Identifies the connection from which you want to retrieve table columns.
table_name (required) Specifies the name of the table. Include the schema, if necessary (for example, dbo.Customer).

Query Parameter

Name Description
Reset_Metadata Specifies whether Sync should reset the metadata before retrieving tables.

Reset the Metadata for a Connection

The following command resets the metadata for a connection:

POST  http://<SyncHost>/api.rsc/v2/connections/{connection_id}/reset-metadata

Path Parameter

Name Description
connection_id (required) Identifies the connection for which you want to reset metadata.

Reset Credentials for a Connection

The following command resets the credentials for an existing connection:

POST  http://<SyncHost>/api.rsc/v2/connections/{connection_id}/reset-credentials

Path Parameter

Name Description
connection_id (required) Identifies the connection for which you want to reset credentials.

List Log Files for a Connection

The following command downloads a log file for a connection:

GET  http://<SyncHost>/api.rsc/v2/connections/{connection_id}/logs

Path Parameters

Name Description
connection_id (required) Identifies the connection for which you want to list logs for.

Download a Log File for a Connection

The following command downloads a log file for a connection:

POST  http://<SyncHost>/api.rsc/v2/connections/{connection_id}/logs/{log_name}/download

Path Parameters

Name Description
connection_id (required) Identifies the connection for which you want to download a log file.
log_name (required) Specifies the log that you want to download.