Skip to content

Registration

Vadim Sokoltsov edited this page Nov 13, 2016 · 2 revisions

Registration

POST /api/v1/registrations

Create new user

Request parameters

  • email - type: string - user's email - requered
  • password - type: string - user's password - requered
  • password_confirmation - type: string - confirmation for user's password - requered
  • nick - type: string - nickname of user in system - requered
  • authorization - type: json - object with information about user's client

authorization object should include fields:

  • platform - information about client's OS
  • platform_version - version of client's OS
  • app_name - name of the client (browser version, mobile app name, etc.)
  • app_version - version of the client (browser version, mobile app name, etc.)
  • provider - default: UProgress - name of the application through which authorization has been completed

Errors

  • email - can't be blank, is invalid, email already taken
  • password - can't be blank, is too short (minimum is 6 characters)
  • password_confirmation - Password confirmation doesn't match Password
  • nick - can't be blank

Response

  • token - encrypted authorization token

Request example

{
  "user": {
    "email": <user email>,
    "password": <user password>,
    "password_confirmation": <user password confirmation>,
    "nick": <user nick>,
    "authorization": {
      "platform": "macOS",
      "platform_version": "10.11",
      "app": "Google Chrome",
      "app_version": "56.14.3",
      "provider": "UProgress"
    }
  }
}

Success response example

{
  "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTA0OX0.B0X5T35HnHJ_2AxoKp6CeiTTq2n_lcoHc5X7hNGdFo0"
}

Failed response example

{
  "errors": {
    "email": [
      " email already taken"
    ]
  }
}

Clone this wiki locally