Introduction
The Cloudrock API allows you to add new posts through a simple REST API.
Authentication
In order to use the API, you should authenticate your request by including your API key in each request as a GET or POST as a 'api_key' param.
You can find your API key in the Settings here:
https://{workspace}.cloudrock.io/settings/account
Headers
Make sure you have the following content type headers are set on every request:
Accept: application/json Content-Type: application/json
URI
Cloudrock API is hosted on the following base URI:
https://{workspace}.clourock.io/
Errors
Cloudrock uses conventional HTTP response codes to indicate the success or failure of an API request. The table below contains a summary of the typical response codes:
Code | Description |
---|---|
200 | Everything is ok. |
400 | Valid data was given but the request has failed. |
401 | No valid API Key was given. |
404 | The request resource could not be found. |
422 | The payload has missing required parameters or invalid data was given. |
429 | Too many attempts. |
500 | Request failed due to an internal error in Cloudrock. |
503 | Cloudrock offline for maintenance. |
Languages
The Cloudrock API supports these language for content tasks:
Language Code | Language Name |
---|---|
AF | Afrikaans |
AR | Arabic |
BG | Bulgarian |
HR | Croatian |
CS | Czech |
DA | Danish |
NL | Dutch |
EN | English |
ET | Estonian |
FI | Finnish |
FR | French |
DE | German |
EL | Greek |
HE | Hebrew |
HI | Hindi |
HU | Hungarian |
ID | Indonesian |
IT | Italian |
JA | Japanese |
KO | Korean |
LV | Latvian |
LT | Lithuanian |
MS | Malay |
NO | Norwegian |
PL | Polish |
PT | Portuguese |
RO | Romanian |
RU | Russian |
SR | Serbian |
SK | Slovak |
SL | Slovenian |
ES | Spanish |
SV | Swedish |
TH | Thai |
TR | Turkish |
UK | Ukrainian |
VI | Vietnamese |
Posts
Create Draft
Payload
e{
"token": "your_api_key",
"domain": "example.com",
"title": "Lorem Ipsum is simply dummy",
"content": "<h2>What is Lorem Ipsum?</h2><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>",
"type": "post",
}
Successful response
e{
"id of the added post"
}
Error json response
e{
"domain": [
"The domain field is required."
],
"title": [
"The title field is required."
],
"content": [
"The content field is required."
],
"type": [
"The type field is required."
]
}
HTTP Request
POST https://{workspace}.cloudrock.io/api/post
Parameters
Key | Description |
---|---|
token | Required. Must be your API Key. |
domain | Required. The domain of the site where the draft will be published. You should have this domain in the site list. For example: www.example.com |
title | Required. The title of the draft. Maximum length of 190 words. |
content | Required. The body of the draft, could include HTML markup. |
type | Required. The type of the draft. Valid types: post or page . |
tags | Optional. The list of tags for the draft, separated by comma. |