微信开发系列之十 - 在SAP C4C接收微信发送过来的服务请求回应

简介: 微信开发系列之十 - 在SAP C4C接收微信发送过来的服务请求回应

文章系列目录

Wechat development series 1 – setup your development environment

Wechat development series 2 – development Q&A service using nodejs

Wechat development series 3 – Trigger C4C Account creation in Wechat app

Wechat development series 4 – Send C4C Data change notification to Wechat app

Wechat development series 5 – embedded your UI5 application to Wechat app

Wechat development series 6 – Retrieve Wechat User info via oAuth2 and display it in UI5 application

Wechat development series 7 – use Redis to store Wechat conversation history

Wechat development series 8 – Map integration

Wechat development series 9 – Create C4C Social Media Message and Service within Wechat app

Wechat development series 10 – Use Wechat app to receive Service Request reply made from C4C

In previous blog Wechat development series 9 – Create C4C Social Media Message and Service within Wechat app 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.image.pngimage.pngimage.pngWith this message ID 59189 we can find its associated Service Request:

image.pngIt comes very naturally that once a C4C agent replies this Service Request in the system, the reply will not only appear in C4C UI:image.pngimage.pngbut also directly pushed to end user’s Wechat app:image.pngimage.png

Implementation detail

(1) Create a new Mashup service with type “REST Service”:image.pngMaintain the following settings:image.pngWhen 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.image.png(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.image.pngThe 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:image.png


相关文章
|
2月前
|
前端开发 开发者
【微信公众号对接】有关签名一直报错,提示invalid signature问题(我的签名和使用微信开发者工具验证返回的签名的是一致的)但还是报错!!!
【微信公众号对接】有关签名一直报错,提示invalid signature问题(我的签名和使用微信开发者工具验证返回的签名的是一致的)但还是报错!!!
60 0
|
16天前
|
开发工具
微信客服系统开发SDK使用教程- 拉取当前微信个人号列表请求(立即)
微信客服系统开发SDK使用教程- 拉取当前微信个人号列表请求(立即)
|
1月前
微信登陆报错:redirect_uri域名与后台配置不一致,错误码:10003 微信支付报错 微信登录报错 微信开发
微信登陆报错:redirect_uri域名与后台配置不一致,错误码:10003 微信支付报错 微信登录报错 微信开发
28 0
|
2月前
|
开发框架 小程序 前端开发
微信小程序封装请求
微信小程序封装请求
|
2月前
|
小程序 开发工具 开发者
【微信小程序】微信开发者工具 引用 vant-weapp时“miniprogram/node_modules/@babel/runtime/index.js: 未找到npm包入口文件” 解决办法
【微信小程序】微信开发者工具 引用 vant-weapp时“miniprogram/node_modules/@babel/runtime/index.js: 未找到npm包入口文件” 解决办法
119 1
|
2月前
|
小程序 开发者
【微信小程序】微信开发者工具 app.json: [“subpackages“][0][“root“] 字段需为目录 已解决
【微信小程序】微信开发者工具 app.json: [“subpackages“][0][“root“] 字段需为目录 已解决
28 0
|
2月前
|
小程序 开发者 Windows
【微信小程序】微信开发者工具 内容错误 pages/cart/cart.json: [“usingComonent“][“van-card“]: “@vant/weapp/card/indx“ 未找到
【微信小程序】微信开发者工具 内容错误 pages/cart/cart.json: [“usingComonent“][“van-card“]: “@vant/weapp/card/indx“ 未找到
55 0
|
2月前
|
小程序 前端开发 程序员
【微信小程序】-- 网络数据请求(十九)
【微信小程序】-- 网络数据请求(十九)
|
2月前
|
前端开发 开发者
【微信公众号对接】有关签名一直报错,提示invalid signature问题(我的签名和使用微信开发者工具验证返回的签名的是一致的)但还是报错!!!
【微信公众号对接】有关签名一直报错,提示invalid signature问题(我的签名和使用微信开发者工具验证返回的签名的是一致的)但还是报错!!!
63 0
|
2月前
|
小程序
uniapp 微信小程序请求拦截器 接口封装
uniapp 微信小程序请求拦截器 接口封装