Embed modules in your website
Put the inbox and other modules from an account inside your own portal, without your users seeing any login.
In Developers, Embedded tab, you create keys that start with emb_. With them your server opens sessions for your users and your page shows the module inside a frame. Whoever enters has already logged in to your portal: you tell us who they are and we open the session for them.
Each key accesses only one account: your agency's or one of your clients'. You pick this when you create it and it doesn't change after. If you want each client to see only their data and their channels, give each one a key.
The key has the limits written in: which domains can embed it, which modules it can show, the maximum role (ADMIN, AGENT or VIEWER) and how long the session lasts. Even if your call asks for more, it gets cut down to what the key allows.
Usage takes four steps: you sign up your user once, your server asks for a pass, your page opens it in a frame and when the session ends, the frame tells you and you ask for another pass. Building the pass lets you pick what they'll be able to do and copy the call ready to use.
The notice that the session ended comes to your page as a message from the frame with type incrustado:sesion-caducada. Listen for it with a message listener and when it arrives, ask for another pass and put the frame back up. The API addresses you see in the tab come with your domain, the same one you use to enter the panel.
What you can do
- Create one key per site or per client, with a name to recognize it.
- Limit which domains can embed it: up to 10, one per line.
- Pick the modules: Inbox, CRM, Tasks, Contacts, Analytics, Inventory, Calendars, Broadcasts, Integrations and the assistant.
- In Integrations, check one by one what your client can connect from your web.
- Set the maximum role and how many minutes the session lasts without use, up to 480.
- Edit, rotate the secret, revoke, reactivate or delete each key.
Step by step
Go to Developers, Embedded tab, and click New key.
Give it a Name, choose Which account and write your Domains, one per line with https.
Check the Modules, the Maximum role and how long the session lasts. Click Save.
Copy the key right then: it's the only time you see it whole.
From your server, sign up each user once and ask for a pass each time your page is going to open the module.
An example
A portal with each client's inbox
- An agency has its own portal where the salespeople of its clients log in.
- It creates one key per client, each one pointing to that client's account, only with Inbox and CRM and maximum role AGENT.
- When a salesperson enters the portal, the agency's server asks for a pass with their id and the page opens the inbox in a frame.
- The salesperson answers the chats without seeing any login or leaving the portal.
- If a client leaves, the agency revokes their key and open sessions close in less than ten seconds.
Recommendations
- Ask for passes always from your server, never from the browser: whoever has the key can open a session in the name of any of your users.
- One key per client: nothing shows between accounts, and that way each one has their data and their channels.
- Give the minimum: only the modules that are needed and the lowest role that works.
- Ask for the pass right when you paint the page: it lasts a minute and works only once.
- To test on your computer you can put localhost as the domain.
Watch out for this
- If the domain you're embedding from is missing, the frame comes out blank and there's no error anywhere. Only domains with https and no asterisks work; with http, only localhost.
- Each user you sign up takes up one seat in that account's plan. If there's no room for more, we tell you when you sign them up, not inside the frame.
- Integrations can only be opened by an ADMIN: to offer it, the maximum role has to be ADMIN and you have to check at least one integration.
- There's a limit per key: 300 passes and 120 sign-ups per minute. If you go over, the Retry-After header tells you when to try again.
- The session renews itself while you work, but never lasts more than 8 hours from when it opened.
- Rotating makes the old key worthless right away and you have to change it in your server; open sessions stay alive. Revoking does close them.
- Deleting takes away the people you signed up with that key: they lose access and their seats become free. It can't be undone.
