# Integration with Content Design System Manager (CDSM)

## Before you start

**Before starting the integration, make sure that the Editor config URL** field is specified in your [Setka Account](https://editor.setka.io) (**Integrations** tab) for Setka Editor to work on your domain:

![Screenshot of Setka Interface: "CMS Integrations" tab, step 1 - "Set your domain" other integration](https://1843290185-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLOEPbfEK4119w2ROYc%2F-MRCcgEeurJoWBweGnGW%2F-MRCf6x5OcqDWaAzx4bF%2FScreenshot-of-Setka-Interface-set-your-domain-other-integration.png?alt=media\&token=c84e7b19-3c5c-4f43-8c31-be0cfb27b6f7)

**Editor config url** is a link on which you will receive the latest version of the editor and updates for styles created in the Style Manager. On initial sync, you will also receive a `public_token`, which is required for several editor functions to work, e.g., for commenting and inserting embeds via a URL.

Requests to editor.setka.io should contain your license key (hereinafter, in request samples, it is marked as `your-license-key`). You can get the license key on your account's CMS Integration page in [your account:](https://editor.setka.io/)

![Screenshot of Setka Editor Interface: "CMS Integration" tab with "Get License Key" field](https://1843290185-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MLOEPbfEK4119w2ROYc%2F-MRCkAUdkWyW8U13blYi%2F-MRCl_b1O8guCT1awmLh%2FScreenshot-Setka-Editor-Interface-CMS-Integration-License-Key.png?alt=media\&token=a180f933-96b0-4f7f-81bc-61b6a145951b)

Please read about all the four steps to integrate Setka with your custom CMS via our API: &#x20;

* **Step 1:** [Initial sync. Receiving Setka Editor files to connect them to your CMS](https://setka.gitbook.io/help-center/api/setka-editor-api/integration-with-style-manager/initial-sync-receiving-setka-editor-files-to-connect-them-to-your-cms)
* **Step 2:** [Storing and processing Setka Editor files](https://setka.gitbook.io/help-center/api/setka-editor-api/integration-with-style-manager/storing-and-processing-setka-editor-files)
* **Step 3:** [Connecting Setka Editor files to the pages of your site](https://setka.gitbook.io/help-center/api/setka-editor-api/integration-with-style-manager/connecting-setka-editor-files-to-the-pages-of-your-site)
* **Step 4:** [Receiving style updates from the Content Design System Manager and new editor versions](https://setka.gitbook.io/help-center/api/setka-editor-api/integration-with-style-manager/receiving-style-updates-from-the-style-manager-and-new-editor-versions)<br>

## Receiving compressed files (.gz)

In all the above-mentioned methods, you receive links to uncompressed resources. You can receive compressed versions from CDN by identifying an `Accept-Encoding` heading in a request.

E.g.:

```bash
curl -H 'Accept-Encoding: gzip' https://ceditor.setka.io/editor.v.1.2.3.min.js
```

## API Errors <a href="#h_fc667709-447e-401f-887f-be79f7bbc038" id="h_fc667709-447e-401f-887f-be79f7bbc038"></a>

Errors that Setka Editor API may return:

`HTTP/1.1 401 Unauthorized`

```javascript
{
  "error": "Not authorized!"
}
```

The error occurs as a result of a request with an incorrect license key (token).

`HTTP/1.1 422 Unprocessable Entity`

```javascript
{
  "errors": {
    "code": ["can't be blank"],
    "name": ["can't be blank"]
  }
}
```

The error appears as a result of an incorrect request.

You can contact our [support team](https://editor.setka.io/support) with any errors. We will be glad to help!&#x20;

## Links that might be useful <a href="#h_490431c3-e6fb-4f91-b93b-30117f466f35" id="h_490431c3-e6fb-4f91-b93b-30117f466f35"></a>

* [The latest version of API documentation](https://editor.setka.io/docs/api2/index.html)
* [Ruby on Rails integration example](https://github.com/setkaio/grid-editor-integration)
* Master domain for requests acceptance and resources recipient: `https://editor.setka.io`.

## More about custom integration: <a href="#h_7619f003-2739-4479-b4ba-a25dee5bf312" id="h_7619f003-2739-4479-b4ba-a25dee5bf312"></a>

* [Introduction to Custom Integration](https://setka.gitbook.io/help-center/api/setka-editor-api/introduction-to-custom-integration)
* [Setka Post Editor initialization (JavaScript)](https://setka.gitbook.io/help-center/api/setka-editor-api/setka-post-editor-initialization-javascript)
