Users

Authorize User

POST /v1/auth

Params

Param name Description
session (required) Validations: Must be a Hash
session[email] (required) Validations: Must be a String
session[password] (required) Validations: Must be a String

Headers

Header name Description
AUTHORIZATION (required) application_id application_uid, client_secret application_secret

 Errors

Code Description Metadata
400 fail: 'Can not authorize user' :message: 'fail: ''Error description'''

Register a User

POST /v1/users

Params

Param name Description
user (required) Validations: Must be a Hash
user[email] (required) Validations: Must be a String
user[username] (required) Validations: Must be a String
user[password] (required) Validations: Must be a String

Headers

Header name Description
AUTHORIZATION (required) application_id application_uid, client_secret application_secret

Errors

Code Description Metadata
400 fail: 'Can not authorize user' :message: 'fail: ''Error description'''

Get Current User

GET /v1/user

Headers

Header name Description
AUTHORIZATION (required) Bearer access_token

Errors

Code Description Metadata
400 fail: 'Can not authorize user' :message: 'fail: ''Error description'''

Update Current User

PUT /v1/user

user (required)   Validations: Must be a Hash
user[email] (required)   Validations: Must be a String
user[username] (optional )   Validations: Must be a String
user[profile_attributes] (optional)   Validations: Must be a Hash
user[profile_attributes][id] (required)   Validations: Must be Integer.
user[profile_attributes][first_name] (optional)   Validations: Must be a String
user[profile_attributes][last_name] (optional)   Validations: Must be a String
user[profile_attributes][current_password] (optional)   Validations: Must be a String
user[profile_attributes][password] (optional)   Validations: Must be a String
user[profile_attributes][password_confirmation] (optional)   Validations: Must be a String
user[profile_attributes][sex] (optional)   Validations: Must be one of: male, female.
user[profile_attributes][birth_date] (optional) Birthday of user Validations: Must be a Date
user[profile_attributes][***] (optional) Any custom field Validations: Must be a String
user[profile_attributes][avatar_attributes] (optional)   Validations: Must be a Hash
user[profile_attributes][avatar_attributes][file] (optional) Postfield file Validations: Must be a File
user[profile_attributes][avatar_attributes][base64] (optional) Encoded Base64 string Validations: Must be a String
user[profile_attributes][current_age] (optional) Age of user that will be converted to Date [Date.today - current_age.year - 1.day] Validations: Must be Integer
user[user_preferences_attributes] (optional )   Validations: Must be an Array of nested elements
user[user_preferences_attributes][id] (required)   Validations:Must be Integer.
user[user_preferences_attributes][preferences] (required)   Validations: Must be a Hash

Headers

Header name Description
AUTHORIZATION (required) Bearer access_token

Errors

Code Description Metadata
400 fail: 'Can not authorize user' :message: 'fail: ''Error description'''

Confirm User

POST /v1/users/:id/confirm

Headers

Header name Description
confirmation_token (required) Validations: Must be a String

Errors

Code Description Metadata
400 fail: 'Can not authorize user' :message: 'fail: ''Error description'''

Example Response

"user": {
    "id": 94,
    "email": "[email protected]",
    "username": "brennaheathcote-44",
    "user_preferences": [
    
    ],
    "is_me": true,
    "roles": {
    },
    "scores": 0,
    "profile": {
        "id": null,
        "first_name": "Gavin",
        "last_name": "Dickens",
        "birth_date": "1976-04-02",
        "sex": "male",
        "time_zone": null,
        "avatar_url": "/attachments/fdd84bc96d7003bec5ab985bdb0ff5e5925d65b1/cache/6524d86fca715bac893cf97436e17b6260d6d5d395587bab654082ee7481/logo.png"
    },
    "organisations": [
        {
        "id": 43,
        "name": "Howe Group",
        "logo_url": "/attachments/fdd84bc96d7003bec5ab985bdb0ff5e5925d65b1/cache/6524d86fca715bac893cf97436e17b6260d6d5d395587bab654082ee7481/logo.png",
        "logo_properties": {
            "color": "#3d8bc0"
        },
        "current_user_roles": [
    
        ]
        }
    ],
    "teams": [
        {
        "id": 95,
        "name": "Gaylord, Okuneva and Gerhold",
        "is_owner": false,
        "current_user_roles": [
    
        ]
        }
    ]
    }, 
    "access_token": "b157ba5f5f953d760f5668edecdea166"

Confirm User with indicated id

PUT /v1/users/confirm_user/:id

Headers

Header name Description
AUTHORIZATION (required) Bearer access_token

Errors

Code Description Metadata
400 fail: 'Can not authorize user' :message: 'fail: ''Error description'''

Example Response

{
"message": "User with id: 48 was successfully confirmed"
}

Questions or comments about this page?

Add a Topic