Help Center> RES> API Reference> API> Workspace> Querying the List of Workspaces

Querying the List of Workspaces

Function

This API is used to query the list of workspaces on which the current user has the operation permissions.

URI

GET /v2.0/{project_id}/workspaces

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Content type. The value is application/json.

X-Auth-Token

Yes

String

User token. For details on how to obtain the user token, see Obtaining a User Token Through Password Authentication.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

is_success

Boolean

Whether the request is successful

workspaces

Array of workspaces objects

Workspace list

message

String

Response message (This field is not returned when the request is successful.)

error_code

String

Error code (This parameter is not returned when the request is successful.)

Table 4 workspaces

Parameter

Type

Description

created_at

Long

Creation time

description

String

Description

enterprise_project_id

String

Enterprise project ID

enterprise_project_name

String

Name of an enterprise project

id

String

Workspace ID

name

String

Workspace name

owner

String

Creator

status

String

Status

update_at

Long

Update time

userId

String

User ID

projectId

String

Project ID of the invoking account

Example Requests

This API is used to query the list of workspaces.

/v2.0/testuuidxxxxxxxxxxxxxxxxxxxxxxxx/workspaces

-

Example Responses

Status code: 200

OK

{
  "is_success" : true,
  "workspaces" : [ {
    "userId" : "06a7c49bb080d3311f77c011850266e5",
    "projectId" : "06a7c49afc00d4972ff1c0113d8c49ba",
    "id" : "06a7c49afc00d4972ff1c0113d8c49ba",
    "name" : "default",
    "description" : "--",
    "enterprise_project_id" : "0",
    "enterprise_project_name" : "default",
    "status" : "NORMAL",
    "owner" : "ei_res_01",
    "created_at" : 1587090097881,
    "update_at" : 1587090097881
  }, {
    "userId" : "06a7c49bb080d3311f77c011850266e5",
    "projectId" : "06a7c49afc00d4972ff1c0113d8c49ba",
    "id" : "3b3c7f8a36614d359d919089d4805901",
    "name" : "res_atuo-test",
    "description" : "test",
    "enterprise_project_id" : "0",
    "enterprise_project_name" : "default",
    "status" : "NORMAL",
    "owner" : "ei_res_01",
    "created_at" : 1585721614279,
    "update_at" : 1585721614279
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.