App Pages

API for managing In-App Pages

get
List App Pages

https://www.magloft.com/api/portal/v1/app_pages/:app_id/page/:page
This endpoint returns a list of all app pages that belong to the magazine
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
page
optional
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,
"name": "Welcome Letter",
"title": "Welcome to MagLoft",
"icon": "trophy",
"trigger": "on_launch",
"action": "subscribe",
"visibility": [
"web",
"ios",
"android"
],
"created_at": "2018-01-24 10:55:35",
"updated_at": "2018-01-24 10:55:35",
"published": true,
"html": "<p>Hello World</p>"
}
]
}

get
Get App Page

https://www.magloft.com/api/portal/v1/app_pages/:app_id/:id
This endpoint returns a specific app page by id
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
App Page ID
200: OK
{
"id": 1234,
"name": "Welcome Letter",
"title": "Welcome to MagLoft",
"icon": "trophy",
"trigger": "on_launch",
"action": "subscribe",
"visibility": [
"web",
"ios",
"android"
],
"created_at": "2018-01-24 10:55:35",
"updated_at": "2018-01-24 10:55:35",
"published": true,
"html": "<p>Hello World</p>"
}

post
Create App Page

https://www.magloft.com/api/portal/v1/app_pages/:app_id
This endpoint creates a new app page and returns the saved app page
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Body Parameters
name
required
String
Internal name of a page
title
optional
String
Visible title of a page
icon
optional
String
Optional icon to show in the modal window or side menu
trigger
optional
String
Trigger Event to specify when the page should show up
action
optional
String
Call to action to perform when accepting the offer
html
optional
String
The html contents of a page
visibility
optional
Array
An array specifying on which devices the page should be shown (web, ios, android)
200: OK
{
"id": 1234,
"name": "Welcome Letter",
"title": "Welcome to MagLoft",
"icon": "trophy",
"trigger": "on_launch",
"action": "subscribe",
"visibility": [
"web",
"ios",
"android"
],
"created_at": "2018-01-24 10:55:35",
"updated_at": "2018-01-24 10:55:35",
"published": true,
"html": "<p>Hello World</p>"
}

put
Update App Page

https://www.magloft.com/api/portal/v1/app_pages/:app_id/:id
This endpoint updates a specific app page by id and returns the updated app page
Request
Response
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
App Page ID
Body Parameters
name
optional
String
Internal name of a page
title
optional
String
Visible title of a page
icon
optional
String
Optional icon to show in the modal window or side menu
trigger
optional
String
Trigger Event to specify when the page should show up
action
optional
String
Call to action to perform when accepting the offer
html
optional
String
The html contents of a page
visibility
optional
Array
An array specifying on which devices the page should be shown (web, ios, android)
200: OK
{
"id": 1234,
"name": "Welcome Letter",
"title": "Welcome to MagLoft",
"icon": "trophy",
"trigger": "on_launch",
"action": "subscribe",
"visibility": [
"web",
"ios",
"android"
],
"created_at": "2018-01-24 10:55:35",
"updated_at": "2018-01-24 10:55:35",
"published": true,
"html": "<p>Hello World</p>"
}

delete
Delete App Page

https://www.magloft.com/api/portal/v1/app_pages/:app_id/:id
This endpoint deletes a specific app page 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
App Page ID
204: No Content
null