Users API

Field descriptions

Field Type Description
id integer The uniq identifier of the user
email string Email of the user
firstname string Firstname of the user
lastname string Lastname of the user

List users

List the SSO authenticated user’s users

GET /users

Response

Status: 200 OK
[
  {
    "id": 12345678,
    "email": "do_not_reply@place2book.com",
    "firstname": "John",
    "lastname": "Doe"
  }
]

Get a single user

GET /users/:id

Response

Status: 200 OK
{
  "id": 12345678,
  "email": "do_not_reply@place2book.com",
  "firstname": "John",
  "lastname": "Doe"
}

Error codes

Status: 404 Not Found

Create an user

POST /user

If a user with the the same email already exists, the create will be ignored. A new user will not receive an invite mail, and can user SSO login from the beginning. A new user will get a random password, and can therefore not login through place2book.com. The user can select the “forgot password” link, and set a new password if the user wish to enable username/password login.

Input

email
Required string
firstname
Optional string
lastname
Optional string
{
  "user": {
    "email": "Email for the user",
    "firstname": "Firstname of the user",
    "lastname": "Lastname of the user"
  }
}

Response

Status: 201 Created
Location: https://api.place2book.com/users/1234567
{
  "id": 12345678,
  "email": "do_not_reply@place2book.com",
  "firstname": "John",
  "lastname": "Doe"
}

Error codes

Status: 400 Bad Request
Status: 500 Server Error

Update an users

PUT /users/:id

Input

firstname
Optional string
lastname
Optional string
{
  "user": {
    "firstname": "Firstname of the user",
    "lastname": "Lastname of the user"
  }
}

It is at present not possible to change a user email.

Response

Status: 200 OK
{
  "id": 12345678,
  "email": "do_not_reply@place2book.com",
  "firstname": "John",
  "lastname": "Doe"
}

Error codes

Status: 404 Not Found
Status: 500 Server Error

Delete an user

DELETE /users/:id

Notice that the user wont be fully deleted. All of the users permissions will be removed, and SSO credentials and relation removed. Should the user have access to event makers outsideof the SSO the user will still be able to login with email/password and access non SSO event makers.

Response

Status: 204 No Content

Error codes

Status: 403 Forbidden
Status: 404 Not Found