What's this

Introduction

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

Markers enable people to move between devices and applications and have their various timelines pick up right where they left off. 10Centuries allows Markers to be dropped on a per-channel basis, and can even appear in the form of custom Marker Types. In addition to setting and retrieving Markers, an endpoint will return the number of Posts in a Channel published after a given Unix Timestamp. This is useful for applications that show people how many messages might be waiting, and how many mention them specifically.

Sections

  1. Setting a Marker
  2. Retrieving Marker Information
  3. Retrieving Channel Post Counts Since Unix Time

Setting a Marker

To set a Marker in 10Centuries is quite simple. To set one for the Global timeline, simply pass a since_unix value. 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/marker

Required Data:

since_unix: {any Unix timestamp greater than 0}

Optional Data:

channel_guid: {the guid for a Channel the Marker belongs to} channel_id: {the id for a Channel the Marker belongs to [overrides channel_guid]} type: {the type of Marker for a Channel [defaults to 'global']}

This information can be sent 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 "since_unix=1234567890" \ "https://api.10centuries.org/marker"

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

{ "meta": { "code": 200 }, "data": { "type": "marker.1.global", "value": 1234567890 } }

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

{ "meta": { "code": 404, "text": "Invalid Channel Information" }, "data": false }

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

Retrieving Marker Information

Retrieving Marker information is about as easy as setting it. Simply send a one-line query to the API. This function requires a valid authorization token in the HTTP header.

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

GET https://api.10centuries.org/marker

Optional Data:

channel_guid: {the guid for a Channel the Marker belongs to} channel_id: {the id for a Channel the Marker belongs to [overrides channel_guid]} type: {the type of Marker for a Channel [defaults to 'global']}

This information can be sent URL-encoded or as a JSON package.

Example:

curl -X GET -H "Authorization: {Authorization Token}" \ -H "Content-Type: application/x-www-form-urlencoded" \ "https://api.10centuries.org/marker"

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

{ "meta": { "code": 200 }, "data": { "type": "marker.1.global", "value": 1234567890 } }

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

{ "meta": { "code": 404, "text": "Invalid Channel Information" }, "data": false }

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

Retrieving Channel Post Counts Since Unix Time

Rather than query a timeline and receive a large JSON package that needs to be parsed just to see how many Posts have been made since a passage of time, apps can request just these numbers through the Marker API. Just send a simple GET query to the server. This function requires a valid authorization token in the HTTP header.

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

GET https://api.10centuries.org/marker/counts

Optional Data:

since_unix: {the Unix timestamp to start data collection from [defaults to last Marker position]} channel_guid: {the guid for a Channel the Marker belongs to} channel_id: {the id for a Channel the Marker belongs to [overrides channel_guid]} type: {the type of Marker for a Channel [defaults to 'global']}

This information can be sent URL-encoded or as a JSON package.

Example:

curl -X GET -H "Authorization: {Authorization Token}" \ -H "Content-Type: application/x-www-form-urlencoded" -d "since_unix=1234567890" \ "https://api.10centuries.org/marker/counts"

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

{ "meta": { "code": 200 }, "data": [ { "post_type": "post.long", "post_count": 4, "post_mentions": 1, "accounts": 2 }, { "post_type": "post.micro", "post_count": 3207, "post_mentions": 967, "accounts": 24 }, { "post_type": "post.short", "post_count": 647, "post_mentions": 193, "accounts": 18 }, { "post_type": "post.tiny", "post_count": 1134, "post_mentions": 321, "accounts": 23 } ] }

The data breakdown is as follows:

post_type: {the type of post [defaults to Social types]} post_count: {the number of visible posts of that type since a given Unix timestamp} post_mentions: {the number of visible posts of that type that mention the account holder since a given Unix timestamp} accounts: {the number of distinct accounts that have published visible posts of that type since a given Unix timestamp}

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

{ "meta": { "code": 404, "text": "Invalid Channel Information" }, "data": false }

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