Data connections
Data connections let Qlik Cloud Analytics apps and Data Integration projects connect to external data sources. The data-credentials API manages credentials for connections.
For a guided introduction, see Data connections.
Connection update restrictions
The PATCH /api/v1/data-connections/{qID} endpoint enforces the following validation rules.
Requests that violate any rule return HTTP 400.
| Rule | Details |
|---|---|
| Field exclusivity | A request body cannot include both qConnectStatement and connectionProperties fields. |
| Credentials required on connection-string change | A request that patches qConnectStatement must include credentials (/qPassword or the datasource password property in connectionProperties). |
| Credentials required on host change | A request that patches connectionProperties/host, connectionProperties/server, or connectionProperties/url to a new value must include credentials. |
| Single credential form | A request cannot supply credentials in both /qPassword and connectionProperties/{password-field} simultaneously. |
Also, when a successful PATCH changes the host of a connection that uses separate credentials, the API automatically deassociates any previously associated credentials.
For request examples and further guidance, see Update data connections.
Endpoints
Facts
| Rate limit | Tier 1 (1000 requests per minute) |
Query Parameters
- dataName string
Provides an alternate name to be used for data[] element in GET response.
- extended boolean
Returns extended list of properties (e.g. encrypted credential string) when set to true.
- spaceId string
Filtering on connections by space ID
- personal boolean
Filtering on personal connections, ignored if spaceId is defined in same request
- owner string
Filtering on datafile connections by owner (i.e. app) ID.
- ownedByMe boolean
Filtering on connections, return connections owned by the caller if set to true (doesn't apply to datafiles connections)
- limit integer
Number of resources to be returned (between 1 and 100)
- sort string
Name of field sort on for pagination, with prefix with + or - indicating ascending or descending order. When used for data-connections, sort field only applies to non-datafiles connections. Whatever sorting order is, datafiles connections will be returned after all regular connections being returned.
- page string
Pagination cursor string, which is generated automatically in previous pagination query.
- noDatafiles boolean
Datafiles connections will not be returned if set to true
- userId string
Filtering on userId. Requires admin role if specified userId doesn't match that is defined in JWT.
- caseinsensitive boolean
Sort results will be returned in case insensitive order if set to true (Only used along with sort query)
- locale string
ICU locale ID, used only when caseinsensitive is set to true, default to 'en' if undefined
- includeQris boolean
Base Qri (encrypted) will be returned when the query is set to true, default is false
- filter string
Filtering resources by properties (filterable properties only) using SCIM filter string. Note the filter string only applies to connections managed by data-connections service, i.e. filtering doesn't apply to DataFile connections. When filtering on datetime property (e.g. created, updated), datetime should be in RFC3339 format.
- includeDisabled boolean
Includes connections that uses disabled datasources
Responses
200
List connections with optional filter queries. Connections will be filtered internally based on the space access rules applicable to the caller. When some of connections are not returned due to errors, errors array in the response will be set.
- application/json object
application/json properties
- data array of objects
Essential fields of a connection
data properties
- qID stringRequired
Unique identifier (UUID) for the data connection, must be same as qEngineObjectID
- qri string
Encrypted base Qri string (filterable using SCIM filter, e.g. filter='qri co "snowflake"')
- tags array of strings
List of tags attached to the connection
- user string
User ID of the connection's creator
- links objectRequired
links properties
- self objectRequired
Link to current query
self properties
- href stringRequired
URL pointing to the resource
-
-
- qName stringRequired Filterable
Descriptive name of the data connection
- qType stringRequired Filterable
Type of connection, i.e. provider type of underlying connector
- space string
ID of the space to which the connection belongs
- qLogOn integerRequired
Indicates the type of user associated with the data connection
Can be one of: 01
- tenant stringRequired
Tenant ID of the connection's creator
- created string
Datetime when the connection was created
- updated string
Datetime when the connection was last updated
- privileges array of stringsRequired
Array of string (i.e. update, delete, read) indicating the user's privileges on the associated connection
Values may be any of: "list""update""delete""read""change_owner""change_space"
- datasourceID string
Data source ID
- qArchitecture integerRequired
- or 1 value indicating whether the data connector is 64-bit (0) or 32-bit (1). Defaults to 0 if not specified.
Can be one of: 01
- qCredentialsID string
ID of the credential associated with the connection
- qEngineObjectID stringRequired
Unique identifier (UUID) for the data connection, must be same as qID
- qConnectStatement stringRequired
Connection string for the data connection
- qConnectionSecret string
String that contains connection specific secret (or password). This field will not be included in response of GET /data-connections, will only be included in the response of GET /data-connections/{qID}
- connectionProperties object
List of connection parsed from connection string (only available when query parseConnection=true is set)
- qSeparateCredentials boolean
Indicates whether or not this is a credential-less connection
-
- meta object
meta properties
- count integer
Total count of resources being requested.
-
- links object
links properties
- next object
URL link to next page of requested resources (available to paged request only)
next properties
- href stringRequired
URL pointing to the next page of resources
-
- prev object
URL link to previous page of requested resources (available to paged request only)
prev properties
- href stringRequired
URL pointing to the previous page of resources
-
- self objectRequired
Link to current query
self properties
- href stringRequired
URL pointing to the resource
-
-
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
400
Bad request, typically when dataName is empty
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
500
Internal error, this happens when the service fails to make requests to dependency services
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
502
Bad gateway, this happens when requests to required (dependent) services time out
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.getDataConnections({})qlik data-connection lscurl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections" \-H "Authorization: Bearer <access_token>"Example Response
{ "data": [ { "qID": "a7eb530e-475a-4864-bc12-dacf4b081e72", "qri": "qri:db:snowflake://BQ1-3F_BvWfxxCDDiz9vQepqHLAcHWqacoqwLq4wxWM", "tags": "[\"tag1, \"tag2\"]", "user": "rFdHeUOiVYgPX5iTbvL0x0Cs6F62QI", "links": { "self": { "href": "https://mytenant.us.qlikcloud.com/..." } }, "qName": "MyConnection", "qType": "QvOdbcConnectorPackage.exe", "space": "6226583d53a69876774d4f96", "qLogOn": 1, "tenant": "xqFQ0k34vSR0d9G7J-vZtHZQkiYrCqc8", "created": "2022-04-08T10:00:28.287Z", "updated": "2022-04-09T10:00:28.287Z", "privileges": "[update, delete, read]", "datasourceID": "sfdc", "qArchitecture": 0, "qCredentialsID": "a4e00184-8743-4a44-a1a8-07bba573afea", "qEngineObjectID": "a7eb530e-475a-4864-bc12-dacf4b081e72", "qConnectStatement": "CUSTOM CONNECT TO \\\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\\"", "qConnectionSecret": "Connection_Specific_Secret", "connectionProperties": "{\"property1\": \"value\", \"property2\": \"value\"}", "qSeparateCredentials": true } ], "meta": { "count": 12 }, "links": { "next": { "href": "https://mytenant.us.qlikcloud.com/..." }, "prev": { "href": "https://mytenant.us.qlikcloud.com/..." }, "self": { "href": "https://mytenant.us.qlikcloud.com/.../0e445014-a564-496a-9a8d-28baadcc3ef9" } }, "errors": [ { "code": "DCERROR-0010", "title": "Bad or invalid request", "detail": "Field xxx is missing in the request", "status": 400 } ]}Creates a new connection. Depending on the fields defined in the request body, credentials embedded (or associated) in the connection can be updated or created.
Facts
| Rate limit | Tier 2 (100 requests per minute) |
Request Body
Required- application/json objectOne of:
- ConnectionCreate object
Schema used to create a connection with given connection string (i.e. qConnectStatement) along with other metadata
ConnectionCreate properties
- qID string
Unique identifier (UUID) for the data connection. A UUID will be generated automatically if qID is not specified or empty
- tags array of strings
List of tags attached to the connection (allow max 32 tags)
- owner string
App ID
- qName stringRequired
Descriptive name of the data connection
- qType stringRequired
Type of connection - indicates connection provider type
- space string
ID of the space to which the connection belongs
- qLogOn string
Indicates the type of user associated with the data connection.
Can be one of: "0""1""LOG_ON_SERVICE_USER""LOG_ON_CURRENT_USER"
- qPassword string
Any logon password associated with the data connection (connector encoded)
- qUsername string
Any logon username associated with the data connection
- datasourceID stringRequired
ID of the datasource associated with this connection
- qriInRequest string
QRI string of the connection. The string will be persisted to mongo when the request is originated from trusted client (i.e. dcaas) to avoid invalid QRi string.
- qArchitecture integer
- or 1 value indicating whether the data connector is 64-bit (0) or 32-bit (1). Defaults to 0 if not specified.
Can be one of: 01
- qCredentialsID string
ID of the credential associated with the connection
- qEngineObjectID string
Unique identifier (UUID) for the data connection as specified by the Sense engine. A UUID will be generated automatically if this field is not specified or empty
- qCredentialsName string
Name of the credential associated with the connection
- qConnectStatement stringRequired
Connection string for the data connection
- qConnectionSecret string
String that contains connection specific secret (or password) that requires encryption before persist to database. This field is connection level secret
- qSeparateCredentials boolean
Indicates whether or not to create a credential-less connection
-
- DcaasConnectionCreate object
Schema used to create a connection using a list of connection properties for given datasource
DcaasConnectionCreate properties
- tags array of strings
List of tags attached to the connection (allow max 31 tags)
- qName stringRequired
Descriptive name of the data connection
- space string
ID of the space in which the connection shall be created. Connection will be created in user's personal space if undefined
- authUrlOnly boolean
When set to true, only authentication URL will be returned (i.e. no connection will be created) if datasource supports OAuth, and other properties set in the request will ignored. This property will be ignored if the request is not OAuth or datasource doesn't support OAuth
- datasourceID stringRequired
ID of the datasource of the connection
- connectionProperties objectRequired
Connection properties required to create dataconnection for the given datasource, which is defined by the response of 'GET /v1/data-sources/:{datasourceId}/api-specs'
-
-
Responses
201
Data connection created
- application/json objectOne of:
- ConnectionCreateResponse object
Essential fields of a connection
ConnectionCreateResponse properties
- qID stringRequired
Unique identifier (UUID) for the data connection, must be same as qEngineObjectID
- user string
User ID of the connection's creator
- links object
links properties
- self objectRequired
Link to current query
self properties
- href stringRequired
URL pointing to the resource
-
-
- qName stringRequired
Descriptive name of the data connection
- qType stringRequired
Type of connection - indicates connection provider type
- space string
ID of the space to which the connection belongs
- qLogOn stringRequired
Indicates the type of user associated with the data connection.
Can be one of: "0""1""LOG_ON_SERVICE_USER""LOG_ON_CURRENT_USER"
- created string
Datetime when the connection was created
- updated string
Datetime when the connection was last updated
- privileges array of stringsRequired
Array of string (i.e. update, delete, read) indicating the user's privileges on the associated connection
Values may be any of: "list""update""delete""read""change_owner""change_space"
- qArchitecture integerRequired
- or 1 value indicating whether the data connector is 64-bit (0) or 32-bit (1). Defaults to 0 if not specified.
Can be one of: 01
- qReferenceKey string
Reference key of credential in redis
- qCredentialsID string
ID of the credential associated with the connection
- qEngineObjectID stringRequired
Unique identifier (UUID) for the data connection, must be same as qID
- qCredentialsName string
Name of the credential associated with the connection
- qConnectStatement stringRequired
Connection string for the data connection
- qSeparateCredentials booleanRequired
Indicates whether or not this is a credential-less connection
-
- DcaasConnectionCreateAuthResponse object
Authentication URL response for OAuth datasources (when authUrlOnly is set to true in request)
DcaasConnectionCreateAuthResponse properties
- authUrl stringRequired
Authentication URL used to generate authentication code for datasources supporting OAuth
-
-
400
Invalid data connection specified
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
403
User has no access to the connection or space
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
404
Credentials referenced by qCredentialsID in the request body could not be found
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
409
Data connection already exists
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.createDataConnection({ qID: 'b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28', tags: '["tag1, "tag2"]', owner: '928e2a66-01ba-4678-aa32-e74c213896fa', qName: 'MyConnection', qType: 'QvOdbcConnectorPackage.exe', space: '611bcebaeec1203d88211ac4', qLogOn: '1', qPassword: 'Connector encoded password', qUsername: 'MyUsername', datasourceID: 'snowflake', qriInRequest: 'qri:db:snowflake://BQ1-3F_BvWfxxCDDiz9vQepqHLAcHWqacoqwLq4wxWM', qArchitecture: 0, qCredentialsID: '935ec250-65bc-47c0-965b-53554f3f87d8', qEngineObjectID: 'b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28', qCredentialsName: 'MyCredential', qConnectStatement: 'CUSTOM CONNECT TO \\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\"', qConnectionSecret: 'Any connection specific secret string', qSeparateCredentials: false,})qlik data-connection create \ --qConnectStatement 'CUSTOM CONNECT TO \"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\"' \ --qType 'QvOdbcConnectorPackage.exe' \ --connectionPropertiescurl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections" \-X POST \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"qID":"b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28","tags":"[\"tag1, \"tag2\"]","owner":"928e2a66-01ba-4678-aa32-e74c213896fa","qName":"MyConnection","qType":"QvOdbcConnectorPackage.exe","space":"611bcebaeec1203d88211ac4","qLogOn":"1","qPassword":"Connector encoded password","qUsername":"MyUsername","datasourceID":"snowflake","qriInRequest":"qri:db:snowflake://BQ1-3F_BvWfxxCDDiz9vQepqHLAcHWqacoqwLq4wxWM","qArchitecture":0,"qCredentialsID":"935ec250-65bc-47c0-965b-53554f3f87d8","qEngineObjectID":"b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28","qCredentialsName":"MyCredential","qConnectStatement":"CUSTOM CONNECT TO \\\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\\"","qConnectionSecret":"Any connection specific secret string","qSeparateCredentials":false}'Example Response
{ "qID": "b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28", "user": "rFdHeUOiVYgPX5iTbvL0x0Cs6F62QI", "links": { "self": { "href": "https://mytenant.us.qlikcloud.com/..." } }, "qName": "MyConnection", "qType": "QvOdbcConnectorPackage.exe", "space": "611bcebaeec1203d88211ac4", "qLogOn": "1", "created": "2022-04-09T10:00:28.287Z", "updated": "2022-04-09T10:00:28.287Z", "privileges": "[update, delete, read]", "qArchitecture": 0, "qReferenceKey": "credential:key", "qCredentialsID": "7b475581-2f68-4c81-ac52-25705b8229fb", "qEngineObjectID": "b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28", "qCredentialsName": "MyCredential", "qConnectStatement": "CUSTOM CONNECT TO \\\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\\"", "qSeparateCredentials": true}Retrieves a connection by connection ID, or by name when the query parameter "type" is set to "connectionname."
Facts
| Rate limit | Tier 1 (1000 requests per minute) |
Query Parameters
- extended boolean
Returns extended list of properties (e.g. encrypted credential string) when set to true.
- type string
The connection ID in the path becomes a connection name when this query parameter is set.
Can be one of: "connectionname"
- credentialId string
Credential ID
- byCredentialName boolean
If set to true, credentialId in the query will be interpreted as credential's name
- spaceId string
Filtering on connections by space ID
- noCache boolean
datafiles connections will be returned from cache by default (if data-connections is configured to use cache), this query parameter is used disable this default behavior, e.g. return an update-to-date datafiles connection if the query is set to true
- parseConnection boolean
List of connection properties shall be returned when the query is set to true, default is false
Path Parameters
- qID stringRequired
Connection ID
Responses
200
Data connection retrieved
- application/json object
Essential fields of a connection
application/json properties
- qID stringRequired
Unique identifier (UUID) for the data connection, must be same as qEngineObjectID
- qri string
Encrypted base Qri string (filterable using SCIM filter, e.g. filter='qri co "snowflake"')
- tags array of strings
List of tags attached to the connection
- user string
User ID of the connection's creator
- links objectRequired
links properties
- self objectRequired
Link to current query
self properties
- href stringRequired
URL pointing to the resource
-
-
- qName stringRequired Filterable
Descriptive name of the data connection
- qType stringRequired Filterable
Type of connection, i.e. provider type of underlying connector
- space string
ID of the space to which the connection belongs
- qLogOn integerRequired
Indicates the type of user associated with the data connection
Can be one of: 01
- tenant stringRequired
Tenant ID of the connection's creator
- created string
Datetime when the connection was created
- updated string
Datetime when the connection was last updated
- privileges array of stringsRequired
Array of string (i.e. update, delete, read) indicating the user's privileges on the associated connection
Values may be any of: "list""update""delete""read""change_owner""change_space"
- datasourceID string
Data source ID
- qArchitecture integerRequired
- or 1 value indicating whether the data connector is 64-bit (0) or 32-bit (1). Defaults to 0 if not specified.
Can be one of: 01
- qCredentialsID string
ID of the credential associated with the connection
- qEngineObjectID stringRequired
Unique identifier (UUID) for the data connection, must be same as qID
- qConnectStatement stringRequired
Connection string for the data connection
- qConnectionSecret string
String that contains connection specific secret (or password). This field will not be included in response of GET /data-connections, will only be included in the response of GET /data-connections/{qID}
- connectionProperties object
List of connection parsed from connection string (only available when query parseConnection=true is set)
- qSeparateCredentials boolean
Indicates whether or not this is a credential-less connection
-
400
The qID is not a valid UUID
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
403
User has no access to the connection or space
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
404
Data connection not found
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
500
Credential decryption failed, likely due to invalid credentials
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.getDataConnection( '82ee7b44-0c4d-491b-bd38-82640c0430a5', {},)qlik data-connection get '82ee7b44-0c4d-491b-bd38-82640c0430a5'curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections/{qID}" \-H "Authorization: Bearer <access_token>"Example Response
{ "qID": "a7eb530e-475a-4864-bc12-dacf4b081e72", "qri": "qri:db:snowflake://BQ1-3F_BvWfxxCDDiz9vQepqHLAcHWqacoqwLq4wxWM", "tags": "[\"tag1, \"tag2\"]", "user": "rFdHeUOiVYgPX5iTbvL0x0Cs6F62QI", "links": { "self": { "href": "https://mytenant.us.qlikcloud.com/..." } }, "qName": "MyConnection", "qType": "QvOdbcConnectorPackage.exe", "space": "6226583d53a69876774d4f96", "qLogOn": 1, "tenant": "xqFQ0k34vSR0d9G7J-vZtHZQkiYrCqc8", "created": "2022-04-08T10:00:28.287Z", "updated": "2022-04-09T10:00:28.287Z", "privileges": "[update, delete, read]", "datasourceID": "sfdc", "qArchitecture": 0, "qCredentialsID": "a4e00184-8743-4a44-a1a8-07bba573afea", "qEngineObjectID": "a7eb530e-475a-4864-bc12-dacf4b081e72", "qConnectStatement": "CUSTOM CONNECT TO \\\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\\"", "qConnectionSecret": "Connection_Specific_Secret", "connectionProperties": "{\"property1\": \"value\", \"property2\": \"value\"}", "qSeparateCredentials": true}Patches a connection specified by connection ID (or by name when type=connectionname is set in query).
Facts
| Rate limit | Tier 2 (100 requests per minute) |
Header Parameters
- qlik-auth-code string
OAuth authentication code. This header is required by certain datasources when patching a data connection.
Query Parameters
- type string
The connection ID in the path becomes a connection name when this query parameter is set.
Can be one of: "connectionname"
Path Parameters
- qID stringRequired
Connection ID
Request Body
Required- application/json array of objects
application/json properties
- op stringRequired
Operation type
Can be one of: "add""replace""remove"
- path stringRequired
Path to the target field to be patched
- value string|boolean|integer|array
Value used for the patch. Required only for
addorreplaceoperations. The value type should match the type of the target field.One of:- string
- boolean
- integer
- array
-
-
Responses
204
Data connection updated successfully
400
Bad request due to invalid data in body
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
403
User has no access to the connection or space
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
404
Data connection not found
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
409
Data connection already exists (when updated name conflicts with existing record)
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.patchDataConnection( '82ee7b44-0c4d-491b-bd38-82640c0430a5', {}, [ { op: 'add', path: '/qName', value: 'New value', }, ],)qlik data-connection patch '82ee7b44-0c4d-491b-bd38-82640c0430a5' \ --op 'add' \ --path '/qName'curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections/{qID}" \-X PATCH \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '[{"op":"add","path":"/qName","value":"New value"}]'Updates a connection specified by connection ID (or by name when type=connectionname is set in query). Depends on the fields defined in the request body, credentials embedded (or associated) in the connection can be updated or created.
Facts
| Rate limit | Tier 2 (100 requests per minute) |
Query Parameters
- type string
The connection ID in the path becomes a connection name when this query parameter is set.
Can be one of: "connectionname"
- spaceId string
Filtering on connections by space ID
Path Parameters
- qID stringRequired
Connection ID
Request Body
Required- application/json object
application/json properties
- qID stringRequired
Unique identifier for the data connection
- qName stringRequired
Descriptive name of the data connection
- qType stringRequired
Type of connection - indicates connection provider type
- space string
ID of the space to which the connection belongs
- qLogOn string
Indicates the type of user associated with the data connection.
Can be one of: "0""1""LOG_ON_SERVICE_USER""LOG_ON_CURRENT_USER"
- qPassword string
Any logon password associated with the data connection
- qUsername string
Any logon username associated with the data connection
- datasourceID string
ID of the datasource associated with this connection
- qArchitecture integer
- or 1 value indicating whether the data connector is 64-bit (0) or 32-bit (1). Defaults to 0 if not specified.
Can be one of: 01
- qCredentialsID string
ID of the credential associated with the connection
- qEngineObjectID stringRequired
Unique identifier for the data connection as specified by the Sense engine
- qCredentialsName string
Name of the credential associated with the connection
- qConnectStatement stringRequired
Connection string for the data connection
- qConnectionSecret string
String that contains connection level secret (or password). If this field presents in request, then existing connection secret will be updated to its value. If is an empty string, then existing connection secret will be cleared. If this field is missing, existing secret will not be updated.
- qSeparateCredentials boolean
Indicates whether or not this is a credential-less connection
-
Responses
204
Data connection updated successfully
400
Bad request due to invalid data in body
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
403
User has no access to the connection or space
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
404
Data connection not found
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
409
Data connection already exists (when updated name conflicts with existing record)
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
// qlik-api has not implemented support for `PUT /api/v1/data-connections/{qID}` yet.// In the meantime, you can use fetch like this:
const response = await fetch( '/api/v1/data-connections/{qID}', { method: 'PUT', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ qID: '55e13286-fbd8-4a59-a10d-807937a97443', qName: 'MyConnection', qType: 'snowflake', space: '611bcebaeec1203d88211ac4', qLogOn: '1', qPassword: 'password', qUsername: 'MyUsername', datasourceID: 'snowflake', qArchitecture: 1, qCredentialsID: 'cea94172-fa83-47c8-8171-b6f151918ad0', qEngineObjectID: '55e13286-fbd8-4a59-a10d-807937a97443', qCredentialsName: 'CredentialName', qConnectStatement: 'CUSTOM CONNECT TO \\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\"', qConnectionSecret: 'connection specific secret string', qSeparateCredentials: true, }), },)# qlik-cli has not implemented support for PUT /api/v1/data-connections/{qID} yet.curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections/{qID}" \-X PUT \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"qID":"55e13286-fbd8-4a59-a10d-807937a97443","qName":"MyConnection","qType":"snowflake","space":"611bcebaeec1203d88211ac4","qLogOn":"1","qPassword":"password","qUsername":"MyUsername","datasourceID":"snowflake","qArchitecture":1,"qCredentialsID":"cea94172-fa83-47c8-8171-b6f151918ad0","qEngineObjectID":"55e13286-fbd8-4a59-a10d-807937a97443","qCredentialsName":"CredentialName","qConnectStatement":"CUSTOM CONNECT TO \\\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\\"","qConnectionSecret":"connection specific secret string","qSeparateCredentials":true}'Facts
| Rate limit | Tier 2 (100 requests per minute) |
Query Parameters
- type string
The connection ID in the path becomes a connection name when this query parameter is set.
Can be one of: "connectionname"
- spaceId string
Filtering on connections by space ID
Path Parameters
- qID stringRequired
Connection ID
Responses
204
Data connection deleted successfully
403
User has no access to the connection or space
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
404
Data connection not found
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.deleteDataConnection( '82ee7b44-0c4d-491b-bd38-82640c0430a5', {},)qlik data-connection rm '82ee7b44-0c4d-491b-bd38-82640c0430a5'curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections/{qID}" \-X DELETE \-H "Authorization: Bearer <access_token>"Facts
| Rate limit | Tier 2 (100 requests per minute) |
Request Body
Required- application/json object
application/json properties
- connections array of objectsRequired
connections properties
- id stringRequired
ID of connection
- name string
Connection name
-
-
Responses
207
Bulk delete completed
- application/json object
application/json properties
- data array of objects
data properties
- id stringRequired
ID of the resource
- error object
error properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
- status integerRequired
Status code of operation on resource identified by ID
-
-
400
Bad request (Missing required field in request body)
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
403
User has no access to the endpoint. The endpoint requires Admin role
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.deleteDataConnections({ connections: [ { id: 'b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd', name: 'MyConnection', }, ],})qlik data-connection delete \ --connections-id '' \ --connections-name ''curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections/actions/delete" \-X POST \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"connections":[{"id":"b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd","name":"MyConnection"}]}'Example Response
{ "data": [ { "id": "b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd", "error": { "code": "DCERROR-0010", "title": "Bad or invalid request", "detail": "Field xxx is missing in the request", "status": 400 }, "status": 204 } ]}Facts
| Rate limit | Tier 2 (100 requests per minute) |
Request Body
Required- application/json object
application/json properties
- id stringRequired
ID of the source connection being duplicated
- name string
Optional name for the duplicated connection, must be unique in the target scope. If not specified, a name will be automatically generated
- spaceId string
Optional target space ID for the duplicated connection. If not specified, the duplicated connection will be in the same space as the source connection
- qPassword string
Optional credential password, specify to override credential embedded (or associated) with the source connection
- qUsername string
Optional credential username, specify to override credential embedded (or associated) with the source connection
-
Responses
201
Duplicate completed
- application/json object
Essential fields of a connection
application/json properties
- qID stringRequired
Unique identifier (UUID) for the data connection, must be same as qEngineObjectID
- user string
User ID of the connection's creator
- links object
links properties
- self objectRequired
Link to current query
self properties
- href stringRequired
URL pointing to the resource
-
-
- qName stringRequired
Descriptive name of the data connection
- qType stringRequired
Type of connection - indicates connection provider type
- space string
ID of the space to which the connection belongs
- qLogOn stringRequired
Indicates the type of user associated with the data connection.
Can be one of: "0""1""LOG_ON_SERVICE_USER""LOG_ON_CURRENT_USER"
- created string
Datetime when the connection was created
- updated string
Datetime when the connection was last updated
- privileges array of stringsRequired
Array of string (i.e. update, delete, read) indicating the user's privileges on the associated connection
Values may be any of: "list""update""delete""read""change_owner""change_space"
- qArchitecture integerRequired
- or 1 value indicating whether the data connector is 64-bit (0) or 32-bit (1). Defaults to 0 if not specified.
Can be one of: 01
- qReferenceKey string
Reference key of credential in redis
- qCredentialsID string
ID of the credential associated with the connection
- qEngineObjectID stringRequired
Unique identifier (UUID) for the data connection, must be same as qID
- qCredentialsName string
Name of the credential associated with the connection
- qConnectStatement stringRequired
Connection string for the data connection
- qSeparateCredentials booleanRequired
Indicates whether or not this is a credential-less connection
-
400
Bad request (Missing required field in request body, or duplicate from / to a reserved connection)
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
403
User has no access to the source connection or no access to target space
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
404
Connection defined by id not found
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
409
Duplicated connection would result in a name conflict with the connections in the scope
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.duplicateDataAConnection( { id: 'b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd', name: 'ResourceName', qPassword: 'Password', qUsername: 'UserName', spaceId: '611bcebaeec1203d88211ac4', },)qlik data-connection duplicate \ --id 'b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd'curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections/actions/duplicate" \-X POST \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"id":"b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd","name":"ResourceName","spaceId":"611bcebaeec1203d88211ac4","qPassword":"Password","qUsername":"UserName"}'Example Response
{ "qID": "b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28", "user": "rFdHeUOiVYgPX5iTbvL0x0Cs6F62QI", "links": { "self": { "href": "https://mytenant.us.qlikcloud.com/..." } }, "qName": "MyConnection", "qType": "QvOdbcConnectorPackage.exe", "space": "611bcebaeec1203d88211ac4", "qLogOn": "1", "created": "2022-04-09T10:00:28.287Z", "updated": "2022-04-09T10:00:28.287Z", "privileges": "[update, delete, read]", "qArchitecture": 0, "qReferenceKey": "credential:key", "qCredentialsID": "7b475581-2f68-4c81-ac52-25705b8229fb", "qEngineObjectID": "b4a949cb-3aaf-4cd5-a140-dd3ea34f0d28", "qCredentialsName": "MyCredential", "qConnectStatement": "CUSTOM CONNECT TO \\\"provider=QvOdbcConnectorPackage.exe;driver=snowflake;server=...\\\"", "qSeparateCredentials": true}Update multiple connections, only available to Admin. When update is to change ownership of a connection, the credentials associated with the connection will NOT be transferred to the new owner, and new owner is expected to provide their own credentials for the connection.
Facts
| Rate limit | Tier 2 (100 requests per minute) |
Request Body
Required- application/json object
application/json properties
- connections array of objectsRequired
connections properties
- id stringRequired
Connection ID
- name string
Connection name
- ownerId string
User ID to which the connection will be updated. If not present, the connection's owner wont be changed
- spaceId string
Space ID to which the connection will be updated. If not present, the connection's space wont be changed. If it is empty string, then the connection will be moved to the personal space of the user identified by ownerId (If ownerId is undefined, then the connection will be in oroginal owner's personal space)
- spaceType string
Space type. Required when spaceId is specified
Can be one of: "personal""shared""managed""data"
-
-
Responses
207
Bulk update completed
- application/json object
application/json properties
- data array of objects
data properties
- id stringRequired
ID of the resource
- error object
error properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
- status integerRequired
Status code of operation on resource identified by ID
-
-
400
Bad request (Missing required field in request body)
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
403
User has no access to the endpoint. The endpoint requires Admin role
- application/json object
application/json properties
- errors array of objects
errors properties
- code string
Unique internal error code
- title string
A summary in english explaining what went wrong
- detail string
More concrete details
- status integer
HTTP status code
-
-
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({ hostConfig: { host: 'https://{tenant}.{region}.qlikcloud.com', apiKey: '<access-token>', },})
await qlik.dataConnections.updateDataConnections({ connections: [ { id: 'b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd', name: 'MyConnection', ownerId: '6K9xjsItDexffSlu5vg1oWYkY8x7f-06', spaceId: '611bcebaeec1203d88211ac4', spaceType: 'personal', }, ],})qlik data-connection update \ --connections-id '' \ --connections-name '' \ --connections-ownerId '' \ --connections-spaceId '' \ --connections-spaceType ''curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-connections/actions/update" \-X POST \-H "Content-type: application/json" \-H "Authorization: Bearer <access_token>" \-d '{"connections":[{"id":"b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd","name":"MyConnection","ownerId":"6K9xjsItDexffSlu5vg1oWYkY8x7f-06","spaceId":"611bcebaeec1203d88211ac4","spaceType":"personal"}]}'Example Response
{ "data": [ { "id": "b2c1ab1f-392c-4cd1-87bd-4c3cd256f5fd", "error": { "code": "DCERROR-0010", "title": "Bad or invalid request", "detail": "Field xxx is missing in the request", "status": 400 }, "status": 204 } ]}