Embeds Version 1

Note: This documentation describes Version 1 of our API, which is now depreciated. It will continue to work, but it will not reveive any updates or bug fixes. We recommend you use Version 2 instead. Documentation for this resource for Version 2 of our API is available here.

This document describes the embed resource as implemented by the Action Network.

Embeds are copy-and-paste javascript code that will embed the related action form on any website. This is an Action Network-only feature.

Embed resources have two embed fields, one with styles and one without, to allow you to control the look of your embed.

Note: Embeds are read-only and only available for actions created with our user interface.

Sections:

URL structures

URL Structures:

https://actionnetwork.org/api/v1/[action_type]/[action_id]/embed

To address a specific embed resource, use the identifier of the specific action you want embed code for without the action_network: prefix to construct a URL, like https://actionnetwork.org/api/v1/events/21789f03-0180-45d3-853c-91bd6fdc8c07/embed

Back To Top ↑

Field names and descriptions

Field Name Type Required on POST Description
embed_with_styles string n/a An HTML representation of the embed code with default styles. Copy and paste into any web page to embed this action page's form. Action Network-only, system generated, not editable.
embed_no_styles string n/a An HTML representation of the embed code without any styles. Copy and paste into any web page to embed this action page's form. Action Network-only, system generated, not editable.
Back To Top ↑

Links

Link Name Description
self A link to this individual event resource.
Back To Top ↑

Scenario: Retrieving an embed resource for an individual action (GET)

Calling the embed resource for an individual action will return the resource directly, along with all associated fields and appropriate links to additional information about the embed.

Request

						
GET https://actionnetwork.org/api/v1/events/21789f03-0180-45d3-853c-91bd6fdc8c07/embed

Header:
api-key:[your api key here]
					

Response

						
200 OK

Content-Type: application/hal+json
Cache-Control: max-age=0, private, must-revalidate


{
  "embed_with_styles": "<link href='https://actionnetwork.org/css/style-embed.css' rel='stylesheet' type='text/css' /><script src='https://actionnetwork.org/widgets/event/my-free-event?format=js&source=widget'></script><div id='can-event-area-my-free-event' style='width: 100%'><!-- this div is the target for our HTML insertion --></div>",
  "embed_no_styles": "<script src='https://actionnetwork.org/widgets/event/my-free-event?format=js&source=widget'></script><div id='can-event-area-my-free-event' style='width: undefined'><!-- this div is the target for our HTML insertion --></div>",
  "_links": {
    "self": {
      "href": "https://actionnetwork.org/api/v1/events/21789f03-0180-45d3-853c-91bd6fdc8c07/embed"
    },
    "curies": [
      {
        "name": "osdi",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      },
      {
        "name": "action_network",
        "href": "https://actionnetwork.org/docs/v1/{rel}",
        "templated": true
      }
    ]
  }
}
					
Back To Top ↑

Scenario: POST/PUT/DELETE

Posting, putting, and deleting embeds is not allowed. Attempts will result in errors.

Back To Top ↑