LivePersonInc / node-agent-sdk

LivePerson Agent Messaging SDK for NodeJS
MIT License
49 stars 78 forks source link

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

Open MengjiaoZhou opened 6 years ago

MengjiaoZhou commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

What configuration file is used to whitelist imageurl? On Wed, Feb 7, 2018 at 10:13 PM Michael Dimenshtein < notifications@github.com> wrote:

Hi @MengjiaoZhou https://github.com/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.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/LivePersonInc/node-agent-sdk/issues/46#issuecomment-364013271, or mute the thread https://github.com/notifications/unsubscribe-auth/AQLhiOaruMvw2riImnxtuDYgxnjefzAwks5tSpCZgaJpZM4R9mMZ .

donmanguno commented 6 years ago

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

donmanguno commented 6 years ago

@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/