Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to pass the metadata when a new request comes from a chat widget from an external website.

By default, we have a few fields and values in Chat Information when the chat is initiated below is the screenshot for reference which shows what are all the default values.

...

In addition to this If we want to add custom fields or values it’s possible by adding metadata code in the HTML. Below is the code that has to be added.

Code Block
languagehtml
<html>
<body>
<script src="https://chat-api.spartez-software.com/chat-widget.js" defer></script>
<chat-widget
jira-id="8ad73648-24b8-3d3c-bf91-f75ff508305b"
service-desk-id="1"
primary-color="#2D60D8" text-color="#FFFFFF"
metadata="[
            { name: 'Ext', value: 'Yes', render: true, },
            { name: 'Website', value: 'https://appfire.com', render: true, },
            { name: 'User', value: 'NA', render: false, },
          ]"
auto-show="true"></chat-widget>
<chat-widget auto-show="false"></chat-widget>
</body>
</html>

Here metadata should be between <chat-widget> </chat-widget> tags

Here name indicates the field name and value indicates the field value and render indicates to show the field/value or not, render has only two values true/false.

Here is the example of metadata:

...