register login

Description

Creates a new logged in session for this user, obtaining an access token.

URL

/VERSION/users/login.FORMAT

Available Format

JSON

HTTP Method

POST

Accepted Version

1

Require

api_key

Headers

Not applicable.

Parameters

  • api_key: (Required) client id that performs this request.
  • username: (Required) user username or email.
  • pwd: (Required) user account password.
  • expiresin: (Optional) seconds from now until the new accreditation will be accessible. Default value (undefined) results in a permanent accreditation.

Example

https://api.topoos.com/1/users/login.json

curl -X POST -F "api_key=a5e7bce0-0ac8-4dcc-8337-f7a3b8b30432" -F "username=johndoe" -F "pwd=johnpass"

Reply

JSON example reply when request success

{
    "id": "c0770734-cb78-44cd-a8c2-5738ceef418e",
    "name": "johndoe",
    "email": "john@doe.com",
    "email_verified": true,
    "register": "2014-07-23T11:36:31.500+02:00",
    "provider": null,
    "profile": {
        "birthday": "1997-07-16T10:30:15.343+02:00",
        "gender": "MALE"
    },
    "ugroup": [],
    "accreditation": {
        "expirationtime": null,
        "client_id": "a5e7bca0-0ac8-4dcc-8337-f7a3b8b30433",
        "access_token": "efbece3a-f7fe-448a-8d1c-085df98153a2",
        "refresh_token": null,
        "visibledevices": [
            {
                "id": 7679,
                "name": "a5e7bce0-2a38-4dcc-8337-f7a3b8b30433",
                "model": 3,
                "islogical": true
            }
        ]
    }
}

JSON Response when request error is returned

{
    "code": 405,
    "description": "EXCEPTION_METHOD_NOT_ALLOWED"
}