Help Center
Search…
Setka Content Cloud API
Setka Cloud API allows you to download HTML code and auxiliary data of posts saved in your Setka account.
To enable Cloud API, please contact support.

Working with posts when Cloud API is enabled

If Cloud API is active on your Setka account, you will see some new buttons that will help you operate with the posts.

Publishing the post

If Cloud API is enabled, you will see the Publish / Unpublish button on the post badge in your Setka account. It determines the status of the post: published or draft, respectively:
The same buttons will appear in the post editor:
Screenshot of the Setka Editor interface: publishing the post via Cloud API
Screenshot of the Setka Editor interface: unpublishing the post via Cloud API

Updating the post

After the post is published, it can also be updated. Until then, its' status will stay as draft . To update the post and make the new revision available as published :
  1. 1.
    Make some changes in the published post and click Save draft.
  2. 2.
    Click Republish:
Screenshot of the Setka Editor interface: updaring the post via Cloud API

Making API requests with the Setka Cloud API

To fetch a complete list of posts from your Setka account, run the following request by adding a license key:
1
GET https://editor.setka.io/api/v2/posts
Copied!
To get a specific post from your Setka account, you need to specify its ID:
1
GET https://editor.setka.io/api/v2/posts/POST_ID
Copied!
Where POST_ID is the post’s ID.
By default, API will only return published posts with no images or HubSpot data. To get draft posts, use the state:draft or state:all filters. To include HubSpot data and/or images in the results, add additional fields to the request.

Authorization

Authorizing your identity in the Setka Cloud API is possible in two ways:

1. In the request header

Add the authorization header to the request:
1
{
2
"Authorization": "Bearer YOUR_LICENSE_KEY"
3
}
Copied!
where YOUR_LICENSE_KEY is your license key.

2. In the request parameters

Add the token parameter to the request:
1
GET https://editor.setka.io/api/v2/posts?token=YOUR_LICENSE_KEY
Copied!
where YOUR_LICENSE_KEY is your license key.

Example API request response

If the request is successful, you will receive a response consisting of an array of posts. The response will be paginated if the number of posts is large. Below is an example API request response:
1
HTTP/1.1 200 OK
2
{
3
posts: [
4
{
5
"id": 2587,
6
"title": "Stylist",
7
"style_name": "General",
8
"layout_name": "6col_19774",
9
"reading_time": 240,
10
"preview_link": "https://editor.setka.io/posts/80a44hd5924792",
11
"state": "published"
12
"author": {
13
"id": 44,
14
"name": "John Smith"
15
},
16
"body_html": "Hello!",
17
"assets": {
18
"plugins": [
19
"https://ceditor.setka.io/clients/js_plugins/5ca41dc7f0df3e3d6170901b627d32fc/public.js"
20
],
21
"styles": [
22
"https://ceditor.setka.io/common_css/common_css_1565603693.css",
23
"https://ceditor.setka.io/clients/GP1TwUnF9mFFVzgqnAplHSQs51xdl4WT/css/loM7yyO-6xsVawmBxqej8A.css",
24
"https://ceditor.setka.io/clients/GP1TwUnF9mFFVzgqnAplHSQs51xdl4WT/layout_option_builds/19774/gazQpY7j6Cgq9gFsEKYF5A.css"
25
],
26
"images": [
27
{
28
"id": 3310,
29
"url": "https://ceditor.setka.io/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg",
30
"alt": "Alt text"
31
"sizes": [
32
{
33
"width": 3654,
34
"height": 5473,
35
"url": "https://ceditor.setka.io/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg"
36
},
37
{
38
"width": 500,
39
"height": 5473,
40
"url": "https://ceditor.setka.io/6xAHRUiLM1NBnWZ9JupZNdugX1UyoQkg9kzIGk9--vk/w:500/q:88/plain/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg"
41
},
42
{
43
"width": 1000,
44
"height": 5473,
45
"url": "https://ceditor.setka.io/Ioa24dDnWZ9JupZNdugX1UyoQkg9kzIGk9--vk/w:1000/q:88/plain/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg"
46
}
47
]
48
}
49
]
50
},
51
"hubspot_post": {
52
"id": 141,
53
"url": "https://hubspotblog.com/1-blog-page/-temporary-slug-bbd6cb8e-afed-4291-8937-c779c9ac2d25?hs_preview=ludkAblF-28956926215",
54
"blog_id": 1315
55
},
56
"created_at": "2019-07-19T10:25:27Z",
57
"updated_at": "2019-07-19T10:27:40Z",
58
"published_at": "2019-07-22T13:34:11Z"
59
}
60
],
61
pagination: {
62
"page": 1,
63
"limit": 20,
64
"page_count": 1,
65
"total_count": 1
66
}
67
}
Copied!

Description of a received set of fields

Field
Description
posts
Posts array. Contains all the posts from your Setka account. The selection can be limited using additional parameters.
pagination
Pagination of search results. Contains information about the current page, the number of pages, the total number of posts, and the number of posts per page.

Posts array elements

Element
Description
id
The post’s unique ID.
title
The post’s title.
style_name
The name of the style used in the post.
layout_name
The name of the grid in which the post is laid out.
reading_time
The estimated time to read the post (in seconds).
preview_link
A link to the post’s preview in your Setka account.
state
The post’s state (either draft or published).
created_at
The date and time of the post’s creation.
updated_at
The date and time when the post was last updated.
published_at
The date and time of the post’s publication.
author
The post’s author, where
id — the author’s unique ID.
name — the author’s name specified in your Setka account.
body_html
The post’s full HTML code.
assets
Any additional files in the posts (e.g., CSS, JavaScript, or images).
hubspot_post
The post data exported to HubSpot, where:
id — the post’s unique ID.
url — the link to the post in HubSpot.
blog_id — the post’s ID in HubSpot.
Note: Getting the hubspot_post field in your API response will require the use of additional parameters.
Assets element files
As mentioned above, the assets element contains links to other files and assets. The possible types of assets are:
File
URL
Description
plugins
https://ceditor.setka.io/clients
/js_plugins/5ca41dc7f0df3e3d6170901b627d32fc/public.js
The scripts to run interactive post elements (e.g., animations, galleries, or notes).
styles
https://ceditor.setka.io/common_css
/common_css_1565603693.css
The CSS files of post styles, including the common style file, the standalone style, and the layout grid file.
images
https://ceditor.setka.io/clients
/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg
The images used in the post, where:
id — the image’s unique ID.
url — the link to the file.
alt — the alternative text.
sizes — several options for the image size, depending on the device’s screen size. Note: Getting the images field in your response will require using additional parameters.

Pagination object elements

Element
Description
page
The current page number.
limit
The maximum number of posts per page.
page_count
The total number of pages.
total_count
The total number of posts.

Making API requests with additional parameters

Using additional request parameters with the Setka Cloud API is necessary to filter posts by features or to include or exclude certain data in the response.

Filters

You can filter posts by status and author, e.g.:
1
GET https://editor.setka.io/api/v2/posts?filter=state:draft,author.id:1111&token=YOUR_LICENSE_KEY
Copied!
The available filters are:
  • author — the post’s author. The filter works both by ID (i.e., author.id) and by author name (author.name).
  • state — the post’s status, i.e., one of the following: draft, published, or all (both draft and published).

Additional fields

You can also include additional fields in the API response with the include parameter and listing the fields separated by commas, e.g.:
1
GET https://editor.setka.io/api/v2/posts?include=hubspot_post,images&token=YOUR_LICENSE_KEY
Copied!
The available fields are:
  • hubspot_post — the data of a post exported to HubSpot.
  • images — all images used in a post.

Selecting post data

If you need to obtain individual fields from your Setka account (e.g., only identifiers and post names), use the select parameter:
1
GET https://editor.setka.io/api/v2/posts?select=id,title&token=YOUR_LICENSE_KEY
Copied!
The available fields are:
  • id — the post’s unique ID.
  • title — the post’s title.
  • style_name — the name of the style used in the post.
  • layout_name — the name of the grid in which the post is laid out.
  • reading_time — the estimated time to read the post (in seconds).
  • preview_link — a link to the post’s preview in your Setka account.
  • state — the post’s state (either draft or published).
  • created_at — the date and time of the post’s creation.
  • updated_at — the date and time when the post was last updated.
  • published_at — the date and time of the post’s publication.
  • author — the post’s author, where id is the author’s unique ID, and the name is the author’s name specified in your Setka account.
  • body_html — the post’s full HTML code.
  • assets — any additional files in the posts (e.g., CSS, JavaScript, or images).
  • hubspot_post — the post data exported to HubSpot, where id is the post’s unique ID; url is the link to the post in HubSpot; blog_id is the post’s ID in HubSpot.

Possible errors when using the Setka Cloud API

When using the Setka Cloud API, you might encounter the following errors:
HTTP/1.1 401 Unauthorized
1
{
2
"error": "Not authorized!"
3
}
Copied!
This error occurs when using an incorrect license key (token).
HTTP/1.1 404 Unauthorized
1
{
2
"error": "Not found"
3
}
Copied!
This error occurs when requesting a specific post if a post with this ID is not found.
If you need assistance with the Setka Cloud API, please contact support.