# Initial sync — receiving Setka Editor files to connect them to your CMS

{% hint style="info" %}
[An article for users of the previous API version.](../integration-with-style-manager-api-v1-previous-version)
{% endhint %}

To get style and editor files [configured in your account](https://editor.setka.io/), make the following request with your license key:

```
GET https://editor.setka.io/api/v2/integration?token=your-license-key
```

&#x20;**Response sample:**

```javascript
{
  "public_token": "123456789123456789123456789",
  "plugins": [
    {
      "url": "https://ceditor.setka.io/public.v.1.2.3.js",
      "filetype": "js",
      "md5": "asdfasdfasdf"
    }
  ],
  "content_editor_files": [
    {
      "id": 1,
      "url": "https://ceditor.setka.io/company.v.1.2.3.min.css",
      "filetype": "css",
      "md5": "asdfasdfasdf"
    },
    {
      "id": 1,
      "url": "https://ceditor.setka.io/company.v.1.2.3.min.js",
      "filetype": "js",
      "md5": "asdfasdfasdf"
    }
  ],
  "theme_files": [
    {
      "id": 1,
      "url": "https://ceditor.setka.io/company.v.1.2.3.min.css",
      "filetype": "css",
      "md5": "asdfasdfasdf"
    },
    {
      "id": 1,
      "url": "https://ceditor.setka.io/public.v.1.2.3.json",
      "filetype": "json",
      "md5": "asdfasdfasdf"
    }
  ],
  "standalone_styles": {
    "common": [
      {
        "id": 1,
        "url": "https://ceditor.setka.io/common_css/common_css_1.css",
        "filetype": "css"
      }
    ],
    "themes": [
      {
        "id": "1",
        "url": "https://ceditor.setka.io/clients/company/css/1.css",
        "filetype": "css"
      }
    ],
    "layouts": [
      {
        "id": "1",
        "url": "https://ceditor.setka.io/clients/company/layout_option_builds/1/1.css",
        "filetype": "css"
      }
    ]
  }
}
```

### Description for the received set of files: <a href="#h_1dfb3c92-7fdf-4a99-9717-80012f124e89" id="h_1dfb3c92-7fdf-4a99-9717-80012f124e89"></a>

| **File**                                                                                                                                                                                                               | **URL**                                                  | **Description**                                                                                                                                                                                                                                                                                                                                                          |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| public\_token                                                                                                                                                                                                          |                                                          | The Public key (`public_token`) — a public ID of the company, used to send auxiliary requests from the editor to the Style Manager. You can receive it in response to the initial synchronization or copy it from your CMS Integration page. The public key needs to be handled to [editor initialization](https://editor-help.setka.io/hc/en-us/articles/115002594865). |
| plugins                                                                                                                                                                                                                | <p>https://ceditor.setka.io</p><p>/public.v.1.2.3.js</p> | Scripts to launch interactive elements of a post (animations and galleries)                                                                                                                                                                                                                                                                                              |
| [content\_editor\_files](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#array-of-content_editor_files) |                                                          | An array of files for the editor                                                                                                                                                                                                                                                                                                                                         |
| [theme\_files](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#array-of-theme_files)                    |                                                          | An array of files responsible for posts display. Includes a general style file and an editor config file                                                                                                                                                                                                                                                                 |
| [standalone\_styles](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#array-of-standalone_styles)        |                                                          | An array of CSS files and rules for all the styles and grids of a company, created in the Style Manager                                                                                                                                                                                                                                                                  |

#### Array of content\_editor\_files

| **Type** | **URL**                                                        | **Description**                        |
| -------- | -------------------------------------------------------------- | -------------------------------------- |
| CSS      | <p>https://ceditor.setka.io</p><p>/company.v.1.2.3.min.css</p> | editor interface style file            |
| JS       | <p>https://ceditor.setka.io</p><p>/company.v.1.2.3.min.js</p>  | JavaScript of the Setka WYSIWYG Editor |

#### Array of theme\_files

| **Type** | **URL**                                                        | **Description**                                                                                                                                |
| -------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| CSS      | <p>https://ceditor.setka.io</p><p>/company.v.1.2.3.min.css</p> | Rules for all the styles and grids of a company, created in [Style Manager](https://editor.setka.io/)                                          |
| JSON     | <p>https://ceditor.setka.io</p><p>/public.v.1.2.3.json</p>     | Required for a proper launch of the Setka Editor tool. Contains all the info on styles configured in [Style Manager](https://editor.setka.io/) |

#### &#x20;Array of standalone\_styles&#x20;

To have your post reflected correctly, enable 3 CSS-files from standalone\_styles array of files:

| **File** | **URL**                                                                             | **Description**                      |
| -------- | ----------------------------------------------------------------------------------- | ------------------------------------ |
| common   | <p>https://ceditor.setka.io</p><p>/common_css/common_css_1.css</p>                  | Common rules for Setka Editor styles |
| themes   | <p>https://ceditor.setka.io/clients</p><p>/company/css/1.css</p>                    | A style for specific post            |
| layouts  | <p>https://ceditor.setka.io/clients</p><p>/company/layout_option_builds/1/1.css</p> | The layout grid used for your posts  |

### API request with additional parameters

To make an API request for the additional files, use an options parameter:\
&#x20;

```http
GET https://editor.setka.io/api/v2/integration?token=your-license-key
&options=amp,fonts,icons
```

Response sample:

```javascript
{
  "public_token": "123456789123456789123456789",
  "plugins": [
    {
      "url": "https://ceditor.setka.io/public.v.1.2.3.js",
      "filetype": "js",
      "md5": "asdfasdfasdf"
    }
  ],
  "content_editor_files": [
    {
      "id": 1,
      "url": "https://ceditor.setka.io/company.v.1.2.3.min.css",
      "filetype": "css",
      "md5": "asdfasdfasdf"
    },
    {
      "id": 1,
      "url": "https://ceditor.setka.io/company.v.1.2.3.js",
      "filetype": "js",
      "md5": "asdfasdfasdf"
    }
  ],
  "theme_files": [
    {
      "id": 1,
      "url": "https://ceditor.setka.io/editor.v.1.2.3.min.css",
      "filetype": "css",
      "md5": "asdfasdfasdf"
    },
    {
      "id": 1,
      "url": "https://ceditor.setka.io/public.v.1.2.3.json",
      "filetype": "json",
      "md5": "asdfasdfasdf"
    }
  ],
  "standalone_styles": {
    "common": [
      {
        "id": 1,
        "url": "https://ceditor.setka.io/common_css/common_css_1.css",
        "filetype": "css"
      }
    ],
    "themes": [
      {
        "id": "1",
        "url": "https://ceditor.setka.io/clients/company/css/1.css",
        "filetype": "css"
      }
    ],
    "layouts": [
      {
        "id": "1",
        "url": "https://ceditor.setka.io/clients/company/layout_option_builds/1/1.css",
        "filetype": "css"
      }
    ]
  },
  "amp_styles": {
    "common": [
      {
        "id": 1,
        "url": "https://ceditor.setka.io/common_css/common_css_1_amp.css",
        "filetype": "css"
      }
    ],
    "themes": [
      {
        "id": "1",
        "url": "https://ceditor.setka.io/clients/company/theme_builds/1/2.css",
        "filetype": "css",
        "fonts": [
          "https://fonts.googleapis.com/css?family=Open+Sans:400,700%7COpen+Sans+Condensed:400,400i,700&subset=cyrillic&display=swap"
        ]
      }
    ],
    "layouts": [
      {
        "id": "1",
        "url": "https://ceditor.setka.io/clients/1/layout_option_builds/1/2.css",
        "filetype": "css"
      }
    ]
  },
  "icons": [
    {
      "id": 1,
      "url": "https://ceditor.setka.io/clients/company/css/assets/1/img/icon-name.png",
      "filetype": "image"
    }
  ],
  "fonts": [
    {
      "id": 1,
      "url": "https://ceditor.setka.io/clients/company/css/assets/fonts/1/font-name.woff",
      "filetype": "font"
    }
  ]
}
```

### Description of a received array of files

| **File**                                  | **URL**                                                                                         | **Description**                                                                                                                                                                                                                                                      |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [amp\_styles](#amp_styles-array-of-files) |                                                                                                 | An array of files needed to reflect posts correctly on AMP pages                                                                                                                                                                                                     |
| icons                                     | <p>https://ceditor.setka.io/clients</p><p>/company/css/assets</p><p>/1/img/icon-name.png</p>    | Icons that are uploaded in your style. You should download these files only if the style is hosted on your server. Icons are downloaded via Setka CDN by default in General or Separated style files; no additional actions needed                                   |
| fonts                                     | <p>https://ceditor.setka.io/clients</p><p>/company/css/assets</p><p>/fonts/1/font-name.woff</p> | Custom .woff fonts uploaded into your styles in the Style Manager. You should download these files only if the style is hosted on your server. Icons are downloaded via Setka CDN by default in General or Separated style files; no additional actions are needed.  |

## **amp\_styles array of files**

| **File** | **URL**                                                                       | **Description**                     |
| -------- | ----------------------------------------------------------------------------- | ----------------------------------- |
| common   | <p>https://ceditor.setka.io</p><p>/common_css/common_css_1_amp.css</p>        | Common rules for AMP pages styles   |
| themes   | <p>https://ceditor.setka.io</p><p>/clients/company/theme_builds/1/2.css</p>   | A style for specific post           |
| layouts  | <p>https://ceditor.setka.io</p><p>/clients/1/layout_option_builds/1/2.css</p> | The grid layout used for your posts |

### API request for specific arrays of files

To get the needed array of files, add a select parameter to your request, then enumerate these files separated by commas:

```
GET https://editor.setka.io/api/v2/integration?token=your-license-key
&select=plugins,editor,theme,standalone,amp,fonts,icons
```

## &#x20;List of available files

| **File**               | **Type**  | **Description**                                              |
| ---------------------- | --------- | ------------------------------------------------------------ |
| plugins                | JS        | Scripts that help running interactive elements of your posts |
| content\_editor\_files | JS, CSS   | JS and CSS editor files                                      |
| theme\_files           | JSON, CSS | JSON config file and a concatenated CSS file                 |
| standalone\_styles     | CSS       | Separate style files                                         |
| amp\_styles            | CSS       | AMP styles                                                   |
| fonts                  | WOFF      | Custom fonts                                                 |
| icons                  | PNG, SVG  | Icons                                                        |
