Connection Management API
Version 26.1.9516
Version 26.1.9516
Connection Management API
The Connection Management API supports the following actions:
- List all Connections
- Create a Connection
- Modify a Connection
- Delete a Connection
- Test a Connection
- List Tables for a Connection
- List Table Columns for a Connection
- Reset OAuth Credentials
The following sections describe each of these actions.
List All Connections
The following command returns a list of all connections within the CData Sync application:
GET http://MyDomain.com:8019/api.rsc/connections(Name)
Query Parameter
| Name | Description |
|---|---|
| Name | Specifies the name of the connection to retrieve. |
Create a Connection
The following command creates a new connection in the Sync application:
POST http://MyDomain.com:8019/api.rsc/connections
Body Parameters
| Name | Description |
|---|---|
| Name (required) | Specifies the name of the connection to create. |
| ProviderName | Specifies the name of the connector to which to connect (for example, the CData Salesforce connector). |
| ConnectionString | Specifies the connection string for the data connection. |
Example Request
{
"Name": "MyNewConnection",
"ProviderName": "CData Salesforce",
"ConnectionString": "user=MyUser;Password=MyPassword;SecurityToken=MyToken"
}
Modify a Connection
The following command modifies an existing connection:
PUT http://MyDomain.com:8019/api.rsc/connections(Name)
Note: You cannot modify a connection that is in use in a running job.
Query Parameter
| Name | Description |
|---|---|
| Name (required) | Specifies the name of the connection to modify. |
Body Parameters
| Name | Description |
|---|---|
| ConnectionString | Specifies the connection string for the data connection. |
Example Request
{
"ConnectionString": "user=MyUser;Password=MyPassword;SecurityToken=MyNewToken"
}
Delete a Connection
The following command removes a connection from the Sync application:
DELETE http://MyDomain.com:8019/api.rsc/connections(Name)
Note: You cannot delete a connection that is in use in a running job.
Query Parameter
| Name | Description |
|---|---|
| Name | Specifies the name of the connection to delete. |
Test a Connection
The following command tests a previously created connection.
POST http://MyDomain.com:8019/api.rsc/testConnection
Note: The response is either a success message or an error message.
Body Parameters
| Name | Description |
|---|---|
| ConnectionName | Specifies the name of the connection to test. |
Example Request
{
"ConnectionName": "MyConnection"
}
List Tables
The following command retrieves a list of available tables for a connection:
POST http://MyDomain.com:8019/api.rsc/getConnectionTables
Body Parameters
| Name | Description |
|---|---|
| ConnectionName | Specifies the name of the connection from which to retrieve tables. |
| TableOrView | Specifies the types (tables or views) that should be listed. Values for this parameter are TABLES, VIEWS, or ALL. |
| Schema | Restricts tables to a specific schema. |
| IncludeSchema | Specifies whether to include the schema with the table name (in the form [Schema].[Table]) |
| IncludeCatalog | Specifies whether to include a catalog with the table name (in the form [Catalog].[Schema].[Table]) |
Example Request
{
"ConnectionName": "MyConnection",
"TableOrView": "ALL",
"IncludeSchema": "True"
}
List Columns
The following command retrieves a list of available columns for a table:
POST http://MyDomain.com:8019/api.rsc/getConnectionTableColumns
Body Parameters
| Name | Description |
|---|---|
| ConnectionName | Specifies the name of the connection from which to retrieve tables. |
| Table | Specifies the name of the table from which to retrieve columns. |
Example Request
{
"ConnectionName": "MyConnection",
"Table": "Accounts"
}
Reset OAuth Credentials
The following command resets the stored OAuth credentials for an existing connection.
POST http://MyDomain.com:8019/api.rsc/resetOAuthCredentials
This command clears the stored OAuth tokens for the specified connection. The connection is disconnected after the reset, and any operations that require authentication (for example, testing or running jobs) fail until you re-authenticate.
You must have Update Connection permission to perform this action. Users without this permission receive an error message indicating that they do not have sufficient privileges.
Body Parameter
| Name | Description |
|---|---|
| ConnectionName (required) | Specifies the name of the connection for which the stored OAuth credentials are to be reset. |
Example Request
{
"ConnectionName": "MyConnection"
}