微信開發系列之十 - 在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.
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的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2724270/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 微信開發系列之九 - 在微信裡直接建立SAP C4C的社交媒體訊息
- 使用WxPusher給自己的個人微信傳送提醒訊息(WxPusher微信推送服務)
- 微信程式開發系列教程(二)微信訂閱號+人工智慧問答服務人工智慧
- 微信開發系列之七 - 使用Redis儲存微信聊天記錄Redis
- 微信開發之微信域名防封介面
- 微信程式開發系列教程(二)使用JavaScript給微信使用者傳送訊息JavaScript
- 微信小程式開發系列六:微信框架API的呼叫微信小程式框架API
- SAP系統和微信整合的系列教程之一:微信開發環境的搭建開發環境
- 在python中使用itchat傳送微信訊息Python
- 微信開發系列之一 - 微信公眾號開發的開發環境搭建開發環境
- 微信團隊分享:微信後臺在海量併發請求下是如何做到不崩潰的
- 使用 laravel-wechat-notification 傳送微信模板訊息、企業微信應用訊息Laravel
- C#微信開發系列教程C#
- 微信小程式request請求的封裝微信小程式封裝
- 資料夾怎麼拖到微信 微信傳送資料夾的辦法
- 微信小程式開發系列七:微信小程式的頁面跳轉微信小程式
- 微信小程式開發系列教程三:微信小程式的除錯方法微信小程式除錯
- 微信小程式開發系列二:微信小程式的檢視設計微信小程式
- 微信小程式 request請求封裝微信小程式封裝
- 使用 Python 來自動回微信Python
- 微信圈(Wechat)—領先的微信行銷服務平臺
- go-zero之App微信支付服務GoAPP
- Nodejs開發微信公眾號中控服務NodeJS
- 微信小程式開發系列四:微信小程式之控制器的初始化邏輯微信小程式
- 前端傳送的請求,是如何請求到後端服務的?前端後端
- jmeter 傳送 UDP 請求,怎麼接收伺服器返回的 TCP 服務資料JMeterUDP伺服器TCP
- .Net微信網頁開發之使用微信JS-SDK呼叫微信掃一掃功能網頁JS
- .Net微信網頁開發之使用微信JS-SDK自定義微信分享內容網頁JS
- thinkphp整合系列之微信退款PHP
- 搭建微信小程式服務微信小程式
- 微信小程式服務推送微信小程式
- 基於THINKPHP5 多微信開發框架,讓微信開發飛起來PHP框架
- 微信怎麼傳送資料夾給好友 微信發生整個資料夾的辦法
- 巧用Koa接管“對接微信開發”的工作 - 多使用者微信JS-SDK API服務JSAPI
- 微信開發 PHP程式碼 免費送貨PHP
- SAP系統和微信整合的系列教程之二:如何通過微信公眾號消費APIAPI
- 微信程式開發系列教程(三)使用微信API給微信使用者發文字訊息API
- 【踩坑系列】傳送微信模板訊息返回40165 invalid weapp pagepathAPP