Embeds Version 1
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
- Field names and descriptions
- Links
- Scenario: Retrieving an embed resource for an individual action (GET)
- Scenario: POST/PUT/DELETE
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
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. |
Links
Link Name | Description |
---|---|
self | A link to this individual event resource. |
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
Back To Top ↑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 } ] } }
Scenario: POST/PUT/DELETE
Posting, putting, and deleting embeds is not allowed. Attempts will result in errors.
Back To Top ↑