All Products
Search
Document Center

Quick BI:AddDataSource

Last Updated:Dec 12, 2025

Adds the connection information for a data source.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

AddModel

string

Yes

To construct the request, you can impersonate the `restapi/datasource/detect` API call. This call is triggered when you click **Test Connection** on the Add Data Source page in the Quick BI console. Pass the same JSON payload model, and include a `userId` and workspace ID that exist in Quick BI.

Important Some data sources are not supported. If you pass the correct parameters but the data source is not added, this OpenAPI operation may not support that data source type.
Important Do not pass the `encode` field. This OpenAPI operation does not support creating data sources in encryption mode. Authentication that requires file uploads is also not supported.

{ "userId": "235345xxxxx24336", "workspaceId": "235345xxxxx24336", "dsType": "postgresql", "config": { "category": "local", "customDriverId": null, "ssl": false, "uploadFile": true, "sslConfig": null }, "showName": "test", "address": "test", "port": "5432", "instance": "postgres", "schema": "public", "userName": "13****34", "password": "12****425", }

Request parameter examples:

  • adb:
    {
    "showName":"AnalyticDB adb3.0",
    "address":"",
    "port": 3306,
    "dsType":"adb",
    "username":"xxx",
    "password":"xxx",
    "schema": null,
    "instance":"test",
    "workspaceId":"xxx",
    "userId":"xxx"
    }











  • maxcompute:
    {
    "showName": "maxcompute",
    "address": "http://service.xxx.xxx.com/api",
    "port": null,
    "dsType": "odps",
    "username": "xxx (The AccessKey ID)",
    "password": "xxx (The AccessKey secret)",
    "schema": null,
    "instance": "Project name (The name of the project)",
    "project": "Project name",
    "config": null,
    "workspaceId": "xxx",
    "userId": "xxx"
    }













  • hive:
    { "showName": "test",
    "address": "192.168.0.1",
    "port": "10000",
    "dsType": "hive",
    "instance": "hive (The name of the database)",
    "userName": "xxx",
    "password": "xxx",
    "config": {
    "category": "local"
    }
    }










  • gbase:
    { "showName": "test",
    "address": "192.168.0.1",
    "port": "5258",
    "dsType": "gbase",
    "instance": "quickbi_test",
    "username": "root",
    "password": "root",
    "config": {
    "category": "local"
    },
    "workspaceId": "xxx",
    "userId": "xxx"
    }












  • rds-mysql:
    { "showName":"mysql",
    "address":"",
    "port": 3306,
    "dsType":"mysql",
    "username":"xxx",
    "password":"xxx",
    "schema": null,
    "instance":"test",
    "workspaceId":"xxx",
    "userId":"xxx"
    }










  • hologres:
    { "showName": "Hologres data source",
    "address": "hgprecn-cn--cn-shanghai.hologres.aliyuncs.com",
    "instance": "quickbi_test",
    "schema": "public",
    "port": "80",
    "dsType": "hologres",
    "userId": "fec0741



    
*****061e6a951a2",
    "config": {
    "initialSql": "Set timezone = '-10'"
    },
    "workspaceId": "87f73904-


    

    **-
    -b1ee-5a3a03a8eb45",
    "username": "LTAI4GD
***LEpsdxkW9",
    "password": "nVvUqwPUz

    ***A3sCqockS7"
    }


  • impala (LDAP authentication):
    {
    "workspaceId": "87f73904---b1ee-5a3a03a8eb45",
    "userId": "fec0741*****061e6a951a2",
    "dsType": "impala",
    "config": {
    "category": "local",
    "resource": "ecs",
    "ssl": false
    },
    "showName": "impala-ldap",
    "address": "xx.xx.xx.xx",
    "port": "xxxx",
    "instance": "default",
    "dsVersion": "3.x",
    "username": "xxxxx",
    "password": "xxxxxxxxx",
    "instanceId": "i-uf6fxxxxxbt3eh6lb",
    "noSasl": true
    }


















  • impala:
    { "showName": "impala-test",
    "address": "192.168.0.1",
    "port": "21050",
    "dsType": "impala",
    "dsVersion": "3.x (The Impala version. Valid values are 2.x and 3.x.)",
    "instance": "test (The name of the database)",
    "userName": "xxx",
    "password": "xxx",
    "config": {
    "category": "local",
    "ssh" : {
    "host": "192.168.0.2",
    "username": "xxxx",
    "password": "xxx",
    "port": "22"
    }
    } }
















  • dataphin (Connection method: Dataphin service data source. Engine type: ODPS):
    {
    "workspaceId": "87f73904---b1ee-5a3a03a8eb45",
    "userId": "fec0741*****061e6a951a2",
    "dsType": "dataphin_odps",
    "address": "f6c64214dc27400xxxxxx-cn-shanghai.alicloudapi.com",
    "username": "20xxx18",
    "password": "33paqqexxxxg07qzj28",
    "instance": "test_ds",
    "showName": "1_1_dataphin_odps",
    "config": {
    "category": "application",
    "engineType": "odps"
    }
    }













  • dataphin (Connection method: Dataphin service data source. Engine type: Hive):
    {
    "workspaceId": "87f73904---b1ee-5a3a03a8eb45",
    "userId": "fec0741*****061e6a951a2",
    "dsType": "dataphin_hive",
    "address": "f6c64214dc27400xxxxxx-cn-shanghai.alicloudapi.com",
    "username": "20xxx18",
    "password": "33paqqexxxxg07qzj28",
    "instance": "test_ds",
    "showName": "1_1_dataphin_odps",
    "config": {
    "category": "application",
    "engineType": "hive"
    }
    }













  • dataphin (Connection method: JDBC connection. AccessKey type: Dataphin platform):
    {
    "workspaceId": "87f73904---b1ee-5a3a03a8eb45",
    "userId": "fec0741*****061e6a951a2",
    "dsType": "odps",
    "config": {
    "engineType": "hive",
    "category": "application",
    "dataphinConfig": {
    "tenantId": "305xxx306",
    "delegationUid": "@dataphin",
    "accountType": "ACCOUNT_NAME",
    "authMode": "DELEGATION"
    },
    "resource": "clb",
    "initialSql": "Set timezone = '-10'"
    },
    "showName": "DataPhin_JDBC_public",
    "connectType": "dataphin_v2",
    "address": "47.xxx.xxx.124",
    "port": "80",
    "project": "bbb",
    "instance": "fxxxk_test",
    "username": "OIYtGZxxx7zmRpgQpB",
    "password": "lDbQDnUuxxxxxGsxOd1",
    "parentDsType": "dataphin",
    "accessId": "[3eo[x>>",
    "accessKey": "bHipbB>>",
    "instanceId": "nnnn",
    "region": "cn-qingdao"
    }





























  • dataphin (Connection method: JDBC connection. AccessKey type: Personal user):
    {
    "workspaceId": "87f73904---b1ee-5a3a03a8eb45",
    "userId": "fec0741*****061e6a951a2",
    "dsType": "dataphin_v2",
    "config": {
    "engineType": "hive",
    "category": "application",
    "dataphinConfig": {
    "tenantId": "30xxxx6",
    "authMode": "SIMPLE"
    },
    "resource": "clb",
    "initialSql": "Set timezone = '-10'"
    },
    "showName": "Dataphin-jdbc-private",
    "connectType": "dataphin_v2",
    "address": "47.xxx.x4x.124",
    "port": "80",
    "project": "bbb",
    "instance": "fxxx_test",
    "username": "kItowxxxxxxx2ZJr0",
    "password": "kSlPkmS1xxxxxx61zd4SDX",
    "parentDsType": "dataphin",
    "accessId": "[3eo[x>>",
    "accessKey": "bHipbB>>",
    "instanceId": "nnnn",
    "region": "cn-qingdao"
    }



























Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

Request ID.

D787E1********DF8D885

Result

string

Data source ID.

472b241b-c651-****-****-ee719d6faf45

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "RequestId": "D787E1********DF8D885",
  "Result": "472b241b-c651-****-****-ee719d6faf45",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 Internal.System.Error An internal system error occurred. An internal system error occurred.
400 Invalid.Parameter.Error The parameter is invalid:%s. invalid parameter: ${0}.
400 User.NotIn.Workspace The user is not a member of the group workspace. The user is not a member of the group workspace.
400 Invalid.Workspace The workspace is not owned by the organization.
400 Name.RegularExpression.Error Name format validation failed.
400 NameExceeded.MaxLength.Error The name cannot exceed %s characters in length. The name cannot be longer than% s characters.
400 Database.PortInvalid.Error The database port is invalid. The database port is invalid.
400 Xengnie.TaskExecute.Error Fail to execute task %s. Fail to execute task %s.
400 VpcInstance.Info.Error Get vpc instance info error.please check vpc config %s. Get VPC instance info error.please check VPC config %s.
400 VpcInstance.Info.EmptyError Not found instance. please check vpc config and authorization %s. Not found instance. please check VPC config and authorization %s.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.