Help Center/ DataArts Insight/ API Reference/ Sharing and Collaboration/ Batch Saving, Modifying, and Deleting Authorization Records
Updated on 2025-02-25 GMT+08:00

Batch Saving, Modifying, and Deleting Authorization Records

Function

This API is used to save, modify, and delete specified self-developed authorization rule records in batches.

URI

POST /v1/{project_id}/authorization/cooperate-authorization/rules/batch-save

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

[Array element]

Yes

Array of CooperateAuthorizationRuleDto objects

Authorization rules.

Table 4 CooperateAuthorizationRuleDto

Parameter

Mandatory

Type

Description

auth_id

No

String

User or user group ID of the authorization entity.

auth_level

No

String

Authorization entity level. The options include:

  • user: user.
  • group: user group.

authority

No

String

Permissions. The options include:

  • edit,export: edit and export permissions.
  • edit: edit permission.
  • export: export permission.
  • read: view permission.
  • use: use permission.
    NOTE:

    Permissions depend on each other.

    • Granting the edit permission will automatically grant the use and read permissions.
    • Granting the export permission will automatically grant the use and read permissions.
    • The export and edit operations do not depend on each other.

resource_id

No

String

Resource ID.

resource_type

No

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 5 Response body parameter

Parameter

Type

Description

message

String

Message content of the general Message structure.

Example Request

Save, modify, and delete specified self-developed authorization rule records in batches.

POST https://{endpoint}/v1/xxxx3ab4dac4055888643b331axxxx/authorization/cooperate-authorization/rules/batch-save
[ {
  "auth_id" : "de9cb4xxxx4b0ba2887b80dc18d273",
  "auth_level" : "user",
  "authority" : "edit",
  "resource_id" : "d0d7919c-xxxx-462e-xxxx-da82bf8be44e",
  "resource_type" : "dashboard"
}, {
  "auth_id" : "de9cb4axxxxa2887b80dc18d273",
  "auth_level" : "user",
  "authority" : "edit,export",
  "resource_id" : "d0d7919c-4e87-xxxx-xxxx-da82bf8be44e",
  "resource_type" : "dashboard"
} ]

Example Response

The request is successful, and success is returned.

{
  "message" : "success"
}

Status Codes

Status Code

Description

200

The request is successful, and success is returned.

Error Codes

See Error Codes.