Skip to main content

Dashboard Apps

Dashboard Apps allow organizations to embed an application inside the Hoory dashboard and provide the context for customer support agents. This feature allows users to create an application independently and embed it to provide user information, their orders, or their payment history.

When you embed your application using the dashboard in Hoory, your application will get the context of the conversation and contact as a window event. Implement a listener for the message event on your page to receive the context.

interactive_messages

How to Create a Dashboard App

  1. Navigate to Settings > Integrations > Dashboard apps
  2. Click the "Add new dashboard app" button
  3. Add your app name and the URL of your app

Receiving Data from Hoory into Your App

Hoory will send you the context of the conversation and the contact as a window event. You can listen to it in your app as described below.

window.addEventListener("message", function (event) {
if (!isJSONValid(event.data)) {
return;
}

const eventData = JSON.parse(event.data);
});

Explicitly Requesting Data from Hoory

If your use case requires you to request the conversation data on demand from Hoory, you can easily do so by sending a simple message to the parent window using the javascriptpostMessage api.

Hoory will be listening to this key hoory-dashboard-app:fetch-info.

Example

You can query the dashboard app using the following code. Hoory will be listening to this key and immidiately send the requester with the updated conversation payload.

window.parent.postMessage('hoory-dashboard-app:fetch-info', '*')

// You would get a message in the on message listener with the appContext payload.

Event Payload

Conversation Object

{
"meta": {
"sender": {
"additional_attributes": {
"description": "string",
"company_name": "string",
"social_profiles": {
"github": "string",
"twitter": "string",
"facebook": "string",
"linkedin": "string"
}
},
"availability_status": "string",
"email": "string",
"id": "integer",
"name": "string",
"phone_number": "string",
"identifier": "string",
"thumbnail": "string",
"custom_attributes": "object",
"last_activity_at": "integer"
},
"channel": "string",
"assignee": {
"id": "integer",
"account_id": "integer",
"availability_status": "string",
"auto_offline": "boolean",
"confirmed": "boolean",
"email": "string",
"available_name": "string",
"name": "string",
"role": "string",
"thumbnail": "string"
},
"hmac_verified": "boolean"
},
"id": "integer",
"messages": [
{
"id": "integer",
"content": "Hello",
"inbox_id": "integer",
"conversation_id": "integer",
"message_type": "integer",
"content_type": "string",
"content_attributes": {},
"created_at": "integer",
"private": "boolean",
"source_id": "string",
"sender": {
"additional_attributes": {
"description": "string",
"company_name": "string",
"social_profiles": {
"github": "string",
"twitter": "string",
"facebook": "string",
"linkedin": "string"
}
},
"custom_attributes": "object",
"email": "string",
"id": "integer",
"identifier": "string",
"name": "string",
"phone_number": "string",
"thumbnail": "string",
"type": "string"
}
}
],
"account_id": "integer",
"additional_attributes": {
"browser": {
"device_name": "string",
"browser_name": "string",
"platform_name": "string",
"browser_version": "string",
"platform_version": "string"
},
"referer": "string",
"initiated_at": {
"timestamp": "string"
}
},
"agent_last_seen_at": "integer",
"assignee_last_seen_at": "integer",
"can_reply": "boolean",
"contact_last_seen_at": "integer",
"custom_attributes": "object",
"inbox_id": "integer",
"labels": "array",
"muted": "boolean",
"snoozed_until": null,
"status": "string",
"timestamp": "integer",
"unread_count": "integer",
"allMessagesLoaded": "boolean",
"dataFetched": "boolean"
}

Contact Object

{
"additional_attributes": {
"description": "string",
"company_name": "string",
"social_profiles": {
"github": "string",
"twitter": "string",
"facebook": "string",
"linkedin": "string"
}
},
"availability_status": "string",
"email": "string",
"id": "integer",
"name": "string",
"phone_number": "+91 9000000001",
"identifier": "string || null",
"thumbnail": "+91 9000000001",
"custom_attributes": {},
"last_activity_at": "integer"
}

Current Agent Object

{
"email": "string",
"id": "integer",
"name": "string"
}

Final Payload

{
"event": "appContext",
"data": {
"conversation": {
// <...Conversation Attributes>
},
"contact": {
// <...Contact Attributes>
},
"currentAgent": {
// <...Current agent Attributes>
}
}
}