Docs 菜单
Docs 主页
/
MongoDB Cloud Manager
/ / /

撤销服务帐户令牌

在此页面上

  • Resource
  • 请求路径参数
  • 请求查询参数
  • 请求正文参数
  • 响应
  • 请求示例
  • 响应示例
  • 响应标头
  • 响应体
POST https://cloud.mongodb.com/api/oauth/revoke

此端点不使用 HTTP 请求路径参数。

以下查询参数为可选参数:

名称
类型
必要性
说明
默认
pretty
布尔
Optional
false
envelope
布尔
Optional

指示是否将响应包装在信封中的标志。

某些 API 客户端无法访问 HTTP 响应标头或状态代码。要修复此问题,在查询中设置 envelope : true

对于返回结果列表的端点,content 对象是一个信封。Cloud Manager 将 status 字段添加到响应正文。

false
backupJobsEnabledOnly
布尔
Optional
指示是否从响应中排除未启用备份数据库的守护进程的标志。 将其设置为false以包含将backupJobsEnabled标志设置为false的守护进程配置。
true

需要所有正文参数。

名称
类型
说明
TOKEN
字符串

将以下示例中的 {BASE64-AUTH} 替换为基本 64 编码的服务帐户客户端ID和密钥。要学习;了解更多信息,请参阅发出API请求。

curl -X POST https://cloud.mongodb.com/api/oauth/revoke \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Authorization: Basic {BASE64-AUTH}" \
-d "token={TOKEN}&token_type_hint=access_token"
HTTP/1.1 200 OK
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
HTTP/1.1 400 Bad Request
Date: {dateInUnixFormat}
Content-Type: application/json
Content-Length: {requestLengthInBytes}
Server: mdbws
Strict-Transport-Security: max-age=31536000; includeSubdomains;
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 401 Unauthorized
Content-Type: application/json;charset=ISO-8859-1
Date: {dateInUnixFormat}
WWW-Authenticate: Digest realm="MMS Public API", domain="", nonce="{nonce}", algorithm=MD5, op="auth", stale=false
Content-Length: {requestLengthInBytes}
Connection: keep-alive
HTTP/1.1 403 Forbidden
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 429 Too Many Requests
Retry-After: {retryAfterValue}
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Connection: keep-alive
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 500 Internal Server Error
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...
HTTP/1.1 503 Service Unavailable
Retry-After: {retryAfterValue}
Vary: Accept-Encoding
Content-Type: application/json
Strict-Transport-Security: max-age=300
Date: {dateInUnixFormat}
Content-Length: {requestLengthInBytes}
X-MongoDB-Service-Version: gitHash={gitHash}; versionString={ApplicationVersion}
...

此端点不返回响应正文。

{
"error_description": "The provided credentials are not valid.",
"error": "invalid_request"
}
{
"error_description": "Invalid grant type.",
"error": "unsupported_grant_type"
}
{
"error_description": "Invalid grant.",
"error": "invalid_grant"
}
{
"error_description": "Invalid credentials provided.",
"error": "invalid_client"
}
{
"error_description": "IP access list validation failed for the service account.",
"error": "access_denied"
}
{
"error_description": "Resource {URL} is limited to 10 requests every 1 minutes.",
"error": "rate_limited"
}
{
"error_description": "Unexpected error.",
"error": "server_error"
}

后退

生成服务帐户令牌