API网关 APIG-修改分组自定义响应:响应示例

时间:2024-06-27 11:06:20

响应示例

状态码: 200

OK

{
  "create_time" : "2020-08-12T06:52:02Z",
  "update_time" : "2020-08-12T15:22:21.929863859+08:00",
  "default" : false,
  "id" : "e839b367e10f4ab19d1c5008e476b83a",
  "name" : "response_demo",
  "responses" : {
    "AC CES S_DENIED" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 403
    },
    "AUTHORIZER_CONF_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 500
    },
    "AUTHORIZER_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 500
    },
    "AUTHORIZER_IDENTITIES_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 401
    },
    "AUTH_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 401
    },
    "AUTH_HEADER_MISSING" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 401
    },
    "BACKEND_TIMEOUT" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 504
    },
    "BACKEND_UNAVAILABLE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 502
    },
    "DEFAULT_4XX" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true
    },
    "DEFAULT_5XX" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true
    },
    "NOT_FOUND" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 404
    },
    "REQUEST_PA RAM ETERS_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 400
    },
    "THROTTLED" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 429
    },
    "UNAUTHORIZED" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 401
    },
    "THIRD_AUTH_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 401
    },
    "THIRD_AUTH_IDENTITIES_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 401
    },
    "THIRD_AUTH_CONF_FAILURE" : {
      "body" : "{\"error_code\":\"$context.error.code\",\"error_msg\":\"$context.error.message\",\"request_id\":\"$context.requestId\"}",
      "default" : true,
      "status" : 500
    }
  }
}

状态码: 400

Bad Request

{
  "error_code" : "APIG.2011",
  "error_msg" : "Invalid parameter value,parameterName:name. Please refer to the support documentation"
}

状态码: 401

Unauthorized

{
  "error_code" : "APIG.1002",
  "error_msg" : "Incorrect token or token resolution failed"
}

状态码: 403

Forbidden

{
  "error_code" : "APIG.1005",
  "error_msg" : "No permissions to request this method"
}

状态码: 404

Not Found

{
  "error_code" : "APIG.3001",
  "error_msg" : "API group c77f5e81d9cb4424bf704ef2b0ac7600 does not exist"
}

状态码: 500

Internal Server Error

{
  "error_code" : "APIG.9999",
  "error_msg" : "System error"
}
support.huaweicloud.com/api-apig/UpdateGatewayResponseV2.html