Skip to main content
Skip table of contents

Embed Token

Generating an Embed Token

In order to use the Link Page Element widget and the Link Connection widget you will need an embed token.

You can create a new embed token via a GET request (using basic auth or API key) to https://admin.myintranetapps.com/app/api.php?action=embed_token with an "Account-Key" header set to "XXXX"  (where XXXX is your account key)

Embed tokens are only valid for one hour after they are generated.

Imagine your embed token as a ticket to an event, and the links where you are using the token as ticket booths. When you present your ticket/token, you will receive a wristband/cookie that allows you to access the event without having to show your ticket again for the next hour. In other words, you can skip providing the token when accessing future requests during that time.

There are three ways to use Embed Tokens:

  1. To access your own account. In this case, do not use the account_key or observe_account params.

  2. To access a customer account. In this case, account_key should be the account key of the customer account you are trying to access. Do not use the observe_account param.

  3. To access your own account and view a customer’s pages. In this case, account_key should be the account key of the customer whose pages you are trying to view. observe_account should be set to 1.

The Account-Key header is different from the account_key query parameter, the former is used to authenticate to the API, the latter is used to specify which account you need a token for

Parameter

Definition

action
REQUIRED

Should be set to “embed_token”

account_key
OPTIONAL

If observe_account is not set, this is the key of the account you wish to access.

If observe_account is set to 1, this is the key of the account whose pages you wish to view (while accessing your own account).

observe_account
OPTIONAL

If set to 1, you will access your own account with the ability to view another account’s pages.

The response you get back will be in JSON and look like:

JSON
{
	"status_code": 200,
	"message": "Embed token generated",
	"token": "et-629cb2c4-a972-47b5-8ed0-f4977a8a8010",
	"expires": "2022-09-08T23:48:59+00:00",
	"params": {
		"account_key": "5f66c0b15206d1.36412804",
		"observe_account": true,
		"redirect_url": false,
		"account_domain": "bank.myintranet.app"
	}
}

You will need to pass the token and account_domain properties as parameters when instantiating the Link Page Element widget

If something goes wrong while processing your GET request ("status_code" value will differ from 200), the "message" property will contain an error description.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.