Mendix integrated enterprise WeChat first experience

WeChat founder Zhang Xiaolong has talked a lot about the positioning of enterprise WeChat. He believes that enterprise WeChat is the product concept of people as a service. He also made a definition of enterprise WeChat:

"The follow-up new changes of enterprise WeChat are based on a new concept-hope that every enterprise employee will become the window of enterprise services. People are services, and they are certified services."

Enterprise WeChat is actually a carrier of private domain traffic. It can refine operations, reach users repeatedly, open up the payment system, and complete the monetization path, which satisfies the closed-loop business.

Friends who like the Mendix platform, if they want to open up corporate WeChat and expand the value of the Mendix platform, how should they integrate it? Mendix technical experts recently tried the restful call mechanism + enterprise WeChat API technology , and summarized several points. We also welcome you to leave a message to further exchange the best practices of enterprise integration technology and mobile native!


Research on Enterprise WeChat API

First, you need to create an account on the company's WeChat official account. Then, create a custom "MendixAPP" application.

 

You can find the "company ID" under the "My Company" tab.

After understanding the basic data of the company, we can move to: https://open.work.weixin.qq.com/api/doc/90000/90135/90236 , which is the company WeChat API development address, and learn how to use these API, for enterprises to access more personalized office applications.

Message push means that enterprise WeChat has opened up message sending interfaces, and enterprises can use these interfaces to enable two-way communication between custom applications and enterprise WeChat backends or users.

The first step of communication is to establish a trusted channel between the two parties. At this time, the client needs to obtain the token, which is regarded as a temporary door key issued to the client by the enterprise WeChat end. (Obtaining access_token is the first step to call the enterprise WeChat API interface, which is equivalent to creating a login credential. Other business API interfaces need to rely on access_token to authenticate the identity of the caller.)

The document https://open.work.weixin.qq.com/api/doc/90000/90135/91039  describes how to parse the "access_token" field from the Json of the response through a GET request:

After you have the token, you can refer to: https://open.work.weixin.qq.com/api/doc/90000/90135/90236 to send messages, including support for pushing text, pictures, videos, files, and graphics And other types.

After understanding the theory, the logic in Mendix only needs to solve the following three aspects:

  1. Restful sending and receiving

  2. Inbound and outbound json format mapping

  3. Alternate UI


Mendix part of the practice

Mendix adheres to the concept of no-code and low-code. In order to promote communication between business and professional and technical personnel, it adopts a model-driven formal logic expression. The entire text does not need to write a line of code to achieve token acquisition, message input, and sending To the enterprise WeChat end. In order to be more realistic, this PoC uses a mobile native mobile phone as the input of information. The effect is as follows:

Before sending:

After sending:

The above demonstration effects do not need coding, just correspond to Mendix, and use a micro-flow (the micro-flow runs on the server side, which allows you to express the logic of the application. The micro-flow can perform such as creating and updating objects, displaying pages, and Actions such as making choices. This is a visual way of expressing the traditional end of text program code. Unlike nanoflow, microflow cannot be used in offline applications) to summarize mainly (Mendix's microflow contains syntax , Semantics, and document annotation capabilities):

May wish to dig deeper and look at obtaining the server-side token. Mendix essentially inspired a Restful service ( https://docs.mendix.com/refguide/call-rest-action ), where we specify the REST of the enterprise WeChat The endpoint and get the response json message from it:

In the "Response" Tab page, you can map the json message that the response returns to the client, and store the required fields in the declared variables. By analogy, the activity that sends the enterprise WeChat also uses the Restful service, which is just a POST type. Due to Mendix's excellent flexibility in system integration, you can easily create any type of web service interface logic. The service message is xml or json, and it can also be mapped graphically:

For more information, please refer to: https://docs.mendix.com/refguide/integration-activities

Mobile native is one of Mendix's unique advantages. They use native UI elements to achieve fast performance, smooth animations (such as sliding gestures), and improve access to all native device features. You can also use familiar elements such as pages, widgets, nanoflow, JavaScript operations, and microflows to compose your application.

To use the mobile native development features of Mendix Studio Pro, you can use the Native Mobile Quickstart application in the Mendix Marketplace. This application is optimized to quickly build a native mode APP:

Although the above PoC is simple, you can see the business value brought by integration and the power of Mendix's low-code connection technology. More standards-based integration and connection capabilities are as follows:


For more information, please visit the following link:

Mendix official website: https://www.mendix.com/zh/

Mendix industry solutions: https://solutions.mendix.com/

Mendix platform guide: https://www.mendix.com/evaluation-guide/

Mendix animation display: https://www.mendix.com/demos/

Mendix public account

 

thanks for reading!

Guess you like

Origin blog.csdn.net/Mendix/article/details/115350388