Skip to content

RebelMouse Private API Posts API

Jorge Puente-Sarrín edited this page Jan 29, 2019 · 2 revisions

Posts API

The posts API supports updating already published content and unpublishing posts from the site.

Editing posts

Edits a post.

PUT /api/1.3/posts/<id>

Parameters

Name Type Description
headline String Headline - Required
body String Body - Optional
basename String Slug - Optional - It's automatically generated based on headline, by default
subheadline String Subheadline - Optional
tags Array of strings Tags - Optional
primary_tag String Primary tag - Optional
sections Array of strings Sections - Optional
primary_section String Primary section - Optional
og_title String Social headline - Optional
og_description String Social description - Optional
image_id Integer ID of the uploaded image - Optional
photo_credit String Photo credit - Optional
manual_image_crops Object Crops calculated when uploading image - Optional
listicle Array of objects Listicles, refer to listicles document for more information - Optional
roar_author_ids Array of integers Author IDs - Optional
roar_specific_data Object Custom fields - Optional
created_ts Integer Publishing date - Optional - Defaults to current timestamp

Note

  • primary_section and sections fields are eligible by title using insensitive case mode. "Home" can be passed if you want to set draft in homepage.
  • image_id can be found as id in Image API response when uploading or editing images.
  • manual_image_crops can be also found as manual_image_crops in Image API response when editing images.
  • In order to control the place where the listicles are going to be rendered inside the body, it's required to introduce a listicle HTML tag.
  • By default, roar_author_ids is automatically populated with the ID of the user identified with the API Key sent in the request.

Roar Specific Data

Name Type Description
keep_reading_button_text String Text to be displayed on Keep Reading Button - Optional
keep_reading_hide_word_count Boolean Controls whether words count is going to be displayed - Optional - Defaults to false

Response

The response can contain several fields, but would like to highlight some of them that were specially requested:

Name Type Description
post_url String URL for the draft when is published.
slug String URL path from post_url.

Note

  • Unlike drafts API, posts API doesn't return draft_url in response payload unless the post was unpublished.

Unpublishing posts

Unpublishes a post.

PUT /api/1.3/posts/<id>

Parameters and Response

In addition to the specification from updating posts, an "action" parameter with the value "unpublish" can be sent to API in order to unpublish a post.

Name Type Description
action String
Action to be performed.
Optional.
Choices:
  • "unpublish"

Note

  • draft_url is returned in response payload when unpublishing a post.