Skip to content

Embed Parts API

The embed module serves a sign-in form, a domain checker and a contact form under /embed/ for other websites to show in a frame. These calls read and save which websites may do so (Websites allowed to embed). See Embed forms on other websites for the embed code.

Admin calls need Module access on the Embed card of the staff group’s Permissions tab, plus each call’s own permission below (Super Administrators have all). See Authentication.

POST /api/admin/embed/get_settings

Returns the websites allowed to show the embedded forms in a frame.

Permission: Manage settings (embed.manage_settings)

No parameters.

Returns: An object with allowed_origins: a list of origins such as https://example.com. An empty list means only your own ClientFence site may frame them.

Example

Request parameters:

{}

result:

{
"allowed_origins": [
"https://example.com",
"https://www.example.com"
]
}

POST /api/admin/embed/save_settings

Saves the websites allowed to show the embedded forms in a frame, replacing the list.

Permission: Manage settings (embed.manage_settings)

Parameter Type Description
allowed_origins string One origin per line: https:// or http://, the host name and an optional port, no path (a trailing / is removed). Up to 20. Empty: your own site only.

Returns: true

Errors:

Example

Request parameters:

{
"allowed_origins": "https://example.com\nhttps://www.example.com"
}

result:

true