List Sites¶
GET /api/v1/workspace/website/list
Overview¶
Lists the site display information in the current brand configuration.
Before Calling and Usage Steps¶
Use an OpenAPI Key in the target Workspace that has permissions allowing reads, such as routine.defaultAccess. The current Workspace is determined by the Key in the request header; do not pass workspaceUUID at this entry point to switch Workspaces.
No Query/Body is required. This OpenAPI route does not pass parameters to the shared query method, so the type authorization filtering of frontend/internal entry points cannot be applied. It returns the sites in the current brand configuration and does not filter each item by isOpen or by whether the current Workspace is authorized; isCurSite only indicates equality with the current site code and is not a flag indicating queryability or authorization.
regionCode is used for subsequent cross-site target selection; first confirm data authorization in conjunction with the list of viewable Workspaces. endpoint is the site console entry point and cannot be directly treated as the root address of the OpenAPI or data query service. regionName is the site name in the language of the request context and can be null if missing; if there is no site configuration, [] is returned.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the Workspace. Example: <DF-API-KEY>How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target Workspace. |
Additional Parameter Notes¶
Returns information about sites configured in the current environment. content[*].regionCode can be used as a candidate site code for query.targetRegion, but the existence of a site does not mean that the current Workspace has been granted data access authorization for that site.
When selecting a cross-site target Workspace and targetRegion for query_data, you should preferentially call /api/v1/wksp_share/granted_ws_list and use the regionCode in the same group as the target workspaceUUID.
Request Example¶
curl --get 'https://openapi.guance.com/api/v1/workspace/website/list' \
-H 'DF-API-KEY: <DF-API-KEY>'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content | array<object> |
Array of sites; empty result []. |
| content[].regionCode | string | Site code; use the original string and do not use the display name as the code. |
| content[].regionName | string or null | Site display name in the current language; can be empty/null. |
| content[].endpoint | string | Site console configuration URL; can be empty; not a general API Endpoint. |
| content[].isCurSite | boolean | Whether it is the current site. |
| content[].declaration | object | Adds the current Workspace's common declaration to each non-empty site object. |
{
"code": 200,
"content": [
{
"regionCode": "site_example",
"regionName": "Example Site",
"endpoint": "https://console.guance.com",
"isCurSite": true,
"declaration": {}
}
],
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Response¶
For authentication, rate limiting, and common request errors, see Common Error Definitions.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Handling |
|---|---|---|---|---|
| 500 | ft.InternalServerError | Failure of Workspace/site/authorization configuration, database or cache reads, or response formatting | Internal error | Retain the traceId and query conditions. If retries continue to fail, ask the administrator to check the configuration; do not infer from an empty result that the site has no data. |