Skip to content

GET /api/v1/projects/{projectId}/domains/{domainId}

GET/api/v1/projects/{projectId}/domains/{domainId}

域名详情(需 viewer 及以上)

projectoperationId: projectDomainGet

请求参数

名称类型位置必填说明
projectIdstringpath是项目 ID(UUID)。携带 `X-API-Key` 时按 API Key scope 鉴权,否则按 JWT + 项目成员角色鉴权
domainIdstringpath是—

请求示例

cURL
curl -X GET 'http://localhost:8080/api/v1/projects/{projectId}/domains/{domainId}' \
  -H 'Accept: application/json' \
  -H 'X-API-Key: <PROJECT_API_KEY>'
# 也可使用登录会话:-H 'Authorization: Bearer <JWT>'
JavaScript
const res = await fetch('http://localhost:8080/api/v1/projects/{projectId}/domains/{domainId}', {
  method: 'GET',
  headers: {
    'Accept': 'application/json',
    'X-API-Key': '<PROJECT_API_KEY>'
  },
});
const data = await res.json();
Python
import requests

res = requests.get(
    'http://localhost:8080/api/v1/projects/{projectId}/domains/{domainId}',
    headers={'Accept': 'application/json', 'X-API-Key': '<PROJECT_API_KEY>'}
)
print(res.json())

响应

200成功

application/json

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "project_id": {
      "type": "string",
      "format": "uuid"
    },
    "storage_id": {
      "type": "string",
      "format": "uuid",
      "nullable": true
    },
    "domain": {
      "type": "string"
    },
    "status": {
      "type": "string"
    },
    "is_legacy": {
      "type": "boolean"
    },
    "verification_token": {
      "type": "string"
    },
    "verification_record_name": {
      "type": "string"
    },
    "verified_at": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "platform_cname_target": {
      "type": "string"
    },
    "cname_verified_at": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "ssl_status": {
      "type": "string"
    },
    "dns_suspended_at": {
      "type": "string",
      "format": "date-time",
      "nullable": true
    },
    "last_error": {
      "type": "string"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  }
}
404资源不存在

application/json

{
  "type": "object",
  "properties": {
    "code": {
      "type": "string",
      "example": "not_found"
    },
    "message": {
      "type": "string",
      "example": "资源不存在"
    }
  }
}

在线调试

在线调试
凭证仅保存在当前页面内存中
自定义请求 Header