Voog.com

Site users

Summary of site users endpoints

List all site users for the current site

GET /admin/api/site_users

The request return all site users (users who can login and see password protected pages).

Example response:

Status: 200 OK
[
  {
    "id": 1,
    "email": "test@test.ee",
    "status": "active",
    "created_at": "2014-11-05T07:45:02.000Z",
    "updated_at": "2014-11-05T07:49:16.000Z",
    "last_login_at": "2014-11-05T07:49:16.000Z",
    "url": "http://helloworld.voog.co/admin/api/site_users/1"
  },
  {
    "id": 2,
    "email": "test2@test.ee",
    "status": "created",
    "created_at": "2014-11-05T07:52:55.000Z",
    "updated_at": "2014-11-05T07:52:55.000Z",
    "last_login_at": null,
    "url": "http://helloworld.voog.co/admin/api/site_users/2"
  }
]

Parameters

  • per_page - elements per response (default: 50; maximum: 250).
  • page - requested page (default: 1).

Filter attributes

Read more about filters.

  • Object site_user attributes: id, email, status, created_at, updated_at, last_login_at.

Create a new site user for the current site

POST /admin/api/site_users

This request adds a new site user with status created to current site and sends a email with activation token to user.

After user has been activated via activation link then user can access to all password protected pages of the current site.

Example data:

{
  "email": "jon@test.com",
  "page_id": 3
}

Example response:

Status: 201 Created
{
 "id": 3,
 "email": "mary@test.com",
 "status": "created",
 "updated_at": "2014-11-05T09:03:19.280Z",
 "created_at": "2014-11-05T09:03:19.280Z",
 "last_login_at": null,
 "url": "http://helloworld.voog.co/admin/api/site_users/8"
}

Parameters

Required parameters:

Optional parameters:

  • page_id - page id of some password protected page. If present then it's name is added to invitation email.

Get data for a single site user

GET /admin/api/site_users/1

Example request:

GET http://helloworld.voog.co/admin/api/site_users/1

Example response:

Status: 200 OK
{
  "id": 1,
  "email": "test@test.ee",
  "status": "active",
  "created_at": "2014-11-05T07:45:02.000Z",
  "updated_at": "2014-11-05T07:49:16.000Z",
  "last_login_at": "2014-11-05T07:49:16.000Z",
  "url": "http://helloworld.voog.co/admin/api/site_users/1"
}

Remove a site user

DELETE /admin/api/site_users/1

This request deletes the site user from the database.

Example request:

DELETE http://helloworld.voog.co/admin/api/site_users/3

Example response:

Status: 204 No Content