What's this

Introduction

Read this section to learn about the Parser endpoint and its features

One of the most important elements of being able to publish content is being able to see the end result before the rest of the world. The Parser API endpoints will make this possible. At the moment, it is still rather basic, but future updates will give the function a great deal of power.

Sections

  1. Parsing a Text Object

Parsing a Text Object

10Centuries makes publishing various post types a snap. Anything that is published must go through a single text formatter. This feature will let people see what the end result will look like before publishing. This function requires a valid authorization token in the HTTP header.

From your application, send a request to the following endpoint:

POST https://api.10centuries.org/parser

Required Data:

content: {post content}

Optional Data:

title: {Title for Blog Post, Draft, Page, or Podcast}

This information can be send URL-encoded in the POST body or as a JSON package.

Example:

curl -X POST -H "Authorization: {Authorization Token}" \ -H "Content-Type: application/x-www-form-urlencoded" -d "content=This is, perhaps, one of the most boring posts in the history of the universe." \ "https://api.10centuries.org/parser"

If the post was successful, the API will respond with a JSON package:

{ "meta": { "code": 200 }, "data": { "title": "", "content": { "text": "This is, perhaps, one of the most boring posts in the history of the universe.", "html": "<p>This is, perhaps, one of the most boring posts in the history of the universe.</p>" } } }

If posting failed or there was some other problem, the API will respond with an error:

{ "meta": { "code": 404, "text": "No Text Received" }, "data": false }

If the meta.text key is present in this result, you must show a modal dialog or equivalent containing this message.