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
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Query Parameters
debug
optional
Virtus::Attribute::Boolean
Response
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John",
"lastname": "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": {
},
"password": "",
"classification_ids": [
1,
2,
3
]
}

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
Request
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
JSON
Response
200: OK
{
"total": 1,
"page": 1,
"records": [
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John",
"lastname": "Doe",
"last_sign_in_at": "2018-01-24 10:55:35",
"created_at": "2018-01-24 10:55:35",
"devices": [
"android",
"apple"
],
"confirmed": true,
"classification_ids": [
1,
2,
3
]
}
]
}

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
Request
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
Response
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John",
"lastname": "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": {
},
"password": "",
"classification_ids": [
1,
2,
3
]
}

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
Request
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 First Name
lastname
optional
String
Reader 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
classification_ids
optional
Array
Reader Classification IDs
Response
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John",
"lastname": "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": {
},
"password": "",
"classification_ids": [
1,
2,
3
]
}

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
Request
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 First Name
lastname
optional
String
Reader Last Name
email
optional
String
Reader Email Address
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
classification_ids
optional
Array
Reader Classification IDs
Response
200: OK
{
"id": 1234,
"email": "john.doe@magloft.com",
"name": "John",
"lastname": "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": {
},
"password": "",
"classification_ids": [
1,
2,
3
]
}

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
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Reader ID
Response
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
Request
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
Response
200: OK
{
}

post
Unlock Issue By Coupon

https://www.magloft.com/api/portal/v1/readers/:app_id/:id/unlock/coupon
This endpoint unlock one issue by coupon and returns a list of issue purchases
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Reader ID
Body Parameters
issue_id
required
Integer
article_id
required
Integer
code
required
String
Response
200: OK
{
}

get
Export readers

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