# Preserve your Setka Editor content after the service shutdown

## Introduction

To ensure robust content preservation on HubSpot after the Setka Editor infrastructure shutdown this guide will do two things:

1. Explain which assets rely on Setka Editor CDN
2. Describe the steps needed to migrate mentioned assets to HubSpot CDN

## &#x20;Assets that rely on Setka Editor CDN

* images
* JavaScript code for enabling interactive post elements&#x20;
* CSS code which enables all the styling of your articles

## Migrating Setka Editor assets to HubSpot CDN

### Step 1 — receive the list of posts

Make a request to [Setka Content Cloud API](/help-center/api/getting-posts-from-the-personal-account-with-setka-cloud-api.md#h_01enncg7mxdxs0cm62xe0esnam) to receive your list of Setka Editor posts. Here is a request example:

{% code overflow="wrap" %}

```
https://editor.setka.io/api/v2/posts?token=<token>&filter=state:<state>&include=images&limit=10
```

{% endcode %}

`state` determines the publication status of the post:

* Set to `published` to only get published posts.
* Set to `draft` to get drafts.
* Set to `all` to get both drafts and published posts.

`limit` determines the number of posts you can receive as a response. Please make sure you don't set the value too low and miss some of the posts.

{% hint style="info" %}
Check the [Content Aloud API documentation](/help-center/api/getting-posts-from-the-personal-account-with-setka-cloud-api.md#h_01ekfyy9s0yymm744ff52hpa16) for more filters.
{% endhint %}

### Step 2 — download assets for every post

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:

```
HTTP/1.1 200 OK
{
  posts: [
    {
      "id": 2587,
      "title": "Stylist",
      "style_name": "General",
      "layout_name": "6col_19774",
      "reading_time": 240,
      "preview_link": "https://editor.setka.io/posts/80a44hd5924792",
      "state": "published"
      "author": {
        "id": 44,
        "name": "John Smith"
      },
      "body_html": "Hello!",
      "assets": {
        "plugins": [
          "https://ceditor.setka.io/clients/js_plugins/5ca41dc7f0df3e3d6170901b627d32fc/public.js"
        ],
        "styles": [
          "https://ceditor.setka.io/common_css/common_css_1565603693.css",
          "https://ceditor.setka.io/clients/GP1TwUnF9mFFVzgqnAplHSQs51xdl4WT/css/loM7yyO-6xsVawmBxqej8A.css",
          "https://ceditor.setka.io/clients/GP1TwUnF9mFFVzgqnAplHSQs51xdl4WT/layout_option_builds/19774/gazQpY7j6Cgq9gFsEKYF5A.css"
        ],
        "images": [
          {
            "id": 3310,
            "url": "https://ceditor.setka.io/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg",
            "alt": "Alt text"
            "sizes": [
              {
                "width": 3654,
                "height": 5473,
                "url": "https://ceditor.setka.io/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg"
              },
              {
                "width": 500,
                "height": 5473,
                "url": "https://ceditor.setka.io/6xAHRUiLM1NBnWZ9JupZNdugX1UyoQkg9kzIGk9--vk/w:500/q:88/plain/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg"
              },
              {
                "width": 1000,
                "height": 5473,
                "url": "https://ceditor.setka.io/Ioa24dDnWZ9JupZNdugX1UyoQkg9kzIGk9--vk/w:1000/q:88/plain/clients/U8Cr2B1ZnJjyHr6e6xn_Qa7N1oqyj7cB/post_images/-tltJS8D79MI5Yltt37MCA.jpg"
              }
            ]
          }
        ]
      },
      "hubspot_post": {
        "id": 141,
        "url": "https://hubspotblog.com/1-blog-page/-temporary-slug-bbd6cb8e-afed-4291-8937-c779c9ac2d25?hs_preview=ludkAblF-28956926215",
        "blog_id": 1315
      },
      "created_at": "2019-07-19T10:25:27Z",
      "updated_at": "2019-07-19T10:27:40Z",
      "published_at": "2019-07-22T13:34:11Z"
    }
  ],
  pagination: {
    "page": 1,
    "limit": 20,
    "page_count": 1,
    "total_count": 1
  }
}
```

Download the assets for each post from the array. The possible types of assets are:

| File    | URL                                                                                                                        | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ------- | -------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| plugins | <p><https://ceditor.setka.io/clients></p><p>/js\_plugins/5ca41dc7f0df3e3d6170901b627d32fc/public.js</p>                    | The scripts to run interactive post elements (e.g., animations, galleries, or notes).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| styles  | <p><https://ceditor.setka.io/common_css></p><p>/common\_css\_1565603693.css</p>                                            | The [CSS files](https://editor-help.setka.io/hc/en-us/articles/115002594605-Integration-with-Content-Design-System-Manager#h_86d458de-3dcd-4dac-b1c1-43742dda74a7) of post styles, including the common style file, the standalone style, and the layout grid file.                                                                                                                                                                                                                                                                                                                                                           |
| images  | <p><https://ceditor.setka.io/clients></p><p>/U8Cr2B1ZnJjyHr6e6xn\_Qa7N1oqyj7cB/post\_images/-tltJS8D79MI5Yltt37MCA.jpg</p> | <p>The images used in the post, where:</p><p>— <code>id</code> — the image’s unique ID.</p><p>— <code>url</code> — the link to the file.</p><p>— <code>alt</code> — the alternative text.</p><p>— <code>sizes</code> — several options for the image size, depending on the device’s screen size. <br><strong>Note:</strong> <em>Getting the <code>images</code> field in your response will require using</em> <a href="https://editor-help.setka.io/hc/en-us/articles/360056312453-Getting-Posts-from-the-Setka-Account-with-Setka-Cloud-API#h_01EKFYY9S0YYMM744FF52HPA16"><em>additional parameters</em></a><em>.</em></p> |

### Step 3 — authenticate within HubSpot API

HubSpot [provides detailed instructions](https://developers.hubspot.com/docs/api/intro-to-auth) on how to authenticate calls to their API. Please follow their instruction and come back here once you've successfully authenticated.

### Step 4 — uploading assets to Hubspot&#x20;

Using [Hubspot CMS Source Code API](https://developers.hubspot.com/docs/api/cms/source-code) upload the assets from your posts to the [HubSpot Developer File system](https://developers.hubspot.com/docs/cms/key-concepts#developer-file-system). Doing so will allow you to access these files and use them within Hubspot Design Manager.

### Step 5 — replacing asset URLs and updating content

You can perform this operation in HubSpot or in Setka Editor. Proceed with the option of your choice.

#### In HubSpot

&#x20; Use a script to execute a sequence of actions for each post you need to preserve:&#x20;

1. Retrieve a blog post through [Hubspot CMS Blog Post API](https://developers.hubspot.com/docs/api/cms/blog-post)
2. Replace Setka Editor asset URLs with HubSpot asset URLs using a format suggested in a code block below
3. Update a Blog Post using the HubSpot interface or corresponding API call

{% code title="HubSpot asset URL format" overflow="wrap" %}

```
https://cdn2.hubspot.net/hub/<hubspot_account_id>/<design_manager_filepath>
```

{% endcode %}

#### In Setka Editor

1. Use Get Post call to retrieve a blog post through Setka Content Cloud API
2. Replace Setka Editor asset URLs with HubSpot asset URLs using a format suggested in a code block above
3. Use the *Update Post* method for each Setka Editor post to update all necessary blog posts
4. On the *Posts* page of your Setka Editor account press the *Update post* button, to push the updated versions to your HubSpot.

As a result, your HubSpot should have updated post content with no asset URLs located on Setka Editor CDN.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://setka.gitbook.io/help-center/integrations/setka-and-hubspot/preserve-your-setka-editor-content-after-the-service-shutdown.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
