Search AI Powered

Latest Stories

RebelMouse Public API

public api, rebelmouse for developers

Authorization

Our REST API service uses key-based authorization that can be managed in your Account page. You can find your API key in the form of a 64-character string. But please note that we use this unique key to identify your account, so please do not share it with anyone.


All client requests are authorized using valid API keys via a specific HTTP header or query string. Query strings take priority over the HTTP header, so query strings will be considered if you send both at the same time.

Sending API Key via Query String

In order to authorize requests using the "api_key" query string, you need to send it as follows:

 /api//?api_key=

Sending API Key via HTTP Header

In order to authorize requests using the "X-RMAuth" HTTP header method, you need to send it as follows:

 /api// X-RMAuth: 

Unauthorized Requests

If you send invalid API keys, you will get a response with HTTP 403 Forbidden status and the following payload:

{ "status": { "code": null, "messages": ["API key is not valid"] }, "data": null }


Author API

The author API supports creating users that can be used to create drafts.

Creating Authors

Creates an author and sets its role as guest editor. You can modify user roles in your dashboard as desired once the author is created.

POST /api/1.1/authors

Parameters

NameTypeDescription
first_nameStringFirst name - Required
last_nameStringLast name - Required
emailStringUser email - Required
passwordStringUser password - Required
about_htmlStringUser biography - Optional
image_idIntegerID of the uploaded image - Optional

Note:

  • image_id can be found as id in Image API response when uploading or editing images

Response

{ "id": , "name": "paulberry", "displayname": "Paul Berry", "about_html": "This is me", "bio": "", "photo": "https:///res/avatars/default", "fb_id": null, "profile_url": "https:///community/paulberry/" }


Drafts API

The draft API supports creating drafts that can be used to publish content on your site.

Creating Drafts

Creates a draft and sets current user as author by default.

POST /api/1.3/drafts

Important

We provide another endpoint for backward compatibility with 1.1 API version, 1.3 is the preferred endpoint.

POST /api/1.1/posts

Parameters

NameTypeDescription
headlineStringHeadline - Required
bodyStringBody - Optional
manual_basenameStringSlug - Optional - It's automatically generated based on headline, by default
subheadlineStringSubheadline - Optional
tagsArray of stringsTags - Optional
primary_tagStringPrimary tag - Optional
sectionsArray of stringsSections - Optional
primary_sectionStringPrimary section - Optional
og_titleStringSocial headline - Optional
og_descriptionStringSocial description - Optional
image_idIntegerID of the uploaded image - Optional
photo_creditStringPhoto credit - Optional
manual_image_cropsObjectCrops calculated when uploading image - Optional
videoStringVideo URL - Optional
listicleObjectListicles, refer to listicles document for more information - Optional
roar_author_idsArray of integersAuthor IDs - Optional
roar_specific_dataObjectCustom fields - Optional
created_tsIntegerPublishing date - Optional - Defaults to timestamp for publish action

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 request.

Response

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

NameTypeDescription
post_urlStringURL of the draft when it's published
draft_urlStringComposited by post_url + "?draft=1", which enables users to see the draft page
slugStringURL path from post_url


Editing Drafts

Edits a draft.

PUT /api/1.3/drafts/

Parameters and Response

The same specification from creating drafts applies here.


Publishing Drafts

Publishes a draft.

PUT /api/1.3/drafts/

Parameters and Response

In addition to the specification from updating drafts, an "action" parameter with value "publish" can be sent to API in order to publish a draft.

NameTypeDescription
actionStringAction to be performed.Optional.Choices:
  • "publish"

Note

  • draft_url is not returned in response payload when publishing a draft.
  • Stored data from the draft will be published if not received updated data is coming within request payload.


Posts API

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

Editing Posts

Edits a post.

PUT /api/1.3/posts/

Parameters

NameTypeDescription
headlineStringHeadline - Required
bodyStringBody - Optional
manual_basenameStringSlug - Optional - It's automatically generated based on headline, by default
subheadlineStringSubheadline - Optional
tagsArray of stringsTags - Optional
primary_tagStringPrimary tag - Optional
sectionsArray of stringsSections - Optional
primary_sectionStringPrimary section - Optional
og_titleStringSocial headline - Optional
og_descriptionStringSocial description - Optional
image_idIntegerID of the uploaded image - Optional
photo_creditStringPhoto credit - Optional
manual_image_cropsObjectCrops calculated when uploading image - Optional
videoStringVideo URL - Optional
listicleObjectListicles, refer to listicles document for more information - Optional
roar_author_idsArray of integersAuthor IDs - Optional
roar_specific_dataObjectCustom fields - Optional
created_tsIntegerPublishing date - Optional - Defaults to timestamp for publish action

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 request.

Response

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

NameTypeDescription
post_urlStringURL for the draft when is published.
slugStringURL path from post_url.

Note

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


Unpublishing Posts

Unpublishes a post.

PUT /api/1.3/posts/

Parameters and Response

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

NameTypeDescription
actionStringAction to be performed.Optional.Choices:
  • "unpublish"

Note

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


Listicles

Our drafts API and posts API support listicles creation, listicles are a set of particles inside a post and you can control the place where they are going to be rendered inside the body by introducing a listicle HTML tag in post body parameter.

Parameters

NameTypeDescription
itemsArray of objectsItems, particles of the listicle - Optional
settingsObjectSettings - Optional

Item Parameters

NameTypeDescription
headlineStringHeadline - Optional
mediaStringMedia, usually a raw shortcode to be rendered above or below body - Optional
is_imageBooleanFor backward compatibility, it must be true if media is an image - Optional
image_idIntegerID of the uploaded image - Optional
captionStringCaption - Optional
creditStringPhoto credit - Optional
manual_image_cropsObjectCrops calculated when uploading image - Optional
bodyStringBody - Optional

Note

  • image_id can be found as id in Image API response when uploading or editing images.
  • It's possible to use image shortcodes in media field, you can find them in "shortcode" field inside the payload responsewhen uploading images with Images API.

Setting Parameters

NameTypeDescription
body_text_aboveBooleanControls body position above or below media.Optional. Defaults to false.
layout_typeIntegerLayout type.Optional. Defaults to 1.Choices:
  • 1: Regular listicle
  • 2: Slideshow
  • 3: Full screen

Example

The parameters described above should be sent as part of the payload for creating/updating drafts/posts, as the following:

{ "headline": "This is an awesome post!", "body": "

foo

bar

", "listicle": { "items": [ { "headline": "Listicle 1", "body": "Here is some content" } ], "settings": { "body_text_above": true } } }


Image API

The Image API supports uploading and editing images that could be used as splash post image, teaser, social teaser and even other features than posts such as authors creation.

Ratios

Every site in RebelMouse platform has its own image crops configured, these settings are useful when a image is going to be rezised or cropped. So they are considered in every process related to images, and each resized or cropped image has usually a different purpose depending on page type.

For runner sites, we have the following ratios configured:

TitleCodeSizes
Super Wide3x1
  • 1200x400
  • 600x200
Wide2x1
  • 1200x600
  • 600x300
Medium3x2
  • 1200x800
  • 600x400
Square1x1
  • 600x600
  • 300x300
Tall9x16
  • 700x1245
Widescreen16x9
  • 1245x700


Uploading Images

Upload a image sending its content as a part of HTTP request body or sending a URL as part of a JSON document.

POST /api/1.3/images
NameTypeDescription
image_urlStringA image URL location - Optional
captionStringCaption - Optional
photo_creditStringPhoto credit - Optional
altStringAlt/Title - Optional

Parameters

NameTypeDescription
image_urlStringA image URL location - Optional
captionStringCaption - Optional
photo_creditStringPhoto credit - Optional
altStringAlt/Title - Optional

Note:

  • Multiple files can be also sent as part of HTTP request. These parameters are used only if image_url is not used in HTTP request.
  • For requests with "multipart/form-data" content type, files should be named with "file".

Example with multipart/form-data

POST /api/1.3/images HTTP/1.1 HOST:  x-rmauth:  authorization: Basic  content-type: multipart/form-data; boundary=----WebKitFormBoundarym59pe8dwmBaESksR content-length:  ------WebKitFormBoundarym59pe8dwmBaESksR Content-Disposition: form-data; name="file"; filename="image.png" Content-Type: image/png  ------WebKitFormBoundarym59pe8dwmBaESksR--

Note

Files to be considered for uploading must be named with "file" string.

Response

For a single image uploaded:

{ "is_animated_gif": false, "task_id": "c3e2a367-24cb-426f-9179-457a0e0ea9ec", "height": 511, "shortcode_id": "7229TA1498262817", "iptc": { "by-line": "", "caption/abstract": "" }, "id": , "shortcode_params": { "is_animated_gif": false, "crop_info": "%22%7B%22image%22%3A%20%22https%3A%2F%2Fs3.amazonaws.com%2Fdev-assets.rbl.ms%2F", "35x35": "", "1200x800": "", "480x270": "", "700x1245": "", "980x": "", "600x": "", "600x600": "", "960x540": "", "600x300": "", "210x": "", "300x": "", "600x400": "", "1200x600": "" }, "manual_image_crops": { "16x9": { "width": 512, "top": 222, "height": 289, "left": 0, "sizes": [ "960x540", "480x270" ] }, "2x1": { "width": 512, "top": 255, "height": 256, "left": 0, "sizes": [ "1200x600", "600x300" ] }, "3x2": { "width": 512, "top": 169, "height": 342, "left": 0, "sizes": [ "1200x800", "600x400" ] }, "1x1": { "width": 109, "top": 402, "height": 109, "left": 0, "sizes": [ "600x600" ] }, "9x16": { "width": 117, "top": 303, "height": 208, "left": 0, "sizes": [ "700x1245" ] } }, "filename": "image_hmXa6R.jpg", "width": 512, "media_html": "\" id=\"89b1c\" class=\"rm-shortcode\" data-rm-shortcode-id=\"7229TA1498262817\" data-rm-shortcode-name=\"rebelmouse-image\" >", "shortcode": "[rebelmouse-image  is_animated_gif=false crop_info=\"%22%7B%22image%22%3A%20%22https%3A%2F%2Fs3.amazonaws.com%2Fdev-assets.rbl.ms%2F" }

For multiple images uploaded:

It takes the same schema for each image uploaded but in form of an array.


Editing Images

Editing an image for creating some others with certain dimensions.

PUT /api/1.3/images/

Parameters

NameTypeDescription
image_urlStringA image URL location - Required
manual_image_cropsObjectCrop setting for resizing image - Optional
captionStringCaption - Optional
photo_creditStringPhoto credit - Optional

Manual Image Cropping

Manual image cropping depends on the ratios that have been configured for the site. It must be an object, whose keys must be the ratio codes. The values should contain the following information:

NameTypeDescription
topIntegerAbsolute top coordinate
leftIntegerAbsolute left coordinate
heightIntegerAbsolute height coordinate
widthIntegerAbsolute width coordinate
imgHeightIntegerHeight of the original image
imgWidthIntegerWidth of the original image

Example

{ "16x9": { "top": 222, "left": 0, "height": 289, "width": 512, "imgWidth": 512, "imgHeight": 511 }, "2x1": { "top": 255, "left": 0, "height": 256, "width": 512, "imgWidth": 512, "imgHeight": 511 }, "3x2": { "top": 169, "left": 0, "height": 342, "width": 512, "imgWidth": 512, "imgHeight": 511 }, "1x1": { "top": 402, "left": 0, "height": 109, "width": 109, "imgWidth": 512, "imgHeight": 511 }, "9x16": { "top": 303, "left": 0, "height": 208, "width": 117, "imgWidth": 512, "imgHeight": 511 } }

Response

It takes the same schema from uploading images. Only one image can be edited per request.


Webhooks

Webhooks allow you to receive notification of certain events from the RebelMouse platform. HTTP POST requests are performed for the configured URL you provide to us. These requests are formed with the following headers:

NameValue
User-AgentRebelMouse/0.1 Mozilla/5.0 (compatible; http://rebelmouse.com) Gecko/20100101 Firefox/7.0.1
Content-Typeapplication/json


Published Post

You can receive a notification when a post is published. You will receive the following information:

NameTypeDescription
post_idIntegerID of the post
post_urlStringURL of the published post


Click here for more on RebelMouse Public API v1.2.

We've helped ambitious teams launch, grow,
and outperform. Now it's your turn.
Whether you need a custom solution, a smarter strategy, or just someone to bounce ideas off — we're here for it.
Let's Talk