Clients

API for managing Clients (Sub-User Accounts)

get
List Clients

https://www.magloft.com/api/portal/v1/clients/
This endpoint returns a list of clients
Request
Response
Request
‚Äč
Response
200: OK
{
"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
Retrieve paginated list of clients

https://www.magloft.com/api/portal/v1/clients/page/:page
This endpoint returns a page list of all clients
Request
Response
Request
Path Parameters
page
required
Integer
The page number to list
Query Parameters
per_page
optional
Integer
Number of items to show per page
order_by
optional
Symbol
Field to sort results by
order_dir
optional
Symbol
Direction (asc, desc) to sort results by
filter
optional
String
Text filter to search results by
publication_id
optional
Integer
Filter by publications ID
Response
200: OK
{
"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
GET Client

https://www.magloft.com/api/portal/v1/clients/:id
This endpoint returns a specific client by id
Request
Response
Request
Path Parameters
id
required
Integer
Client ID
Response
200: OK
{
"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"
}
]
}

post
Create new client

https://www.magloft.com/api/portal/v1/clients/
This endpoint creates a new client and returns the saved client
Request
Response
Request
Body Parameters
email
required
String
Client email address
firstname
required
String
Client Firstname
lastname
optional
String
Client Lastname
password
required
String
Client Password
Response
200: OK
{
"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"
}
]
}

put
Update Client

https://www.magloft.com/api/portal/v1/clients/:id
This endpoint updates a specific client by id and returns the updated client
Request
Response
Request
Path Parameters
id
required
Integer
Client ID
Body Parameters
firstname
optional
String
Client Firstname
lastname
optional
String
Client Lastname
password
optional
String
Client Password
password_confirmation
optional
String
Client Password Confirmation
Response
200: OK
null

delete
Delete Client

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
Request
Response
Request
Path Parameters
id
required
Integer
Client ID
Response
200: OK
null