A verified admin is able to create a new page.
{info} Only an admin can create pages
Method | Uri | Auth | Role |
---|---|---|---|
POST |
/v1/pages |
Bearer JWT-Token |
admin |
{
"Accept": "application/json",
"Content-Type": "multipart/form-data",
"Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3M..."
}
[{
"title": "This is an asset",
"slug": "unique:pages,slug",
"description": "string",
"blocks": "array:json",
"groups": ["array","exists:groups,id"]
}]
Condition : User must be an admin
.
Code : 201 Created
Content example : Response will reflect back the created page.
{
"id": "701f0a37-d462-453c-9eea-3a1ab8a4cc15",
"parent_id": null,
"order": 0,
"title": "Huisstijl Doc",
"slug": "huisstijl-doc",
"is_static": false,
"description": "Hello World",
"updated_at": "2020-08-27T11:58:46.000000Z",
"published_at": null,
"blocks": [
{
"type": "text",
"title": "Inzet logo's",
"subtitle": "Plaatsing op donkere achtergrond",
"body": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum has been the industry 's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"slug": "inzet-logos-plaatsing",
"button": {
"label": "Verzenden",
"url": "https:\/\/www.zuyderland.nl",
"target": "_self",
"icon": {
"value": "material-submit",
"direction": "right"
}
},
"groups": []
},
{
"type": "text",
"title": "Inzet logo's",
"subtitle": "Plaatsing op donkere achtergrond",
"body": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum has been the industry 's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"slug": "inzet-logos-plaatsing",
"button": {
"label": "Verzenden",
"url": "https:\/\/www.zuyderland.nl",
"target": "_self",
"icon": {
"value": "material-submit",
"direction": "right"
}
},
"groups": []
},
{
"type": "text",
"title": "Inzet logo's",
"subtitle": "Plaatsing op donkere achtergrond",
"body": "Lorem Ipsum is simply dummy text of the printing and typesetting industry.Lorem Ipsum has been the industry 's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
"slug": "inzet-logos-plaatsing",
"button": {
"label": "Verzenden",
"url": "https:\/\/www.zuyderland.nl",
"target": "_self",
"icon": {
"value": "material-submit",
"direction": "right"
}
},
"groups": []
}
],
"groups": []
}
Condition : If the current user does not have the role admin
attached.
Code : 403 Forbidden
Content example :
{
"message": "User does not have the right permissions."
}
Condition : If the current user is not logged in
Code : 401 Unauthorized
Content example :
{
"message": "Je moet zijn ingelogd om dit te kunnen doen.",
"errors": [
"Unauthenticated."
]
}