The Fifth World

Get a page

This endpoint returns a single page, specified by its path.

Request

HTTP Headers
HTTP Header Value
Authorization A valid JSON Web Token, of the form Bearer ENCODEDHEADER.ENCODEDPAYLOAD.ENCODEDSIGNATURE. If you request a publicly-available page, then you do not need to authenticate. If you request a page that has more strict read permissions, you must authenticate with an account that has read permissions for the page.
Path Parameters
Path Parameter Value
path The page you would like to request. 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

Example Request
GET /v1/pages/animalia/chordata/mammalia HTTP/1.1 Host: api.thefifthworld.com

Response

If you send a path that does not exist, the endpoint responds with a 404 HTTP status. If you request a page that you do not have permission to view, it responds with a 401 HTTP status. If you request a page that exists and you have permission to view, it responds with a 200 HTTP status and a JSON object representing the page requested.

Response JSON
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.
data object This property provides the structured data provided in the current state of the page.
Page Object
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.
File Object
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.
Change Object
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).

Example

Example Response
{ "page": { "id": 333, "title": "Mammal", "description": "Mammals give birth to live young and produce milk to nurse them. As mammals ourselves, we humans often conflate our class with the animal kingdom itself, even though we compromise only a fairly small class among vertebrates.", "slug": "mammalia", "path": "/animalia/chordata/mammalia", "parent": 301, "data": {}, "depth": 2, "permissions": { "read": true, "write": false, "code": 774 }, "type": "Class (biological taxonomy)", "tags": {}, "location": false, "likes": [], "files": [], "owner": { "id": 1048, "name": "Fifth World Bot" }, "history": [ { "id": 119807, "timestamp": "2020-01-09T01:53:33.000Z", "msg": "Initial text", "content": { "title": "Mammalia", "path": "/animalia/chordata/mammalia", "parent": "/animalia/chordata", "body": "{{Stub}}\n\nThe class ***Mammalia*** belongs to the phylum [[/animalia/chordata | Chordata]].\n\n## Orders\n\n{{Children Type=\"Order (biological taxonomy)\"}}\n\n## External links\n\n* [Wikipedia entry](https://en.wikipedia.org/wiki/Mammalia)\n\n[[Type:Class (biological taxonomy)]]", "description": "The class Mammalia belongs to the phylum Chordata." }, "editor": { "name": "Fifth World Bot", "id": 1048 } } ], "lineage": [ { "id": 300, "title": "Animal", "description": "Animals form one of the kingdoms of life.", "slug": "animalia", "path": "/animalia", "parent": 0, "data": {}, "depth": 0, "permissions": 774, "type": "Kingdom (biological taxonomy)", "tags": {}, "location": false, "likes": [], "files": [], "owner": { "id": 1048, "name": "Fifth World Bot" }, "history": [...] }, { "id": 301, "title": "Vertebrate", "description": "Vertebrates include humans and other mammals, as well as fish, birds, and most of the other complex living things that we normally think of when we think of animals (even though insects outnumber us all by a wide margin).", "slug": "chordata", "path": "/animalia/chordata", "parent": 300, "data": {}, "depth": 1, "permissions": 774, "type": "Phylum (biological taxonomy)", "tags": {}, "location": false, "likes": [], "files": [], "owner": { "id": 1048, "name": "Fifth World Bot" }, "history": [...] } ] }, "markup": "<aside>We only have a <strong>stub</strong> for this article right now. Help us out by fleshing it out further.</aside>\n<p><strong>Mammals</strong> give birth to live young and produce milk to nurse them. As mammals ourselves, we <a href=\"/new?title=Homo%20sapiens\" class=\"isNew\">humans</a> often conflate our class with the <a href=\"/animalia\" title=\"Animal\">animal kingdom</a> itself, even though we compromise only a fairly small class among <a href=\"/animalia/chordata\" title=\"Vertebrate\">vertebrates</a>, who themselves make up only a small part of the kingdom.</p>\n", "data": {} }