Articles

API for managing articles

get
List Articles

https://www.magloft.com/api/portal/v1/articles/:app_id
This endpoint returns a list of all articles that belong to the magazine
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Query Parameters
order_by
optional
Symbol
Field to sort results by
order_dir
optional
Symbol
Direction (asc, desc) to sort results by
issue_id
optional
Integer
Response
200: OK
{
"id": 1234,
"title": "Welcome to MagLoft",
"info": null,
"html": null,
"assets": null,
"cover": null,
"date": null,
"unlock_type": "free",
"categories": [
"Sports",
"Business",
"Politics"
],
"category_ids": [
1,
2,
3
],
"publication_id": null,
"issue_id": null,
"position": null,
"visible": true,
"rss_feed_id": null,
"source": null
}

get
Retrieve paginated list of articles

https://www.magloft.com/api/portal/v1/articles/:app_id/page/:page
This endpoint returns a page list of all articles 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
String
Text filter to search results by
Response
200: OK
{
"total": 1,
"page": 1,
"records": [
{
"id": 1234,
"title": "Welcome to MagLoft",
"info": null,
"hpub": null,
"source_file": null,
"source": "typeloft",
"unlock_type": "free",
"hide_locked": false,
"categories": [
"Sports",
"Business",
"Politics"
],
"category_ids": [
1,
2,
3
],
"classifications": [
"Sports",
"Business",
"Politics"
],
"classification_ids": [
1,
2,
3
],
"product_id": "purchase.issue_123456789",
"product_id_apple": null,
"product_id_google": null,
"product_id_amazon": null,
"screen_type": "issue",
"publication_id": null,
"coupon_code": null,
"dirty": false,
"user_id": null,
"custom_stylesheet": null,
"custom_data": null,
"price_tier": null,
"cover": null,
"generator": "pdfix"
}
]
}

get
Get Article

https://www.magloft.com/api/portal/v1/articles/:app_id/:id
This endpoint returns a specific article by id
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Article ID
Response
200: OK
{
"id": 1234,
"title": "Welcome to MagLoft",
"info": null,
"html": null,
"assets": null,
"cover": null,
"date": null,
"unlock_type": "free",
"categories": [
"Sports",
"Business",
"Politics"
],
"category_ids": [
1,
2,
3
],
"publication_id": null,
"issue_id": null,
"position": null,
"visible": true,
"rss_feed_id": null,
"source": null
}

post
Create an Article

https://www.magloft.com/api/portal/v1/articles/:app_id
This endpoint creates a new article and returns the saved article
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Body Parameters
title
optional
String
Article Title
info
optional
String
Article Description
html
optional
String
Article HTML
date
optional
String
Article Publish Date
cover
optional
String
Article Cover
category_ids
optional
Array
Article category IDs
issue_id
optional
Integer
Issue ID
unlock_type
optional
String
Unlock Type
position
optional
Integer
Order Position of the Article within an Issue
source
optional
String
Article type
Response
200: OK
{
"id": 1234,
"title": "Welcome to MagLoft",
"info": null,
"html": null,
"assets": null,
"cover": null,
"date": null,
"unlock_type": "free",
"categories": [
"Sports",
"Business",
"Politics"
],
"category_ids": [
1,
2,
3
],
"publication_id": null,
"issue_id": null,
"position": null,
"visible": true,
"rss_feed_id": null,
"source": null
}

put
Update an Article

https://www.magloft.com/api/portal/v1/articles/:app_id/:id
This endpoint updates a specific article by id and returns the updated article
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
optional
Integer
Article ID
Body Parameters
title
optional
String
Article Title
info
optional
String
Article Description
html
optional
String
Article HTML
assets
optional
Hash
Article Assets
date
optional
String
Article publish date
cover
optional
String
Article Cover
category_ids
optional
Array
Article category IDs
issue_id
optional
Integer
Issue ID
unlock_type
optional
String
Unlock Type
position
optional
Integer
Order Position of the Article within an Issue
visible
optional
Virtus::Attribute::Boolean
A boolean indicating whether this article is visible
Response
200: OK
{
"id": 1234,
"title": "Welcome to MagLoft",
"info": null,
"html": null,
"assets": null,
"cover": null,
"date": null,
"unlock_type": "free",
"categories": [
"Sports",
"Business",
"Politics"
],
"category_ids": [
1,
2,
3
],
"publication_id": null,
"issue_id": null,
"position": null,
"visible": true,
"rss_feed_id": null,
"source": null
}

delete
Delete Article

https://www.magloft.com/api/portal/v1/articles/:app_id/:id
This endpoint deletes a specific article 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
Article ID
Response
200: OK
null

post
FlexPDF Import

https://www.magloft.com/api/portal/v1/articles/:app_id/flexpdf-import
This endpoint creates multiple article and returns
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Body Parameters
articles
required
Array
articles[title]
required
String
Article Title
articles[html]
required
String
Article HTML
articles[cover]
required
String
Article Cover
articles[issue_id]
required
Integer
Issue ID
articles[unlock_type]
required
String
Unlock Type
articles[position]
required
Integer
Order Position of the Article within an Issue
articles[source]
required
String
Article type
Response
200: OK
null