Clients

API for managing Clients (Sub-User Accounts)

List Clients

GET https://www.magloft.com/api/portal/v1/clients/

This endpoint returns a list of clients

{
  "total": 1,
  "page": 1,
  "records": [
    {
      "id": 1234,
      "firstname": "Amelia",
      "lastname": "Earhart",
      "email": "user@magloft.com",
      "created_at": "2018-01-24 10:55:35",
      "updated_at": "2018-01-24 10:55:35",
      "last_seen_at": "2018-01-24 10:55:35",
      "sign_in_count": 6,
      "gravatar_url": "//secure.gravatar.com/avatar/123456789987654321",
      "roles": [
        {
          "id": 1234,
          "user_id": 1211,
          "publication_id": 123,
          "access_level": "author",
          "created_at": "2018-01-24 10:55:35",
          "updated_at": "2018-01-24 10:55:35"
        }
      ]
    }
  ]
}

Retrieve paginated list of clients

GET https://www.magloft.com/api/portal/v1/clients/page/:page

This endpoint returns a page list of all clients

Path Parameters

NameTypeDescription

page

Integer

The page number to list

Query Parameters

NameTypeDescription

per_page

Integer

Number of items to show per page

order_by

Symbol

Field to sort results by

order_dir

Symbol

Direction (asc, desc) to sort results by

filter

String

Text filter to search results by

publication_id

Integer

Filter by publications ID

{
  "total": 1,
  "page": 1,
  "records": [
    {
      "id": 1234,
      "firstname": "Amelia",
      "lastname": "Earhart",
      "email": "user@magloft.com",
      "created_at": "2018-01-24 10:55:35",
      "updated_at": "2018-01-24 10:55:35",
      "last_seen_at": "2018-01-24 10:55:35",
      "sign_in_count": 6,
      "gravatar_url": "//secure.gravatar.com/avatar/123456789987654321",
      "roles": [
        {
          "id": 1234,
          "user_id": 1211,
          "publication_id": 123,
          "access_level": "author",
          "created_at": "2018-01-24 10:55:35",
          "updated_at": "2018-01-24 10:55:35"
        }
      ]
    }
  ]
}

GET Client

GET https://www.magloft.com/api/portal/v1/clients/:id

This endpoint returns a specific client by id

Path Parameters

NameTypeDescription

id

Integer

Client ID

{
  "id": 1234,
  "firstname": "Amelia",
  "lastname": "Earhart",
  "email": "user@magloft.com",
  "created_at": "2018-01-24 10:55:35",
  "updated_at": "2018-01-24 10:55:35",
  "last_seen_at": "2018-01-24 10:55:35",
  "sign_in_count": 6,
  "gravatar_url": "//secure.gravatar.com/avatar/123456789987654321",
  "roles": [
    {
      "id": 1234,
      "user_id": 1211,
      "publication_id": 123,
      "access_level": "author",
      "created_at": "2018-01-24 10:55:35",
      "updated_at": "2018-01-24 10:55:35"
    }
  ]
}

Create new client

POST https://www.magloft.com/api/portal/v1/clients/

This endpoint creates a new client and returns the saved client

Request Body

NameTypeDescription

email

String

Client email address

firstname

String

Client Firstname

lastname

String

Client Lastname

password

String

Client Password

{
  "id": 1234,
  "firstname": "Amelia",
  "lastname": "Earhart",
  "email": "user@magloft.com",
  "created_at": "2018-01-24 10:55:35",
  "updated_at": "2018-01-24 10:55:35",
  "last_seen_at": "2018-01-24 10:55:35",
  "sign_in_count": 6,
  "gravatar_url": "//secure.gravatar.com/avatar/123456789987654321",
  "roles": [
    {
      "id": 1234,
      "user_id": 1211,
      "publication_id": 123,
      "access_level": "author",
      "created_at": "2018-01-24 10:55:35",
      "updated_at": "2018-01-24 10:55:35"
    }
  ]
}

Update Client

PUT https://www.magloft.com/api/portal/v1/clients/:id

This endpoint updates a specific client by id and returns the updated client

Path Parameters

NameTypeDescription

id

Integer

Client ID

Request Body

NameTypeDescription

firstname

String

Client Firstname

lastname

String

Client Lastname

password

String

Client Password

password_confirmation

String

Client Password Confirmation

null

Delete Client

DELETE https://www.magloft.com/api/portal/v1/clients/:id

This endpoint deletes a specific client by id and returns an empty response with status 204

Path Parameters

NameTypeDescription

id

Integer

Client ID

null

Become Client

GET https://www.magloft.com/api/portal/v1/clients/:id/become

This endpoint logs in as a client by id and returns the new client user

Path Parameters

NameTypeDescription

id

Integer

Client ID

null

Last updated