Skip to content

Backend API

The Stripo Plugin Backend API allows for various operations related to compiling and managing email templates, including inlining CSS styles into HTML tags to provide the final HTML code ready to be sent to recipients. Please take a look at the available methods below.

Compiling Email Templates

This API call allows inlining CSS styles into HTML tags and provides the final HTML code of email templates that are ready to be sent to recipients.

OpenAPI Specification

Reference
yaml
openapi: 3.0.3
info:
  title: Compiling Email Templates
  description: |
    This API call allows inlining CSS styles into HTML tags and provides the final HTML code of email templates that are ready to be sent to recipients.
servers:
  - url: https://plugins.stripo.email
    description: Stripo API server
paths:
  /coediting/v1/email/compilation:
    get:
      tags:
        - Methods
      summary: Get compiled email
      description: Get compiled inline CSS into HTML email templates.
      parameters:
        - name: minimize
          in: query
          required: false
          description: >-
            If true then html code will be in a format of a single line without
            line breaks
          schema:
            type: boolean
            example: false
        - name: inlineCss
          in: query
          required: false
          description: >
            Allows you to select the type of code in the received compiled
            email. 
              inlineCss: true - by default. This means that we will see CSS placed inside tags when we make a compiled form of HTML. 
              inlineCss: false - editor will not inline the CSS in the tags, but rather write it at the head of the email.
          schema:
            type: boolean
            example: false
        - name: ES-PLUGIN-AUTH
          in: header
          required: true
          description: Stripo plugin auth token in the format - Bearer ${AUTH_TOKEN}
          schema:
            type: string
        - name: ES-PLUGIN-UI-DATA
          in: header
          required: true
          description: > 
            JSON string with parameters to identify email (Same as metadata param in UI editor). For example: {"emailId": "id1"}
          schema:
            type: string
      responses:
        '200':
          description: Compiled email
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompiledEmail'
components:
  schemas:
    CompiledEmail:
      type: object
      properties:
        html:
          type: string
          description: Compiled HTML
        ampHtml:
          type: string
          description: Compiled AMP version of HTML
        ampErrors:
          type: array
          description: List of AMP errors inside AMP HTML email template
          items:
            type: string
        syncModules:
          type: array
          description: List of IDs of sync modules what was found in the HTML
          items:
            type: integer
            format: int64
        conditions:
          type: array
          description: List of AMP errors inside AMP HTML email template
          items:
            $ref: '#/components/schemas/Condition'
    Condition:
      type: object
      properties:
        id:
          type: string
          description: Condition ID
        name:
          type: string
          description: Condition name
        description:
          type: string
          description: Condition description
        beforeScript:
          type: string
          description: Content of beforeScript section
        afterScript:
          type: string
          description: Content of afterScript section

Retrieving HTML and CSS (Legacy Compatibility)

This API call allows you to retrieve HTML and CSS from the “reference email” in Stripo’s database. This is particularly useful for maintaining compatibility with older versions of the Stripo editor.

OpenAPI Specification

Reference
yaml
openapi: 3.0.3
info:
  title: Retrieving HTML and CSS (Legacy Compatibility)
  description: |
    Returns HTML with developer markup and classes, along with CSS, to be stored within your database. This method ensures that when a customer wants to open an email with the editor (old plugin) next time, the stored HTML and CSS can be sent to the editor, maintaining compatibility with legacy systems and preserving the email's design and structure.
servers:
  - url: https://plugins.stripo.email
    description: Stripo API server
paths:
  /coediting/v1/email/html-css:
    get:
      tags:
        - Methods
      summary: Get HTML and CSS of email template
      description: Get HTML with developer markup and classes, along with CSS
      parameters:
        - name: ES-PLUGIN-AUTH
          in: header
          required: true
          description: Stripo plugin auth token in the format - Bearer ${AUTH_TOKEN}
          schema:
            type: string
        - name: ES-PLUGIN-UI-DATA
          in: header
          required: true
          description: >
            JSON string with parameters to identify email (Same as metadata param in UI editor). For example: {"emailId": "id1"}
          schema:
            type: string
      responses:
        '200':
          description: HTML and CSS of email template
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HtmlCss'
components:
  schemas:
    HtmlCss:
      type: object
      properties:
        html:
          type: string
          description: HTML of email template
        css:
          type: string
          description: CSS of email template
        emailId:
          type: integer
          format: int64
          description: ID of email
        utm:
          $ref: '#/components/schemas/UtmParams'
          description: UTM params of email template
    UtmParams:
      type: object
      properties:
        source:
          type: string
          description: UTM source
        medium:
          type: string
          description: UTM medium
        campaign:
          type: string
          description: UTM campaign
        content:
          type: string
          description: UTM content
        term:
          type: string
          description: UTM term
        custom:
          description: UTM custom properties
          additionalProperties:
            type: string
            nullable: true

This API call allows you to update timer links in the HTML code when copying an email template outside the Stripo editor. It ensures that the timers are correctly cloned and updated in the new template.

OpenAPI Specification

Reference
yaml
openapi: 3.0.1
info:
  title: Timer Clone API
  description: This API call allows you to update timer links in the HTML code when copying an email template outside the Stripo editor. It ensures that the timers are correctly cloned and updated in the new template.
servers:
  - url: https://plugins.stripo.email
paths:
  /api/v1/timers/clone:
    post:
      tags:
        - Methods
      summary: Updating Timer Block Links
      description: Clone timers and update timer links in HTML
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                html:
                  type: string
                  description: HTML code containing timer links
                  example: 'Timer link: ...'
              required:
                - html
      parameters:
        - in: header
          name: ES-PLUGIN-AUTH
          required: true
          schema:
            type: string
          description: Authorization token
          example: Bearer YOUR_AUTH_TOKEN
      responses:
        '200':
          description: Successful response with updated HTML and timer mapping
          content:
            application/json:
              schema:
                type: object
                properties:
                  html:
                    type: string
                    description: HTML code with updated timer links
                    example: 'Timer link: ...'
                  timersMap:
                    type: object
                    description: Mapping of old timer IDs to new timer IDs and URLs
                    additionalProperties:
                      type: object

Access to Stripo Templates

Stripo provides access to a variety of email templates that you can use based on your subscription plan. If you have registered your account and integrated your plugin application, you can access these templates.

Template Access Based on Plan:

  • FREE Plan: Access to basic templates only.
  • STARTUP Plan: Access to basic templates and those marked as FREE.
  • BUSINESS and ENTERPRISE Plans: Access to basic, free, and PREMIUM templates.

How to Access Templates

After making the initial request to get an array of the available templates, you will need to make individual calls for each template to retrieve its HTML and CSS.

Step-by-Step Process

  1. Get List of Templates: Make a request to retrieve an array of available templates based on your plan.
    Endpoint:
    GET /bapi/plugin-templates/v1/templates
  2. Get HTML and CSS for Each Template: For each template in the array, make separate requests to retrieve its HTML and CSS.
    Endpoint:
    GET /bapi/plugin-templates/v1/templates/{templateId}

OpenAPI Specification

Reference
yaml
openapi: 3.0.0
info:
  title: Stripo Email Template API
  description: |
    Stripo provides access to a variety of email templates that you can use based on your subscription plan. If you have registered your account and integrated your plugin application, you can access these templates.

    After making the initial request to get an array of the available templates, you will need to make individual calls for each template to retrieve its HTML and CSS.
servers:
  - url: https://my.stripo.email/bapi/plugin-templates
paths:
  /v1/templates:
    get:
      tags:
        - Methods
      summary: Get Templates
      description: Get templates matching the specified search criteria.
      parameters:
        - name: type
          in: query
          required: true
          schema:
            type: string
            enum: [BASIC, FREE, PREMIUM]
          description: Specifies the variety of templates to be returned.
        - name: sort
          in: query
          schema:
            type: string
            enum: [NEW, ACTUAL]
            default: ACTUAL
          description: Defines how the templates are sorted in response.
        - name: limit
          in: query
          schema:
            type: integer
          description: Regulates how many items should be returned per page (suggested limit of no more than 50).
        - name: page
          in: query
          schema:
            type: integer
          description: Defines the number of the page.
        - name: templateTypes
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Filters templates that specifically pertain to relevant categories.
        - name: templateSeasons
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Restricts the selection of templates to those associated with seasonal events categories.
        - name: templateFeatures
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Ensures that only templates related to specific feature categories are retrieved.
        - name: templateIndustries
          in: query
          schema:
            type: array
            items:
              type: integer
          description: Narrows down template selection to include only those featuring industry-specific categories.
      responses:
        '200':
          description: A list of templates matching the search criteria.
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: integer
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        templateId:
                          type: integer
                        name:
                          type: string
                        logo:
                          type: string
                        premium:
                          type: boolean
                        hasAmp:
                          type: boolean
                        updatedAt:
                          type: integer
                        createdTime:
                          type: integer
                        templateTypes:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
                        templateSeasons:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
                        templateFeatures:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
                        templateIndustries:
                          type: array
                          items:
                            type: object
                            properties:
                              id:
                                type: integer
                              name:
                                type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/{templateId}:
    get:
      tags:
        - Methods
      summary: Get Template Details
      description: Get the metadata, HTML, and CSS code for a specific template by ID.
      parameters:
        - name: templateId
          in: path
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: Metadata, HTML, and CSS code for the specified template.
          content:
            application/json:
              schema:
                type: object
                properties:
                  templateId:
                    type: integer
                  name:
                    type: string
                  logo:
                    type: string
                  premium:
                    type: boolean
                  hasAmp:
                    type: boolean
                  updatedAt:
                    type: integer
                  createdTime:
                    type: integer
                  templateTypes:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  templateSeasons:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  templateFeatures:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  templateIndustries:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: integer
                        name:
                          type: string
                  html:
                    type: string
                  css:
                    type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/types:
    get:
      tags:
        - Methods
      summary: Get Template Types
      description: Get available values for the templateTypes parameter.
      responses:
        '200':
          description: Array of available values for the templateTypes parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/seasons:
    get:
      tags:
        - Methods
      summary: Get Template Seasons
      description: Get available values for the templateSeasons parameter.
      responses:
        '200':
          description: Array of available values for the templateSeasons parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/features:
    get:
      tags:
        - Methods
      summary: Get Template Features
      description: Get available values for the templateFeatures parameter.
      responses:
        '200':
          description: Array of available values for the templateFeatures parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

  /v1/templates/industries:
    get:
      tags:
        - Methods
      summary: Get Template Industries
      description: Get available values for the templateIndustries parameter.
      responses:
        '200':
          description: Array of available values for the templateIndustries parameter.
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                    name:
                      type: string
      security:
        - ES-PLUGIN-AUTH: []

components:
  securitySchemes:
    ES-PLUGIN-AUTH:
      type: apiKey
      in: header
      name: ES-PLUGIN-AUTH
      description: Bearer YOUR_AUTH_TOKEN

Detailed Explanation

Get Templates

/v1/templates

  • Summary: Get templates matching the specified search criteria.

  • Parameters:

    • type (required, query): Specifies the variety of templates to be returned (BASIC, FREE, PREMIUM).
    • sort (query): Defines how the templates are sorted in response (NEW, ACTUAL).
    • limit (query): Regulates how many items should be returned per page (suggested limit of no more than 50).
    • page (query): Defines the number of the page.
    • templateTypes (query): Filters templates that specifically pertain to relevant categories.
    • templateSeasons (query): Restricts the selection of templates to those associated with seasonal events categories.
    • templateFeatures (query): Ensures that only templates related to specific feature categories are retrieved.
    • templateIndustries (query): Narrows down template selection to include only those featuring industry-specific categories.

Get Template Details

/v1/templates/{templateId}

  • Summary: Get the metadata, HTML, and CSS code for a specific template by ID.

  • Parameters:

    • templateId (required, path): The ID of the template.

Get Template Types

/v1/templates/types

  • Summary: Get available values for the templateTypes parameter.

Get Template Seasons

/v1/templates/seasons

  • Summary: Get available values for the templateSeasons parameter.

Get Template Features

/v1/templates/features

  • Summary: Get available values for the templateFeatures parameter.

Get Template Industries

/v1/templates/industries

  • Summary: Get available values for the templateIndustries parameter.