The Fifth World

Get pages

This endpoint allows you to search for pages using a variety of criteria.

Request

HTTP Headers
HTTP Header Value
Authorization A valid JSON Web Token, of the form Bearer ENCODEDHEADER.ENCODEDPAYLOAD.ENCODEDSIGNATURE. You don’t need to authenticate to use this endpoint, but doing so may change the set of results that it returns. If you don’t authenticate, the response will only include publicly-available pages. If you authenticate, it will include any matching pages that you have permission to view.
Query Parameters
Query Parameters Value
path If provided, the endpoint will return pages that have paths that begin with the value provided. It will not match pages that have this value somewhere in the middle of their paths.
title If provided, the endpoint will return pages that have the given value somewhere in their titles.
type If provided, the endpoint will return pages of the given type.
tag If given a string of the form tag:val, the endpoint will return pages that have a tag called tag set to a value of val. For any value not matching that pattern, it returns pages that have a tag equal to the value provided. You can provide multiple instances of this parameter in a single request. The logic parameter determines how these sets interact in the response provided.
ancestor If given a path, this will limit the pages you get back to only those who descend from the page with this path (e.g., children of this page, or children of children of this page, and so on). If you pass something other than a valid page path, you’ll get an empty array back, because no pages will find that path among its ancestors.
order By default, the endpoint returns pages in alphabetical order, sorted by their titles. With this parameter, you can specify any of the following sorting orders:
reverse alphabetical
first created
last created
oldest update
most recent update
limit By default the endpoint returns the first 10 pages that match the criteria provided, but you can change that number by setting this parameter to a different number.
offset This parameter allows you to specify a number of pages to skip in the set provided in the endpoint’s response. You can use this in conjunction with the limit parameter to move through multiple pages of results. For example, using the default limit of 10 pages, you could get more results by setting offset to 10, thus skipping the first 10 that you got from the first response, and instead getting the next 10.
logic By default, the endpoint provides the intersection of the sets requested. So, for example, if you provide type=Place&path=/africa, you would receive pages that have the type Place and a path that begins with /africa (in other words, places in Africa). You can change this to provide a union by setting logic=or. So type=Place&path=/africa&logic=or will provide all of the pages that have the type Place or a path that begins with /africa. This will include all of the places in Africa, but also all of the places outside of Africa, as well as all of the other pages located under Africa in the page hierarchy besides places, like regions.

Examples

Example Request
GET /v1/pages?type=Place&path=/africa HTTP/1.1 Host: api.thefifthworld.com

Response

The endpoint responds with JSON respresenting an array of Page objects that match the criteria provided. If you provide no criteria, or if it cannot find any pages matching the criteria you’ve provided, it returns with an empty array.

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 number The permissions set on the page. This 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
[ { "id": 256, "title": "Vervain", "description": "A portrait of Vervain, one of the four main characters in Giulianna Maria Lamanna’s novel, Children of Wormwood, commissioned by Dani Kaulakis.", "slug": "vervain", "path": "/art/dani-kaulakis/vervain", "parent": 230, "depth": 2, "permissions": 774, "type": "Art", "tags": { "artist": [ "Dani Kaulakis" ] }, "location": false, "likes": [ 1004 ], "files": [ { "name": "uploads/vervain-web.20190915.172328.jpg", "thumbnail": "uploads/vervain-web.20190915.172328.256x256.jpg", "mime": "image/jpeg", "size": 1904814, "timestamp": 1568568208, "uploader": 1004, "urls": { "full": "https://thefifthworld.s3.us-east-2.stackpathstorage.com/uploads/vervain-web.20190915.172328.jpg", "thumbnail": "https://thefifthworld.s3.us-east-2.stackpathstorage.com/uploads/vervain-web.20190915.172328.256x256.jpg" }, "readableSize": "1.9 MB" } ], "owner": { "id": 1004, "name": "Jason Godesky" }, "history": [ { "id": 500, "timestamp": "2019-09-15T17:23:28.000Z", "msg": "Initial text", "content": { "title": "Vervain", "path": "/art/dani-kaulakis/vervain", "parent": "/art/dani-kaulakis", "type": "Art", "body": "A portrait of [[/wormwood/vervain | Vervain]], one of the four main characters in [Giulianna Maria Lamanna's](/member/1006) novel, *[[Children of Wormwood]]*, commissioned by [[Dani Kaulakis]].", "description": "A portrait of Vervain, one of the four main characters in Giulianna Maria Lamanna’s novel, Children of Wormwood, commissioned by Dani Kaulakis." }, "editor": { "name": "Jason Godesky", "id": 1004 } } ] } ]