微信开发系列之十 - 在SAP C4C接收微信发送过来的服务请求回应
发布日期:2021-06-30 14:29:17 浏览次数:2 分类:技术文章

本文共 1821 字,大约阅读时间需要 6 分钟。

文章系列目录

In previous blog it is already achieved that Wechat user can directly talk to the subscription account in Wechat app and a new Service Request ( and a social media message ) will automatically be created in C4C system under custom channel created for Wechat.

With this message ID 59189 we can find its associated Service Request:

It comes very naturally that once a C4C agent replies this Service Request in the system, the reply will not only appear in C4C UI:

but also directly pushed to end user’s Wechat app:

Implementation detail

(1) Create a new Mashup service with type “REST Service”:

Maintain the following settings:

When the service request is replied in C4C, a json string will be sent to the url configured in this Mashup service ( http://wechatjerry.herokuapp.com/fromc4c ) by a HTTP Post. The json string contains the ID of original social media message created when the end user sent the text to Wechat app in the beginning.

Assign this Mashup service to your custom channel for Wechat created in previous blog.

(2) React to the HTTP Post request in your nodejs server by adding a new route for url /fromc4c, which is configured in your Mashup service done in previous step.

The following logics are done in this module:

(1) get social media message detail based on message ID from payload sent from C4C system
(2) The social media user profile ID is stored as a field of message detail fetched from Step 1.

Get user profile detail data based on its ID.

(3) The ID of Wechat user who has initially sent the text to C4C system is contained in social media
user profile detail data. With this ID available now we can call module postMessageToUser to send
the text maintained in C4C system to user’s Wechat app.

These three steps are done in another three separate modules:

要获取更多Jerry的原创文章,请关注公众号"汪子熙":

转载地址:https://jerry.blog.csdn.net/article/details/108294049 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:使用literal或者绑定变量执行SAP HANA SQL语句
下一篇:微信开发系列之九 - 在微信里直接创建SAP C4C的社交媒体消息

发表评论

最新留言

不错!
[***.144.177.141]2024年04月23日 01时02分27秒