How to set the user name for a user #
Set the user name for the user. This function is used to set a user name for a user, and only works if the application supports user names.
An application can test whether a user name is available using the function userNameAvailable
.
The userName is the user name that is being set
This function will fail if the application does not support user names and return a 606.
URL #
/api/appuser/setUserName
Method #
POST
Headers #
access-token: "<Access Token>"
Data Parameter #
{
userName: "user name"
}
Response: #
Success: #
StatusCode: #
200 (OK)
Contents: #
true
Error: #
StatusCode: #
400 (BAD REQUEST)
500 (INTERNAL SERVER ERROR)
Content: #
{
code: "<internal error code>",
message: "<readable error description>"
}
The internal codes are integers:
- 401 - app no longer exists
- 402 - app is suspended
- 403 - missing parameter
- 404 - user account is suspended
- 405 - invalid access token
- 413 - app is migrated
- 500 - internal server error
- 601 - user already registered
- 602 - invalid data
- 606 - app does not support user names