Data credentials

Data credentials are the stored credentials leveraged by the data-connections service to connect to external data sources.

Gets a credential by ID (or by name when bycredentialname=true is set in query)

Facts

Rate limit Tier 1 (1000 requests per minute)

Query Parameters

  • byCredentialName boolean

    If set to true, credentialId in the query will be interpreted as credential's name

Path Parameters

  • qID string
    Required

    Credential ID

Responses

200

Credential retrieved

  • application/json object
    Show application/json properties
    • qID string
      Required

      UUID of the credential

    • links object
      Show links properties
      • self object
        Required

        Link to current query

        Show self properties
        • href string
          Required

          URL pointing to the resource

    • qName string
      Required Filterable

      Name of the credential

    • qType string
      Required Filterable

      Type of credential

    • created string

      Datetime when the credential was created

    • updated string

      Datetime when the credential was last updated

    • qConnCount integer
      Required

      Number of linked connections

    • datasourceID string

      ID datasource that the credential is created for

    • qReferenceKey string

      Reference key of credential in redis

400

Empty value not permitted for dataName

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

Credential not found

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

GET /api/v1/data-credentials/{qID}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.dataCredentials.getDataCredential(
'027d2703-e745-43ec-8876-a2e6ac341700',
{},
)
qlik data-credential get '027d2703-e745-43ec-8876-a2e6ac341700'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-credentials/{qID}" \
-H "Authorization: Bearer <access_token>"

Example Response

{
"qID": "065f977e-6eca-408c-b78b-ecded823712c",
"links": {
"self": {
"href": "https://mytenant.us.qlikcloud.com/..."
}
},
"qName": "MyCredential for REST datasource",
"qType": "QvWebStorageProviderConnectorPackage.exe",
"created": "2022-04-08T10:00:28.287Z",
"updated": "2022-04-09T10:00:28.287Z",
"qConnCount": 1,
"datasourceID": "rest",
"qReferenceKey": "credential:key"
}

Patches a credential specified by ID (or by name when bycredentialname=true is set in query)

Facts

Rate limit Tier 2 (100 requests per minute)

Query Parameters

  • byCredentialName boolean

    If set to true, credentialId in the query will be interpreted as credential's name

Path Parameters

  • qID string
    Required

    Credential ID

Request Body

Required
  • application/json array of objects
    Show application/json properties
    • op string
      Required

      Operation type

      Can be one of: "add""replace""remove"

    • path string
      Required

      Path to the target field to be patched

    • value string|boolean|integer|array

      Value used for the patch. Required only for add or replace operations. The value type should match the type of the target field.

      One of:
      • string
      • boolean
      • integer
      • array

Responses

204

Credential updated successfully

400

Connection ID changed

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

Credential not found

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

Credential already exists (when updated name conflicts with existing record)

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

PATCH /api/v1/data-credentials/{qID}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.dataCredentials.patchDataCredential(
'027d2703-e745-43ec-8876-a2e6ac341700',
{},
[
{
op: 'add',
path: '/qName',
value: 'New value',
},
],
)
qlik data-credential patch '027d2703-e745-43ec-8876-a2e6ac341700' \
--op 'add' \
--path '/qName'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-credentials/{qID}" \
-X PATCH \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '[{"op":"add","path":"/qName","value":"New value"}]'

Updates a credential specified by ID (or by name when bycredentialname=true is set in query)

Facts

Rate limit Tier 2 (100 requests per minute)

Query Parameters

  • byCredentialName boolean

    If set to true, credentialId in the query will be interpreted as credential's name

Path Parameters

  • qID string
    Required

    Credential ID

Request Body

Required
  • application/json object

    Credential

    Show application/json properties
    • qID string

      UUID of the credential

    • qName string
      Required

      Name of the credential

    • qType string
      Required

      Type of credential (i.e. connector provider of the corresponding connection)

    • qPassword string
      Required

      Password

    • qUsername string
      Required

      User name

    • connectionId string

      ID of connection that will be associated with the credential

    • datasourceID string

      ID datasource that the credential is created for

Responses

204

Credential updated successfully

400

Connection ID changed

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

Credential not found

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

Credential already exists (when updated name conflicts with existing record)

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

PUT /api/v1/data-credentials/{qID}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.dataCredentials.updateDataCredential(
'027d2703-e745-43ec-8876-a2e6ac341700',
{},
{
connectionId:
'2eb98dea-5e3b-4f50-9967-841cec04b72f',
datasourceID: 'rest',
qID: 'c2dd20e3-1842-42d0-81fe-1ecf08e6abde',
qName: 'MyCredential for REST datasource',
qPassword: 'MyPassword',
qType:
'QvWebStorageProviderConnectorPackage.exe',
qUsername: 'MyUsername',
},
)
qlik data-credential update '027d2703-e745-43ec-8876-a2e6ac341700' \
--qName 'MyCredential for REST datasource' \
--qPassword 'MyPassword' \
--qType 'QvWebStorageProviderConnectorPackage.exe' \
--qUsername 'MyUsername'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-credentials/{qID}" \
-X PUT \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"qID":"c2dd20e3-1842-42d0-81fe-1ecf08e6abde","qName":"MyCredential for REST datasource","qType":"QvWebStorageProviderConnectorPackage.exe","qPassword":"MyPassword","qUsername":"MyUsername","connectionId":"2eb98dea-5e3b-4f50-9967-841cec04b72f","datasourceID":"rest"}'

Deletes the specified credential by ID (or by name when type=credentialname is set in query)

Facts

Rate limit Tier 2 (100 requests per minute)

Query Parameters

  • byCredentialName boolean

    If set to true, credentialId in the query will be interpreted as credential's name

Path Parameters

  • qID string
    Required

    Credential ID

Responses

204

Credential deleted successfully

404

Credential not found

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

DELETE /api/v1/data-credentials/{qID}
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.dataCredentials.deleteDataCredential(
'027d2703-e745-43ec-8876-a2e6ac341700',
{},
)
qlik data-credential rm '027d2703-e745-43ec-8876-a2e6ac341700'
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-credentials/{qID}" \
-X DELETE \
-H "Authorization: Bearer <access_token>"

Gets list of orphan data credentials (i.e. credentials that are not associated to any data connection) filtering on properties defined in request body

Facts

Rate limit Tier 2 (100 requests per minute)

Request Body

Required
  • application/json object
    Show application/json properties
    • qType string

      Filtering on type of credentials

    • qSeparated integer

      Filtering on separate status of credentials: * 0 - embedded credential * 1 - separated credential

      Can be one of: 01

    • datasourceID string

      Filtering on datasource ID of credentials

Responses

200

Orphan credentials returned

  • application/json object
    Show application/json properties
    • data array of objects
      Required

      Orphan credential

      Show data properties
      • qID string
        Required

        UUID of the credential

      • user string

        User ID of the credential's owner

      • qName string
        Required

        Name of the credential

      • qType string
        Required

        Type of credential (i.e. connector provider of the corresponding connection)

      • tenant string

        Tenant ID of the credential's owner

      • created string
        Required

        Datetime when the credential was created

      • updated string
        Required

        Datetime when the credential was last updated

      • datasourceID string

        ID datasource that the credential is created for

    • count integer
      Required

      Number of orphan credentials found

400

Bad request (Missing required field in request body)

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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 credentials

  • application/json object
    Show application/json properties
    • errors array of objects
      Show 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

POST /api/v1/data-credentials/actions/filter-orphan
import { createQlikApi } from '@qlik/api'
const qlik = createQlikApi({
hostConfig: {
host: 'https://{tenant}.{region}.qlikcloud.com',
apiKey: '<access-token>',
},
})
await qlik.dataCredentials.filterOrphanedDataCredentials(
{
datasourceID: 'snowflake',
qSeparated: 0,
qType: 'QvOdbcConnectorPackage.exe',
},
)
qlik data-credential filter-orphan
curl "https://{tenant}.{region}.qlikcloud.com/api/v1/data-credentials/actions/filter-orphan" \
-X POST \
-H "Content-type: application/json" \
-H "Authorization: Bearer <access_token>" \
-d '{"qType":"QvOdbcConnectorPackage.exe","qSeparated":0,"datasourceID":"snowflake"}'

Example Response

{
"data": [
{
"qID": "c2dd20e3-1842-42d0-81fe-1ecf08e6abde",
"user": "rFdHeUOiVYgPX5iTbvL0x0Cs6F62QI",
"qName": "MyCredential for REST datasource",
"qType": "QvWebStorageProviderConnectorPackage.exe",
"tenant": "xqFQ0k34vSR0d9G7J-vZtHZQkiYrCqc8",
"created": "2022-04-08T10:00:28.287Z",
"updated": "2022-04-09T10:00:28.287Z",
"datasourceID": "rest"
}
],
"count": 1
}