Once you fetch your data and are ready to format it, what is the best way to do so?
There are only 3 required fields when passing data into Dimension, but being aware of all the possible fields and how to format them are equally important when it comes to configuring your unstructured data to be passed into Dimension.
The main requirements are User ID, Message, and a timestamp. However, there are several pieces of Metadata that you are already collecting that may be useful for analyzing and enriching your unstructured data. Metadata such as Intents and Events are not required, but when passed through to Dimension, these data elements can be leveraged to produce higher fidelity enrichments, insights and visualizations.
Below are some fields or parameters you can send to Dimension along with the format needed.
Message Format
You can send the following fields:
Parameter | Description | Type |
---|---|---|
text | Required Text of the message | String |
userId | Required This should be the same userId for both incoming and outgoing messages. This is not the bot’s user ID | String |
intent | (Optional) An object containing intent metadata | Object |
images | (Optional) Urls to any images | Array<Object> |
buttons | (Optional) Button options in the message | Array<Object> |
postback | (Optional) Record of any button clicks | Object |
platformJson | (Optional) Send your platform-specific message JSON here. It will be available for viewing in your transcripts. Reporting on this data is available with our enterprise plan. | Object |
platformUserJson | (Optional) send any user-specific information (ie. zipcode, A/B test group, etc). Reporting on this data is available from audience builder, with our enterprise plan. If you use these exact field names, they will be used in the expected places on reports:
| Object |
sessionId | (Optional) if you do not want to calculate sessions based on the 5-minute message timeout, you may send sessionId instead. | String |
dimension_timestamp | (Optional) if you want to use your server timestamp you can send a unix-timestamp value see Advanced Usage for more information | Number |
Additional Metadata Format
If you're sending metadata fields, the following formats are needed:
The intent object includes:
Parameter | Description | Type |
---|---|---|
name | name of intent | String |
inputs | intent inputs | Array<Object> |
The intent input object has fields:
Parameter | Description | Type |
---|---|---|
name | input name | String |
value | input value | String |
The images field contains image objects that have the fields:
Parameter | Description | Type |
---|---|---|
url | url of the image | String |
The buttons field contains button objects that have the fields:
Parameter | Description | Type |
---|---|---|
id | id of the button | String |
label | label for the button | String |
value | value of the button | String |
The postback includes the fields:
Parameter | Description | Type |
---|---|---|
buttonClick | Button click object | Object |
The button click object includes:
Parameter | Description | Type |
---|---|---|
buttonId | id of the clicked button | String |