> ## Documentation Index
> Fetch the complete documentation index at: https://docs.feedspace.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Embed Code

> Return the two-line embed snippet for a Wall of Love page or a widget: the `<div class="feedspace-embed">` element followed by the `<script>` tag that loads it. This is the same snippet the dashboard Share tab copies. Name the resource with `type` (`page` or `widget`) and pass its `id`. The id is resolved within the workspace your API key belongs to, so an id from another workspace, or one that does not exist, returns 404.

Get the two-line embed snippet for a Wall of Love page or a widget: the
`<div class="feedspace-embed">` element and the `<script>` tag that loads it. This is the
same code the dashboard Share tab copies.

## Choosing the resource

Set `type` to `page` for a Wall of Love page or `widget` for a widget, and pass its `id`.

### Where the `id` comes from

| `type` | `id` | Where to find it |
| - | - | - |
| `page` | `unique_page_id` (for example `page_3quM56ynXjoHeUsRPqrBe1f9`) | [All Pages](/api-reference/WallOfLove/all-pages) |
| `widget` | the widget's id | Copy it from the widget's **Share** tab in the dashboard |

The `id` is resolved within the workspace your API key belongs to. An `id` from another
workspace, or one that does not exist, returns `404`.

## Response

| Field | Type | Description |
| - | - | - |
| `type` | string | Echoes the `type` you requested. |
| `id` | string | Echoes the `id` you requested. |
| `embed_code` | string | The two-line snippet to paste into a web page. For a Wall of Love page it reflects the page's own dark-background setting. |


## OpenAPI

````yaml GET /embed-code
openapi: 3.1.0
info:
  title: Feedspace API
  description: Feedspace API v3 - Feedback and testimonial management platform
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.feedspace.io/v3
security: []
paths:
  /embed-code:
    get:
      tags:
        - Embed Code
      summary: Get embed code
      description: >-
        Return the two-line embed snippet for a Wall of Love page or a widget:
        the `<div class="feedspace-embed">` element followed by the `<script>`
        tag that loads it. This is the same snippet the dashboard Share tab
        copies. Name the resource with `type` (`page` or `widget`) and pass its
        `id`. The id is resolved within the workspace your API key belongs to,
        so an id from another workspace, or one that does not exist, returns
        404.
      operationId: getEmbedCode
      parameters:
        - name: type
          in: query
          description: >-
            What the embed code is for: `page` for a Wall of Love page, or
            `widget` for a widget.
          required: true
          schema:
            type: string
            enum:
              - page
              - widget
        - name: id
          in: query
          description: >-
            The id of the page or widget. A page id (`unique_page_id`) comes
            from the All Pages endpoint. A widget id is copied from the widget's
            Share tab in the dashboard.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The embed code was found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  type:
                    type: string
                  id:
                    type: string
                  embed_code:
                    type: string
              examples:
                widget:
                  summary: Widget embed code
                  value:
                    type: widget
                    id: b1d0f3c2-3f4a-4a2b-9c5e-9f0a1b2c3d4e
                    embed_code: >-
                      <div class="feedspace-embed"
                      data-id="b1d0f3c2-3f4a-4a2b-9c5e-9f0a1b2c3d4e"></div><script
                      src="https://js.feedspace.io/v1/embed/embed.min.js"
                      type="text/javascript" async></script>
                page:
                  summary: Wall of Love page embed code
                  value:
                    type: page
                    id: page_3quM56ynXjoHeUsRPqrBe1f9
                    embed_code: >-
                      <div class="feedspace-embed"
                      data-id="a2c1e4d3-5b6a-4c7d-8e9f-0a1b2c3d4e5f"></div><script
                      src="https://js.feedspace.io/v1/embed/embed.min.js"
                      type="text/javascript" async></script>
        '401':
          description: The API key is missing or invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
        '404':
          description: No page or widget with that id exists in the key's workspace.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
              examples:
                not_found:
                  value:
                    message: >-
                      No page or widget with that id was found in your
                      workspace.
        '422':
          description: Validation failed (for example an unknown `type`).
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
      security:
        - basicAuth: []
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: >-
        HTTP Basic Authentication using API Key and Secret Key. The credentials
        should be Base64 encoded in the format 'api_key:secret_key'. You can
        obtain your API Key and Secret Key from Feedspace → Automation → API
        (https://app.feedspace.io/automation/api).

````