403 错误分为两类

1.错误信息为

The user cannot be altered by a client without the session.

表示用户没有登录,无法修改用户信息。

或错误信息为

Forbidden to write by class permissions. 或者 Forbidden to read by class permissions.,

表示想要修改的 class 表没有打开读或者写的权限。在数据管理平台,点击相应 class,在右侧选择「其他」菜单进入权限管理可以设置 class 权限。

2.Unauthorized 错误

表示应用 API 授权失败,请检查是否初始化了 App Id 和 App Key。

  • 如何初始化,请查看快速入门24
  • App Id 和 App key 在应用设置菜单里可以找到。

这个会是什么原因呢?
Request URL
https://leancloud.cn:443/1.1/requestSmsCode3
Response Body
{
"code": 119,
"error": "That operation isn't allowed for clients."
}
Response Code
403
Response Headers
{
"Server": "Tengine",
"Date": "Fri, 27 Mar 2015 03:44:29 GMT",
"Content-Type": "application/json;charset=utf-8",
"Content-Length": "64",
"Connection": "keep-alive",
"Cache-Control": "no-cache,no-store",
"Pragma": "no-cache"
}

解决了,在应用设置里面 启用了