用于客户信息更新的Magento2 CE REST API不用实际密码验证给定的密码,它接受所有内容。在web中,如果用户想要更改其帐户的电子邮件地址,Magento将询问密码并进行验证。如果我们提供了错误的密码,它将不允许我们更改密码。
Content-Type : application/json
Authorization: Bearer "customerToken"
Method: PUT <base_url>/rest/V1/customers/:customerID
Request:
{
"customer": {
"id": "45338",
"email": "test230720195@yopmail.com",
"firstname": "Updatetest",
"lastname": "Testing",
"websiteId": 1
},
"password": "qawsedrf!"
}
是否有其他API可以通过密码验证来更新客户信息?
提前使用-Thanks。
发布于 2018-08-08 15:57:04
要重置客户密码,您可以使用以下请求
Content-Type : application/json
Authorization: Bearer "authToken"
Method: PUT <base_url>/rest/V1/customers/me/password
Request:
{
"currentPassword": "string",
"newPassword": "string"
}
请注意,这里的auth token是您用来获取的值
/V1/integration/customer/token
对于您的问题中的请求,您应该使用来自
/V1/integration/admin/token
https://stackoverflow.com/questions/51682529
复制相似问题