Help Center/ DataArts Insight/ API Reference/ Sharing and Collaboration/ Saving or Modifying Resource Attribute Values
Updated on 2025-02-25 GMT+08:00

Saving or Modifying Resource Attribute Values

Function

This API is used to save or modify resource attribute values.

URI

POST /v1/{project_id}/authorization/cooperate-authorization/properties

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 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 API. X-Subject-Token in the response header is the desired user token. For how to obtain a token, see Authentication.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

auth_switch_config

No

Map<String,Boolean>

Switch for permissions. It can be set to true or false to indicate whether the corresponding switch is turned on. The default value is false.

  • edit: edit permission.
  • export: export permission.
  • read: view permission.
  • use: use permission.
    NOTE:
    • There are dependencies between permissions. Granting edit permission automatically associates the read and export or use permission. Granting export permission automatically associates the read permission.
    • For dashboards and large screens, there are three permissions: edit, export, and read.

      For example, {"edit":false, "read":true, "export":true} means that view and export permissions are enabled.

    • For data sources, intelligent analysis assistants, and datasets, there are two permissions: edit and use, corresponding to edit and use permissions. For example, {"use":true, "edit":false} means that only the use permission is enabled.

resource_id

Yes

String

Resource ID.

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

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

auth_switch_config

Map<String,Boolean>

Switch for permissions, that is, the sharing and collaboration configuration item. It can be set to true or false to indicate whether the corresponding switch is turned on.

  • edit: edit permission.
  • export: export permission.
  • read: view permission.
  • use: use permission.
    NOTE:
    • There are dependencies between permissions. Granting edit permission automatically associates the read and export or use permission. Granting export permission automatically associates the read permission.
    • For dashboards and large screens, there are three permissions: edit, export, and read.

      For example, {"edit":false, "read":true, "export":true} means that view and export permissions are enabled.

    • For data sources, datasets, and domains, there are two permissions: edit and use, corresponding to edit and use permissions.

      For example, {"use":true, "edit":false} means that only the use permission is enabled.

create_date

Long

Creation time.

create_user

String

Creator ID.

create_user_name

String

Creator name.

id

String

ID of the resource collaboration authorization attribute table.

owner

String

Resource owner ID.

project_id

String

Project ID.

resource_id

String

Resource ID.

resource_type

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

update_date

Long

Modification time

update_user

String

Modifier ID.

update_user_name

String

Modifier name.

workspace_id

String

Workspace ID.

Example Request

Save or modify resource sharing and collaboration attribute values.

POST https://{endpoint}/v1/xxxxx3ab4dac4055888643b331xxxxx/authorization/cooperate-authorization/properties
{
  "auth_switch_config" : "{"read": true, "edit": true, "export": true}",
  "resource_id" : "d0d7919c-xxxx-462e-xxxx-da82bf8be44e",
  "resource_type" : "dashboard"
}

Example Response

Status code: 200

OK.

{
  "auth_switch_config" : "{"read": true, "edit": true, "export": true}",
  "create_date" : 1688022840899,
  "create_user" : "de9cb4xxxxa94b0ba2887b80xxxxxxxx",
  "create_user_name" : "***_01",
  "id" : "78215911-xxxx-478b-xxxx-9cb7f0407598",
  "owner" : "dxxxxa863a94xxxa2887b80xxxxxxxx",
  "project_id" : "xxx3ab4dac40558886xxxxx1a0b227",
  "resource_id" : "d0xxx19c-4e87-46xx-bxx2-da82bfxxxx4e",
  "resource_type" : "dashboard",
  "update_date" : 1688023886860,
  "update_user" : "de9cb4a863a94b0ba2887b80xxxxxxxx",
  "update_user_name" : "ei_dlv_***_01",
  "workspace_id" : "6xxxx96809adxxxxxa09e6bxxxx2146"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.