微信開發系列之十 - 在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的社交媒體訊息
- 前端傳送的請求,是如何請求到後端服務的?前端後端
- jmeter 傳送 UDP 請求,怎麼接收伺服器返回的 TCP 服務資料JMeterUDP伺服器TCP
- 如何透過文字服務轉發在iPad和Mac上傳送和接收簡訊iPadMac
- 微信程式開發系列教程(二)使用JavaScript給微信使用者傳送訊息JavaScript
- 微信小程式網路請求應用->傳送引數返回伺服器內容微信小程式伺服器
- 通過PowerShell傳送TCP請求TCP
- okhttp 原始碼解析 - 網路協議的實現 - 請求流程: 請求的傳送與響應的接收HTTP原始碼協議
- 微信小程式-發起請求微信小程式
- 微信開發服務號鑑權
- 微信程式開發系列教程(二)微信訂閱號+人工智慧問答服務人工智慧
- java TCP入門程式設計(檔案傳送、服務端接收多個客戶端請求)JavaTCP程式設計服務端客戶端
- SAP Cloud for Customer(C4C)和微信整合系列教程Cloud
- axios傳送post請求,request.getParamter接收不到iOS
- 微信開發示例(連結資訊的接收)
- 使用requests庫來傳送HTTP請求HTTP
- 微信開發 沒有認證過的服務號怎麼辦?微信提供了測試號(開通了認證過的服務號的功能)...
- 請求傳送者與接收者解耦——命令模式(五)解耦模式
- 請求傳送者與接收者解耦——命令模式(三)解耦模式
- 請求傳送者與接收者解耦——命令模式(二)解耦模式
- Go語言開發傳送Get和Post請求Go
- SAP系統和微信整合的系列教程之一:微信開發環境的搭建開發環境
- 傳入http請求的UserAgent 根據它判斷是手機還是電腦傳送過來的請求HTTP
- 微信開發系列之七 - 使用Redis儲存微信聊天記錄Redis
- HttpSendRequest向服務端傳送資料,構造請求http頭HTTP服務端
- Postman傳送Post請求Postman
- Java傳送Post請求Java
- 傳送GET請求 示例
- HttpClient--傳送請求HTTPclient
- perl傳送http請求HTTP
- java傳送http請求JavaHTTP
- SAP UI5 應用的 OData 後設資料請求的傳送原理分析UI
- dart系列之:瀏覽器中的舞者,用dart傳送HTTP請求Dart瀏覽器HTTP
- 使用 request 和 cheerio 庫來傳送 HTTP 請求HTTP
- 微信小程式開發系列六:微信框架API的呼叫微信小程式框架API
- 在python中使用itchat傳送微信訊息Python
- 微信開發系列教程(二)
- jmeter之傳送json資料的post請求JMeterJSON