Help Center/ DataArts Insight/ API Reference/ Dataset/ Obtaining Dataset Details
Updated on 2025-02-25 GMT+08:00

Obtaining Dataset Details

Function

This API is used to obtain dataset details.

URI

GET /v1/{project_id}/datasets/{dataset_id}/metadata

Table 1 URI parameter

Parameter

Mandatory

Type

Description

dataset_id

Yes

String

Dataset ID.

project_id

Yes

String

Project ID. For how to obtain a project ID, see Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Workspace-Id

Yes

String

Workspace ID. For how to obtain it, see Obtaining a Workspace ID.

X-Auth-Token

Yes

String

User token. Obtain a user token by calling IAM's "Obtaining a User Token" API. X-Subject-Token in the response header is the desired user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

caption

String

Semantic name of a dataset.

domain_id

String

Tenant ID.

ds_id

String

Data source ID.

ds_type

String

Data source type.

id

String

Dataset ID.

logical_schema

Table 4 object

Logical schema of the dataset.

physical_schema

Table 13 object

Physical schema of the dataset.

project_id

String

Project ID.

version

String

Dataset version. The default value is 2.0. The options include 1.0 and 2.0.

workspace_id

String

Workspace ID.

create_date

Long

Creation timestamp.

create_user

String

Creator ID.

create_user_name

String

Creator name.

update_date

Long

Update timestamp.

update_user

String

ID of the user who performs the update.

update_user_name

String

Name of the user who performs the update.

resource_code

String

Dataset resource ID.

Table 4 LogicalSchema

Parameter

Type

Description

field_schema

Table 5 object

Field schema.

relations

Array of Table 10 objects

Physical table relations.

variables

Array of Table 12 objects

List of SQL variables.

Table 5 DatasetFieldSchemaVO

Parameter

Type

Description

dimensions

Array of Table 6 objects

Dimensions.

measures

Array of Table 9 objects

Metrics.

Table 6 DimensionVo

Parameter

Type

Description

caption

String

Semantic name of a dimension.

cube_id

String

ID of the physical table a dimension belongs to.

description

String

Dimension description.

id

String

Dimension ID.

hierarchies

Array of Table 7 objects

Dimension levels.

Table 7 Hierarchy

Parameter

Type

Description

caption

String

Semantic name of a hierarchical structure.

levels

Array of Table 8 objects

Hierarchy levels.

Table 8 LevelVO

Parameter

Type

Description

caption

String

Semantic name.

column_formula

String

Level expression.

data_type

String

Field type. The options are STRING, DATE, and DATETIME.

Enumerated values:

  • STRING|DATE|DATETIME

expansion_type

Integer

Extension field type. The options are 0 (common extension field) and 1 (aggregation extension field).

id

String

ID.

is_expansion

Integer

Whether a field is an extension field. The options are 0 (no) and 1 (yes).

Enumerated values:

  • 0
  • 1

level_type

String

Level type.

origin_column_name

String

Original field name.

origin_column_type

String

Original field type.

origin_data_type

String

Data type before conversion. The options are STRING, DATE, and DATETIME.

Enumerated values:

  • STRING|DATE|DATETIME
Table 9 MeasureVo

Parameter

Type

Description

caption

String

Semantic name of a metric.

column_formula

String

Field expression of a metric.

cube_id

String

ID of the physical table a field belongs to.

data_type

String

Data type. The options are STRING, NUMBER, DATE, and DATETIME.

Enumerated values:

  • STRING|NUMBER|DATE|DATETIME

expansion_type

Integer

Extension field type. The options are 0 (common extension field) and 1 (aggregation extension field).

id

String

Metric ID.

is_expansion

Integer

Whether a field is an extension field. The options are 0 (no) and 1 (yes).

origin_column_name

String

Original field name.

origin_column_type

String

Original field type.

origin_data_type

String

Data type before conversion. The options are STRING, NUMBER, DATE, and DATETIME.

Enumerated values:

  • STRING|NUMBER|DATE|DATETIME
Table 10 DatasetRelationVO

Parameter

Type

Description

join_type

String

Join type. The options are left join, right join, and inner join.

joins

Array of Table 11 objects

Join key.

relation

String

Relation type. The options include one-to-one, one-to-many, and many-to-one.

source

String

Source table ID.

target

String

Target table ID.

Table 11 DatasetJoinVO

Parameter

Type

Description

condition

String

Relation. The value is equal-to.

source_key

String

Source field ID.

source_type

String

Source field type. The options are dimension and measure.

target_key

String

Target field ID.

target_type

String

Target field type. The options are dimension and measure.

Table 12 SqlVariable

Parameter

Type

Description

default_values

Array of objects

Default variable value.

format

String

Variable format, which is valid only for variables of the date and time type.

name

String

Variable name.

type

String

Variable type. The options include STRING, NUMBER, DATE, DATETIME, and TIMESTAMP.

Enumerated values:

  • STRING|NUMBER|DATE|DATETIME|TIMESTAMP

use_scope

String

Variable scope. The options are dataset and global.

Table 13 PhysicalSchema

Parameter

Type

Description

tables

Array of Table 14 objects

Physical tables.

Table 14 DatasetTableVO

Parameter

Type

Description

id

String

Table ID.

database_name

String

Database.

schema_name

String

Schema name.

table_name

String

Table name.

table_type

String

Dataset type.

sql_text

String

Query SQL.

is_fact_table

Boolean

Whether the table is an endpoint table.

Example Request

GET https://{endpoint}/v2/{project_id}/datasets/{dataset_id}/metadata

Example Response

Status code: 200

Dataset details are successfully obtained.

{ 
  "create_date" : 1705458279173, 
  "create_user" : "cfcxxxx4501811aedcxxxxbbfe8", 
  "create_user_name" : "xxxxxxx", 
  "update_date" : 1705458279173, 
  "update_user" : "cfcc77xxxx364501811aedcxxxxbbfe8", 
  "update_user_name" : "xxxxxxx", 
  "project_id" : "34ba64e53axxxb68cd7xxxxa8cc17bd", 
  "workspace_id" : "d39157xxxx5f43c2bdxxxx74792b2d5e", 
  "id" : "b745d57b-xxxx-4f2a-xxxx-3c0ff5fcf92f", 
  "caption" : "API Test Dataset 10", 
  "version" : "2.0", 
  "ds_id" : "2eaa208dxxxxxxx9496914134fae2d4", 
  "ds_type" : "DWS", 
  "domain_id" : "10ae45e7xxxxxxbe954a211426d003", 
  "physical_schema" : { 
    "tables" : [ { 
      "id" : "a25173cb-xxxx-42ec-xxxxx-67483f6cdaab", 
      "database_name" : "modernbi_demo", 
      "schema_name" : "autotest", 
      "table_name" : "order_info", 
      "table_type" : "table", 
      "sql_text" : "", 
      "is_fact_table" : false 
    }, { 
      "id" : "b745d57b-xxxx-4f2a-xxxx-3c0ff5fcf92f", 
      "database_name" : "modernbi_demo", 
      "schema_name" : "autotest", 
      "table_name" : "sql_order_info", 
      "table_type" : "sql", 
      "sql_text" : "select * from autotest.order_info", 
      "is_fact_table" : true 
    } ] 
  }, 
  "logical_schema" : { 
    "field_schema" : { 
      "measures" : [ { 
        "id" : "2d83ad17-32bb-xxxx-9c55-xxxxxxx", 
        "caption" : "cs_bill_customer_sk", 
        "is_expansion" : 0, 
        "expansion_type" : 0, 
        "column_formula" : "cs_xxxxx_customer_sk", 
        "origin_column_name" : "cs_xxxx_customer_sk", 
        "origin_column_type" : "int8", 
        "data_type" : "NUMBER", 
        "origin_data_type" : "NUMBER", 
        "cube_id" : "2d83ad17-xxxxxxxxx-9c55-2a47415bdaf6" 
      } ], 
      "dimensions" : [ { 
        "id" : "a25173cb-e229-xxxxxxx-67483f6cdaab.id", 
        "caption" : "id1", 
        "dimension_type" : "StandardDimension", 
        "hierarchies" : [ { 
          "caption" : "id1", 
          "levels" : [ { 
            "id" : "a25173cb-xxxxxxxxc-a4b4-67483f6cdaab.id", 
            "caption" : "id1", 
            "data_type" : "STRING", 
            "origin_data_type" : "STRING", 
            "origin_column_name" : "id", 
            "origin_column_type" : "varchar(255)", 
            "column_formula" : "id", 
            "level_type" : null, 
            "is_expansion" : 0, 
            "expansion_type" : 0 
          } ] 
        } ], 
        "cube_id" : "a25173cb-xxxxxxxc-a4b4-67483f6cdaab" 
      } ] 
    }, 
    "variables" : null, 
    "relations" : [ { 
      "source" : "b745d57b-axxxxx8ee4-3c0ff5fcf92f", 
      "target" : "a25173cb-xxxxxx-a4b4-67483f6cdaab", 
      "join_type" : "left join", 
      "relation" : "many-to-one", 
      "joins" : [ { 
        "source_key" : "product_id", 
        "source_type" : "dimension", 
        "target_key" : "product_id", 
        "target_type" : "dimension", 
        "condition" : "equal-to" 
      } ] 
    } ] 
  } 
}

Status Codes

Status Code

Description

200

Dataset details are successfully obtained.

Error Codes

See Error Codes.