Articles

API for managing articles

List Articles

GET https://www.magloft.com/api/portal/v1/articles/:app_id

This endpoint returns a list of all articles that belong to the magazine

Path Parameters

NameTypeDescription

app_id

String

App ID (Publication) to scope this request for.

Query Parameters

NameTypeDescription

order_by

Symbol

Field to sort results by

order_dir

Symbol

Direction (asc, desc) to sort results by

issue_id

Integer

{
  "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
}

Retrieve paginated list of articles

GET 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

Path Parameters

NameTypeDescription

app_id

String

App ID (Publication) to scope this request for.

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

{
  "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 Article

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

This endpoint returns a specific article by id

Path Parameters

NameTypeDescription

app_id

String

App ID (Publication) to scope this request for.

id

Integer

Article ID

{
  "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
}

Create an Article

POST https://www.magloft.com/api/portal/v1/articles/:app_id

This endpoint creates a new article and returns the saved article

Path Parameters

NameTypeDescription

app_id

String

App ID (Publication) to scope this request for.

Request Body

NameTypeDescription

title

String

Article Title

info

String

Article Description

html

String

Article HTML

date

String

Article Publish Date

cover

String

Article Cover

category_ids

Array

Article category IDs

issue_id

Integer

Issue ID

unlock_type

String

Unlock Type

position

Integer

Order Position of the Article within an Issue

source

String

Article type

{
  "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
}

Update an Article

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

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

Path Parameters

NameTypeDescription

app_id

String

App ID (Publication) to scope this request for.

id

Integer

Article ID

Request Body

NameTypeDescription

title

String

Article Title

info

String

Article Description

html

String

Article HTML

assets

Hash

Article Assets

date

String

Article publish date

cover

String

Article Cover

category_ids

Array

Article category IDs

issue_id

Integer

Issue ID

unlock_type

String

Unlock Type

position

Integer

Order Position of the Article within an Issue

visible

Virtus::Attribute::Boolean

A boolean indicating whether this article is visible

{
  "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 Article

DELETE 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

Path Parameters

NameTypeDescription

app_id

String

App ID (Publication) to scope this request for.

id

Integer

Article ID

null

FlexPDF Import

POST https://www.magloft.com/api/portal/v1/articles/:app_id/flexpdf-import

This endpoint creates multiple article and returns

Path Parameters

NameTypeDescription

app_id

String

App ID (Publication) to scope this request for.

Request Body

NameTypeDescription

articles

Array

articles[title]

String

Article Title

articles[html]

String

Article HTML

articles[cover]

String

Article Cover

articles[issue_id]

Integer

Issue ID

articles[unlock_type]

String

Unlock Type

articles[position]

Integer

Order Position of the Article within an Issue

articles[source]

String

Article type

null

Last updated