Votta API reference

« back to overview

Sessions [1.0]

index

List all the sessions for the current user.

URL

GET /sessions

Response Object

Examples

Request (with authentication header) Response
{
  "sessions": [
    {"id": 3, "comment": "my Mac"},
    {"id": 5, "comment": "my iPhone"}
  ]
}

create

Log in as a registered user.

URL

POST /sessions

Required Parameters

  • email String
  • password String

    Plaintext password

Optional Parameters

  • session[comment] String

    comment to identify the session

Response Object

  • a token

Examples

Request
email=registered_user@example.com
password=p1aint3xt-pa55w0rd
session[comment]=foo bar
Response
{
  "token": "abc"
}

update

Update the information of the session.

URL

PATCH /sessions/:id

Optional Parameters

  • comment String

    Comment of the session.

Response Object

Examples

Request
session[comment]=my iMac
Response
{
  "id": 5,
  "comment": "my iMac"
}

destroy

Log out the session.

URL

DELETE /sessions/:id