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:
To access your own account. In this case, do not use the
account_key
orobserve_account
params.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 theobserve_account
param.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 to1
.
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 |
---|---|
| Should be set to “embed_token” |
| If If |
| 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:
{
"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.