Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Messaging Agent API : Failed to send rich content, socket closed with code 4410 #46

Open
MengjiaoZhou opened this issue Feb 8, 2018 · 4 comments

Comments

@MengjiaoZhou
Copy link

Hi I've trying to send rich content with messaging agent API "PublishEvent". I followed the example code in github, updated dialogId, however it failed to send rich content and socket closed with code 4410, see the log in following image. Can you please help take a look? Note that, I'm able to send plain text successfully.

Besides, regarding the parameters in "publishEvent", what does 'MY_CARD_ID' mean? What id should I use?

Here's the code snippet:
agent.publishEvent({
dialogId: dialogId,
event: {
type: LpEventTypeEnum.RichContentEvent,
content: {
"type": "vertical",
"elements": [
{
"type": "image",
"url": "http://cdn.mos.cms.futurecdn.net/vkrEdZXgwP2vFa6AEQLF7f-480-80.jpg?quality=98&strip=all",
"tooltip": "image tooltip",
"click": {
"actions": [
{
"type": "navigate",
"name": "Navigate to store via image",
"lo": 23423423,
"la": 2423423423
}
]
}
},
{
"type": "text",
"text": "product name (Title)",
"tooltip": "text tooltip",
"style": {
"bold": true,
"size": "large"
}
},
{
"type": "text",
"text": "product name (Title)",
"tooltip": "text tooltip"
},
{
"type": "button",
"tooltip": "button tooltip",
"title": "Add to cart",
"click": {
"actions": [
{
"type": "link",
"name": "Add to cart",
"uri": "http://www.google.com"
}
]
}
},
{
"type": "horizontal",
"elements": [
{
"type": "button",
"title": "Buy",
"tooltip": "Buy this product",
"click": {
"actions": [
{
"type": "link",
"name": "Buy",
"uri": "http://www.google.com"
}
]
}
},
{
"type": "button",
"title": "Find similar",
"tooltip": "store is the thing",
"click": {
"actions": [
{
"type": "link",
"name": "Buy",
"uri": "http://www.google.com"
}
]
}
}
]
},
{
"type": "button",
"tooltip": "button tooltip",
"title": "Publish text",
"click": {
"metadata": [
{
"type": "ExternalId",
"id": "MY_ACTION_ID"
}
],
"actions": [
{
"type": "publishText",
"text": "my text"
}
]
}
},
{
"type": "button",
"tooltip": "button tooltip",
"title": "Navigate",
"click": {
"actions": [
{
"type": "publishText",
"text": "my text"
},
{
"type": "navigate",
"name": "Navigate to store via image",
"lo": 23423423,
"la": 2423423423
}
]
}
}
]
}
}
}, null, [{type: 'ExternalId', id: 'MY_CARD_ID'}]);

image

@miki2826
Copy link
Contributor

miki2826 commented Feb 8, 2018

Hi @MengjiaoZhou, Image URLs needs to be whitelisted. did you white list the URL in the configurations?
Regarding MY_CARD_ID: it is your ability to add metadata on the line (not mandatory), it can help you later to track the cards you sent.

@MengjiaoZhou
Copy link
Author

MengjiaoZhou commented Feb 8, 2018 via email

@donmanguno
Copy link
Contributor

@MengjiaoZhou your LivePerson Account Manager can help you with this as it is a back-end configuration

@donmanguno
Copy link
Contributor

@MengjiaoZhou Did this help? If you still need this taken care of and provide your account number I can whitelist http://cdn.mos.cms.futurecdn.net/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants