Lock a page
This endpoint “locks” a page by setting its permissions to 444
.
This makes the page visible to everyone, but takes away write permissions from everyone
except for administrators (who always have access to everything). Note that this includes
the page’s owner, as well. Only an authenticated administrator can use this
endpoint. You can reverse the effects of this endpoint with the
PATCH /pages/{path}/unlock
endpoint.
Request
HTTP Header | Value |
---|---|
Authorization |
A valid JSON Web Token authenticating you as an administrator, of the form
Bearer ENCODEDHEADER.ENCODEDPAYLOAD.ENCODEDSIGNATURE . |
Path Parameter | Value |
---|---|
path |
The page you would like to lock. This parameter does not work like most path
parameters, in that you can use / characters as part of it. For example,
/v1/pages/animalia/chordata/mammalia will request the page with the path
/animalia/chordata/mammalia . |
Examples
Response
If you have not provided a valid JSON Web Token authenticating yourself as an administrator,
the API responds with a 401
HTTP status. If the API cannot find any page matching
the path provided, it responds with a 404
HTTP status. If you’ve
authenticated as an administrator and specified an existing page, though, the API sets that
page’s permissions to 444
and sends a 200
HTTP status with
a JSON object representing the page, reflecting the change.
Property | Value Type | Value |
---|---|---|
page |
object |
This property provides the Page object (see below) for the page requested. |
markup |
string |
This property provides the rendered HTML for the current body of the page. |
Property | Value Type | Value |
---|---|---|
id |
number |
The page’s unique numerical ID. |
title |
string |
The title of the page. |
description |
string |
The page’s description. It appears in the page’s header provided to search engines, social media, and other such bots and spiders. |
slug |
string |
A string used to create the page’s unique path. |
path |
string |
The unique path of this page on the Fifth World website. If you add https://thefifthworld.com
to the front of this string, you’ll have its URL. By default, we create this string by taking
the path of the page’s parent and appending a / and the page’s own slug to
it. |
parent |
number |
The unique numerical ID of this page’s parent page. If equal to 0 , that means that
this page does not have a parent. |
data |
object |
Any structured data associated with the current version fo the page. |
depth |
number |
How “deep” the page appears in the overall page hierarchy. A page that has no parent has a depth of 0. Such a page’s child would have a depth of 1, and if that page has a child, its depth will equal 2. If you wanted to trace the lineage of a page back to a “root” page that has no parents, this number tells you how many pages you will need to trace to get there. |
permissions |
object |
This object has three properties: read (a boolean that indicates if you have read
permission for this page, which should alwways equal true ), write
(a boolean that indicates if you have write permission for this page), and code .
This last three-digit code uses the same conventions as Unix permissions, with the owner
understood as the person who created the page, the group understood as authenticated
members of the Fifth World, and the world understood as the general public. Pages default
to 774 , meaning that any authenticated member of the Fifth World can edit them, and
anyone in the world can read them. A hidden page has a value of 700 , allowing its
owner to see and edit it, but no one else. A locked page has a value of 444 , allowing
anyone to see it, but only administrators to edit it. |
type |
string |
The page’s type. |
tags |
object |
An object that provides the key/value pairs of the page’s tags. |
location |
object or boolean |
If a page has a location associated with it (as pages of type Place should), this
property provides an object, which itself provides two properties, both numbers: lat
(which provides the location’s latitude) and lon (which provides the
location’s longitude). If a page does not have any location associated with it, this
property equals false . |
likes |
array |
This property provides an array of the unique member ID’s of everyone who has liked this page. |
files |
array |
This property provides an array of File objects (see below). |
owner |
object |
The page’s owner (the person who first created it). This object includes properties
id (the member’s unique numerical ID) and name (the string that
this member has provided for hens name). |
history |
array |
This property provides an array of Change objects (see below), providing the history of changes made to this page. |
lineage |
array |
This property includes an array of this page’s “ancestors,” so if this page has a parent, a Page object for that page will appear in this array, and if that page has a parent, a Page object for its parent will also appear in the array. The “root” page (the one that has no parent of its own) appears first, and the page’s direct parent comes last. If the page has no parent, then you will find an empty array here. |
Property | Value Type | Value |
---|---|---|
name |
string |
The unique key used to find the file on the CDN. |
thumbnail |
string |
The unique key used to find the file’s thumbnail on the CDN. Only images have thumbnails. |
mime |
string |
The MIME type of this file. |
size |
number |
The file’s size in bytes. |
readableSize |
string |
The file’s size, parsed into a human-readable string (e.g., if size equals
104,864, then readableSize will equal 104.9 kB). |
page |
number |
The unique numerical ID of the page this file belongs to. |
timestamp |
number |
When the uploader uploaded this file, presented as a Unix Epoch timestamp (the number of seconds since midnight on 1 January 1970 UTC). |
uploader |
number |
The unique numerical ID of the member who uploaded this file. |
urls |
object |
An object with two properties: full (providing the URL from which you can access the
full file on the CDN) and thumbnail (providing the URL from which you can access the
thumbnail on the CDN). Only images have thumbnails. |
Property | Value Type | Value |
---|---|---|
id |
number |
A unique numerical ID for this change. |
timestamp |
string |
The time when this change happened. |
msg |
string |
The commit message that the editor provided to explain the change and why hen made it. |
content |
object |
An object providing the content of the changes made. Many of these properties map to those in the
Page object, but they usually include the body property as well. This property includes
the unparsed wikitext of the page. When you view the page, the content displayed comes from the
body property of the most recent change made, parsed into HTML. |
editor |
object |
An object with two properties: id (the unique numerical ID of the member who made
this change) and name (the name that the member who made this change provided for
henself). |