Categories

API for managing Categories

get
List Categories

https://www.magloft.com/api/portal/v1/categories/:app_id
This endpoint returns a list of all categories that belong to the publication
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Response
200: OK
{
"id": 1234,
"title": "Business",
"color": "#444444",
"position": 0
}

get
Get Category

https://www.magloft.com/api/portal/v1/categories/:app_id/:id
This endpoint returns a specific category by id
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Category ID
Response
200: OK
{
"id": 1234,
"title": "Business",
"color": "#444444",
"position": 0
}

post
Sort Categories

https://www.magloft.com/api/portal/v1/categories/:app_id/sort
This endpoint sorts all categories by position 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.
Body Parameters
positions
required
Array
positions[id]
required
Integer
positions[position]
required
Integer
Response
204: No Content
null

post
Create Category

https://www.magloft.com/api/portal/v1/categories/:app_id
This endpoint creates a new category and returns the saved category
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
Body Parameters
title
optional
String
Title of a category
color
optional
String
Hex color of a category
Response
200: OK
{
"id": 1234,
"title": "Business",
"color": "#444444",
"position": 0
}

put
Update Category

https://www.magloft.com/api/portal/v1/categories/:app_id/:id
This endpoint updates a specific category by id and returns the updated category
Request
Response
Request
Path Parameters
app_id
required
String
App ID (Publication) to scope this request for.
id
required
Integer
Category ID
Body Parameters
title
optional
String
Title of a category
color
optional
String
Hex color of a category
Response
200: OK
{
"id": 1234,
"title": "Business",
"color": "#444444",
"position": 0
}

delete
Delete Category

https://www.magloft.com/api/portal/v1/categories/:app_id/:id
This endpoint deletes a specific category 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
Category ID
Response
204: No Content
null