Set Locale

How to set a user’s locale through the Cosync REST API #

Set the locale of the user. The locale parameter is a two letter string that corresponds to locales that are supported by the ISO 631-1 codes that are described here ISO 639-1 codes.

URL #
    /api/appuser/setPhone
Method #
    POST
Headers #
    access-token: "<Access Token>"
Data Parameter #
    {
        locale: "<user locale>",
    }

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
  • 602 - invalid data
  • 609 - invalid locale