Readers

API for managing app readers

get
List Readers

https://www.magloft.com/api/portal/v1/readers/:app_id
This endpoint returns a list of all readers that belong to the magazine
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Headers
X-Magloft-Accesstoken
required
string
User Access Token
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John Doe",
"last_sign_in_at": "2018-01-24 10:55:35",
"created_at": "2018-01-24 10:55:35",
"devices": [
"android",
"apple"
],
"confirmed": true,
"authentication_token": "aabbccddeeff00112233445566778899",
"custom_data": {
}
}

get
Retrieve paginated list of readers

https://www.magloft.com/api/portal/v1/readers/:app_id/page/:page
This endpoint returns a page list of all readers that belong to the magazine
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
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
200: OK
{
"total": 1,
"page": 1,
"records": [
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John Doe",
"last_sign_in_at": "2018-01-24 10:55:35",
"created_at": "2018-01-24 10:55:35",
"devices": [
"android",
"apple"
],
"confirmed": true,
"authentication_token": "aabbccddeeff00112233445566778899",
"custom_data": {
}
}
]
}

get
Get Reader

https://www.magloft.com/api/portal/v1/readers/:app_id/(:email)(:id)
This endpoint returns a specific reader by id
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
email
optional
String
Reader Email Address
id
optional
Integer
Reader ID
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John Doe",
"last_sign_in_at": "2018-01-24 10:55:35",
"created_at": "2018-01-24 10:55:35",
"devices": [
"android",
"apple"
],
"confirmed": true,
"authentication_token": "aabbccddeeff00112233445566778899",
"custom_data": {
}
}

post
Create a Reader

https://www.magloft.com/api/portal/v1/readers/:app_id
This endpoint creates a new reader and returns the saved reader
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Body Parameters
email
required
String
Reader Email Address
password
optional
String
Reader Password
name
optional
String
Reader Full Name (first name and last name)
custom_data
optional
Hash
Custom key-value data stored for this reader
confirmation
optional
Virtus::Attribute::Boolean
Send Confirmation Email
confirmed
optional
Virtus::Attribute::Boolean
Whether this readers' Email was confirmed
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John Doe",
"last_sign_in_at": "2018-01-24 10:55:35",
"created_at": "2018-01-24 10:55:35",
"devices": [
"android",
"apple"
],
"confirmed": true,
"authentication_token": "aabbccddeeff00112233445566778899",
"custom_data": {
}
}

put
Update a Reader

https://www.magloft.com/api/portal/v1/readers/:app_id/:id
This endpoint updates a specific reader by id and returns the updated reader
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Reader ID
Body Parameters
name
optional
String
Reader Full Name (first name and last name)
custom_data
optional
Hash
Custom key-value data stored for this reader
password
optional
String
Reader Password
confirmed
optional
Virtus::Attribute::Boolean
Whether this readers' Email was confirmed
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John Doe",
"last_sign_in_at": "2018-01-24 10:55:35",
"created_at": "2018-01-24 10:55:35",
"devices": [
"android",
"apple"
],
"confirmed": true,
"authentication_token": "aabbccddeeff00112233445566778899",
"custom_data": {
}
}

delete
Delete Reader

https://www.magloft.com/api/portal/v1/readers/:app_id/:id
This endpoint deletes a specific reader by id and returns an empty response with status 204
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Reader ID
200: OK
null

post
Create Issue Purchases

https://www.magloft.com/api/portal/v1/readers/:app_id/:id/unlock
This endpoint creates one or many issue purchases by product_id and returns a list of issue purchases
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Reader ID
Body Parameters
product_ids
required
Array
Array containing Issue Product IDs to unlock
order_id
optional
String
Subscription Order ID
200: OK
{
}

get
Export readers

https://www.magloft.com/api/portal/v1/readers/:app_id/export.csv
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
200: OK
null