Whenever the Onboarding page loads, a Zoho CRM function asks Glance for a sign-in link. It works once, within 60 seconds, and keeps the browser signed in for 7 days. Your client never sees the portal's password.
Make a Glance API key
- In Glance, open Settings, then Developers.
- Click Create key, name it Zoho and create it.
- Copy it now. It starts with cg_live_, and Glance shows it only once.
Add the function in Zoho CRM
Zoho Desk's help center can't run code when someone clicks, so the function lives in Zoho CRM. The free edition has no functions. Enterprise has them, and so does its free trial.
- In Zoho CRM, open Setup, then Developer Hub, then Variables, and create a variable. Name it Glance API key, with the API name glance_api_key and the type Single Line. Its value is Bearer, a space, then your key. Save it.
- Open Developer Hub, then Functions, and click Create Function. Type glance_onboarding as the display name and the function name, pick the Standalone category, keep Deluge and click Create.
- Delete what's in the editor and paste the code below. Its first line must match the function's name. Swap acme-partner for your client's portal slug, the last part of the portal's address, then click Save.
- Back in the list of functions, hover glance_onboarding, click the 3 dots next to it and pick REST API. Turn on API Key, click Save and copy the URL Zoho shows.
string standalone.glance_onboarding()
{
// Opens one Glance portal, signed in, each time the Onboarding tab loads.
// Change acme-partner to your client's portal slug.
headers = Map();
headers.put("Authorization",zoho.crm.getOrgVariable("glance_api_key"));
headers.put("Content-Type","application/json");
body = {"slug":"acme-partner","clientRef":"zoho-desk"};
resp = invokeurl
[
url :"https://clientglance.com/api/v1/portals/openLink"
type :POST
parameters:body.toString()
headers:headers
detailed:true
];
reply = Map();
if(resp.get("responseCode") == 200)
{
link = resp.get("responseText").toMap().get("data").get("openUrl");
reply.put("status_code",302);
reply.put("headers",{"Location":link,"Cache-Control":"no-store"});
}
else
{
info resp.get("responseText");
reply.put("status_code",502);
reply.put("headers",{"Content-Type":"text/plain","Cache-Control":"no-store"});
reply.put("body","We couldn't open your portal. Reload the page to try again.");
}
return {"crmAPIResponse":reply};
}Add the Onboarding tab in Zoho Desk
- In Zoho Desk, open Help Center, then click the + button at the top and pick Article. Title it Onboarding.
- In the editor, open Insert, pick Insert HTML and paste the frame below, with your function URL in src. Click Insert: the portal shows in the editor, signed in.
- Under Display permission, pick All users, or Registered users if only signed-in clients should see it. Click Publish. The article's address ends in /kb/articles/onboarding.
<iframe src="PASTE_THE_FUNCTION_URL_HERE"
style="width:100%;height:900px;border:0"
title="Onboarding"></iframe>- In Zoho Desk's Setup, open Help Center under Channels, click your help center, then Customization.
- Click Customize on the theme marked Live, then HTML, then Header.
- Paste the tab below right after the Home tab's closing </li>, then click Publish. If the article's address differs, fix it in href.
<li class="Header__tabsTab">
<a href="/portal/en/kb/articles/onboarding">Onboarding</a>
</li>Let Zoho frame the portal
- In Glance, open the portal's editor, then Details.
- Under Sites that can embed this portal, click Add Zoho Desk, then save. That adds Zoho Desk's addresses for the .com, .eu and .in data centers.
- If your help center runs on your own domain, like help.youragency.com, add that address too.
Open your help center and click Onboarding. The portal shows inside the page, signed in.
If it doesn't open
- The frame shows the password page: the link was spent or more than 60 seconds old. Reload the page to get a new one.
- The frame says the site refused to connect: the help center's address isn't on the portal's list. Add it and save.
- The frame says it couldn't open your portal: open the function in Zoho CRM and click the green play button. Its log shows Glance's answer, like a wrong slug or a revoked key.