Setting the admin password
Use the following API to login as the admin.
POST /rest/v10.04/login?username=admin
A new session is started and a response code268
is returned along with the message:"Session is restricted. Administrator password must be set before continuing."
NOTE:
This session is valid only to change the admin password and logout from the REST API UI. Any other request will return a禁用代码(403)
.
Use the following API to change the admin password. Ellipses (...) represent data not included in the example.
PUT /rest/v10.04/system/users/admin
{
...
“密码”:“<输入密码> "
...
}
After the password is changed successfully, the session restriction is removed.