Response to server-side API requests: 401: Unauthorized

Yêu cầu thất bại do thiếu hoặc sai thông tin xác thực. Xem trang Xác thực, đặc biệt chú ý đến Authorization header.

Yêu cầu cũng thất bại vì không tìm thấy hồ sơ người dùng được chỉ định.

Body

Tham sốKiểuMô tả
errorsObject
  • source: (string) Luôn là non_field_errors.
  • errors: Mô tả lỗi.
error_codeStringTên lỗi ngắn gọn. Luôn là not_authenticated.
status_codeIntegerHTTP status. Luôn là 401.

Ví dụ phản hồi

{
  "errors": [
    {
      "source": "non_field_errors",
      "errors": [
        "Authentication credentials were not provided."
      ]
    }
  ],
  "error_code": "not_authenticated",
  "status_code": 401
}