Updated on 2025-12-25 GMT+08:00

Querying a Metadata File (1.0.2)

Function

This API is used to query a metadata file.

URI

GET /v2/{project_id}/graphs/metadatas/{metadata_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

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

Constraints

N/A

Range

The value can contain up to 64 characters. Only letters and digits are allowed.

Default Value

N/A

metadata_id

Yes

String

Definition

Metadata file ID.

Constraints

N/A

Range

N/A

Default Value

N/A

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. It is used to obtain the permission to call APIs. For how to obtain the token, see Authentication. (The token is the value of X-Subject-Token in the response header.)

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

master_key_name

String

Definition

Key name.

Range

N/A

master_key_id

String

Definition

Key ID.

Range

N/A

ges_metadata

ges_metadata object

Definition

Object that stores message information for metadata.

Range

N/A

Table 4 ges_metadata

Parameter

Type

Description

labels

Array of labels objects

Definition

A collection of the Label data structure.

Range

N/A

Table 5 labels

Parameter

Type

Description

name

String

Definition

Label name.

Range

N/A

properties

Array of Map<String,String> objects

Definition

Property map.

Range

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

System prompt.

  • If the execution succeeds, this parameter may be left blank.
  • If the execution fails, this parameter is used to display the error code.

Range

N/A

error_msg

String

Definition

System prompt.

  • If the execution succeeds, this parameter may be left blank.
  • If the execution fails, this parameter is used to display the error message.

Range

N/A

Example Request

Query metadata of a graph.

GET https://{Endpoint}/v2/{project_id}/graphs/metadatas/{metadata_id}

Example Response

Status code: 200

Example response for a successful request

{
  "ges_metadata" : {
    "labels" : [ {
      "name" : "friends"
    }, {
      "name" : "movie",
      "properties" : [ {
        "data_type" : "string",
        "name" : "ChineseTitle",
        "cardinality" : "single"
      }, {
        "data_type" : "int",
        "name" : "Year",
        "cardinality" : "single"
      }, {
        "data_type" : "string",
        "name" : "Genres",
        "cardinality" : "set"
      } ]
    }, {
      "name" : "user",
      "properties" : [ {
        "data_type" : "string",
        "name" : "ChineseName",
        "cardinality" : "single"
      }, {
        "type_name1" : "F",
        "type_name2" : "M",
        "data_type" : "enum",
        "name" : "Gender",
        "type_name_count" : "2",
        "cardinality" : "single"
      }, {
        "type_name1" : "Under 18",
        "type_name2" : "18-24",
        "type_name3" : "25-34",
        "type_name4" : "35-44",
        "type_name5" : "45-49",
        "type_name6" : "50-55",
        "type_name7" : "56+",
        "data_type" : "enum",
        "name" : "Age",
        "type_name_count" : "7",
        "cardinality" : "single"
      }, {
        "data_type" : "string",
        "name" : "Occupation",
        "cardinality" : "single"
      }, {
        "data_type" : "char array",
        "name" : "Zip-code",
        "max_data_size" : "12",
        "cardinality" : "single"
      } ]
    }, {
      "name" : "rate",
      "properties" : [ {
        "data_type" : "int",
        "name" : "Score",
        "cardinality" : "single"
      }, {
        "data_type" : "date",
        "name" : "Datetime",
        "cardinality" : "single"
      } ]
    } ]
  }
}

Status code: 400

Example response for a failed request

{
  "error_msg" : "6b74069d-3cf3-4cc0-9118-2478e23b87a does not exist.",
  "error_code" : "GES.2067"
}

Status Codes

Return Value

Description

400 Bad Request

Request error.

401 Unauthorized

Authorization failed.

403 Forbidden

No operation permissions.

404 Not Found

No resources found.

500 Internal Server Error

Internal server error.

503 Service Unavailable

Service unavailable.