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

Creating Embedded Analytics

Function

This API is used to create embedded analytics.

URI

POST /v1/{project_id}/embeddings

Table 1 URI parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Request Parameters

Table 2 Request header parameter

Parameter

Mandatory

Type

Description

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.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

id

No

String

Embedded analytics ID. If specified, the ID that is passed in is used. Or, a new ID will be generated.

name

Yes

String

Embedded analytics name.

resource_type

Yes

String

Explanation

Enumerated value of the resource type, which is used to specify the type of the authorized object.

For example, datasource indicates that the type of the authorized object is a data source.

Constraints

N/A

Value range

The enumerated values are:

  • datasource: data source.
  • dataset: dataset.
  • metric: indicator.
  • dashboard: dashboard.
  • screen: large screen.
  • embedAnalysis: embedded analytics.
  • portal: data portal.
  • subject: intelligent analysis assistant.

Default value

N/A

resource_id

Yes

String

Resource ID corresponding to the embedded analytics, for example, the ID of the dashboard or large screen.

root_resource_id

Yes

String

Root resource ID corresponding to the embedded analytics, which is the root resource ID of the dashboard or large screen.

auth_type

No

String

Access type of the embedded analytics. 0 indicates login access, and 1 indicates ticket authentication. The default value is 0.

config

No

String

Configuration parameter of the embedded analytics. For example, ticket=xxxx indicates the ticket value in the embedded analytics link.

Response Parameters

Status code: 200

Table 4 Response body parameter

Parameter

Type

Description

id

String

ID of the created embedded analytics.

Example Request

Create embedded analytics.

POST https://{endpoint}/v1/{project_id}/embeddings 
 
{ 
  "id" : "6cb08a50xxxxxxxxxxxxxxxxxxxxxx", 
  "name": "New Embedded Analytics",
  "resource_type" : "dashboard", 
  "resource_id" : "866a519fxxxxxxxxxxxxxxxx", 
  "root_resource_id" : "866a519fxxxxxxxxxxxxxxxx", 
  "config" : "ticket=ec85f874axxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
  "auth_type" : 1 
}

Example Response

Status code: 200

The embedded analytics is created.

{     
"id": "6cb08a50xxxxxxxxxxxxxxxxxxxxxxx", 
}

Status Codes

Status Code

Description

200

The embedded analytics is created.

Error Codes

See Error Codes.