当前位置:网站首页>Charging interface docking tutorial of enterprise and micro service provider platform
Charging interface docking tutorial of enterprise and micro service provider platform
2022-07-06 08:37:00 【renkai721】
Preface
1、 The previous process was for users to add third-party applications , Then login , Then operate .
2、 The current process is for users to add third-party applications , Then the service provider buys an account , The service provider receives... When the user adds a third-party application or when the user logs in 【unlicensed_notify】 Interface license expiration notification , Authorize to activate the user , Then the user logs in , Then operate .
Official documents of enterprises and micro enterprises
Description of platform charging mode adjustment for service providers
Platform interface license fee
Enterprise and micro service provider background management operation tutorial
1、 Users in the enterprise and micro application market developed by search service providers 3 Square application , If the application name 【 Weather assistant 】. Then click Install .
2、 At this time, the background service of the service provider will receive several messages pushed by Tencent server , as follows
// this 2 A message needs to be parsed by itself , Processing logic
// We have no 3 When the service provider receives this notice, it can tell the administrator , Log in to the background to buy an account for this customer company
"InfoType"="create_auth"
// Received the news , You can activate the user , You must purchase an account number first , Generally, you can buy a basic service account
"Event"="subscribe"
// Received the news , It indicates that the user's current account is not activated , The user account is not authorized
"Event"="unlicensed_notify"
3、 If the server receives 【create_auth】 news , It can be done by email , Enterprise wechat news , Enterprise micro webhook Robot messages are notified to relevant personnel , Let them log in to the background of the service provider and start buying accounts .
4、 The background login address of the service provider is as follows , Be sure to log in with administrator privileges .
// You must log in with administrator privileges
https://open.work.weixin.qq.com/wwopen/login
5、 First add the company to test , Otherwise, you won't see the intercepted message , Adding a testing company also requires scanning the code of the company's administrator account , Otherwise, the addition is unsuccessful .
6、 Purchase interface
7、 Buy an account number for the customer of the service provider , Testing companies don't need money , Direct payment is 0, Click submit order .
8、 Be sure to record the order , Later, if you call through the interface, you need to use the order number .
9、 Check the order just purchased , Click to view the test enterprise account .
10、 You can see the account you just bought , Click the account to activate the user . Only one company account can be operated at a time .
11、 Specific operation page , Activate employees under the company .
12、 After all the above operations , Users can log in and access our service provider applications normally , The interface of user information called in the program will not report an error . The login operation is exactly the same as that of previous service providers .
13、 If you don't buy an account , Do not activate the user's account , Then the following interfaces cannot be called .
14、 If the user is not activated , It will jump directly to the inactive page , Let's show you .
15、 If the user is not activated , Tencent server will push messages to us . The message is as follows
16、 in other words , When we receive this message , It can be called by program API Interface to activate the user .
17、 After the user account is activated , Will not directly jump to our home page . We need to push a message to users , Tell him , His account has been activated , You can log in and use . Then he quit the app , Log in again and you can log in to the home page .
java Background code tutorial
1、 Get the account list in the order
Get the account list in the order
Query the list of platform capability service accounts under the specified order . If you pay for the order of the purchase account or the version migration order of the stock enterprise , Then return to the account activation code list ; If it is an order of renewal account , Then return the member list of the renewal account . Be careful , If the order of purchase account , Then only when the order payment is completed , The system will generate an account , So before the payment is completed , This interface will not return the account activation code .
Request mode : POST(HTTPS)
Request address : https://qyapi.weixin.qq.com/cgi-bin/license/list_order_account?provider_access_token=ACCESS_TOKEN
Request packet :
{
"order_id" : "XXXXXXXX",
"limit":1000,
"cursor":"xxxx"
}
Parameter description :
Parameters Whether must explain
provider_access_token yes Application service provider's interface call credentials , See the certificate of the service provider for the acquisition method
order_id yes The order number
limit no Maximum number of records returned , integer , Maximum 1000, The default value is 500
cursor no Cursor for paging query , String type , Returned by the last call , For the first call, do not fill
----------------------------- Interface interpretation
1、 After the user installs the application , The service background will receive the subscription message , We need to log in to the background of enterprise and micro service provider with an administrator account , Buy an account for this enterprise , Then save the order number to the database , Our program reads the order number .
2、 Calling 【 Order purchase account 】,【 Get order list 】,【 Get order details 】 Get the order number through these three interfaces , Buy directly on the page , Here, you can directly read the order number of the database , Manually add the latest order number to the database .
3、cursor When this field is called for the first time, it is empty , Tencent server will return next_cursor, You have to use order_id As key, Put this next_cursor recorded , Otherwise, the next call will find out the activation code that has been used .
4、 It is better not to call this interface , After purchasing an account directly on the page , Save all accounts directly to the database , Read the activation code directly from the database .
5、 Tencent will buy an account , Generate all activation codes at one time .
2、 Activate your account
Activate your account
After placing an order to purchase an account and paying , First call the account list interface in the order to get the account activation code , Then you can call this interface to bind the activation code to an enterprise employee , To activate the corresponding platform service capabilities .
One userid It is allowed to activate a basic account and an interworking account .
Request mode : POST(HTTPS)
Request address : https://qyapi.weixin.qq.com/cgi-bin/license/active_account?provider_access_token=ACCESS_TOKEN
Request packet :
{
"active_code" : "XXXXXXXX",
"corpid": "CORPID",
"userid": "USERID"
}
Parameter description :
Parameters Whether must explain
provider_access_token yes Application service provider's interface call credentials , See the certificate of the service provider for the acquisition method
active_code yes Account activation code
corpid yes The enterprise of the member to be bound and activated corpid, Only encrypted corpid
userid yes Enterprise members to be bound and activated userid . Only encrypted userid
----------------------------- Interface interpretation
1、 there corpid It's the customer's corpid, It's encrypted . It's not that 【wwe The one at the beginning 】. Found by testing , As long as the employees of the service provider's own company log in , To get the corpid Are encrypted , Only employees of their own company log in , That's the message I received wwe At the beginning , At this time, you need to change yourself , You can call the following interface for conversion .
2、corpid Adapter =https://qyapi.weixin.qq.com/cgi-bin/service/corpid_to_opencorpid?provider_access_token=ACCESS_TOKEN
3、corpid Translation interface document address =https://developer.work.weixin.qq.com/document/path/95327
4、 There is a simple way , Is to buy an account for your company in the background of the service provider , Then click on the account number to see your company's encrypted corpid 了 , It is recommended to record directly after manual conversion , Write directly to the configuration file or database later , No need to call interface conversion .
5、userId Only our own companies need encryption , Others' accounts have been encrypted , You can use it directly .
6、userid Adapter =https://qyapi.weixin.qq.com/cgi-bin/batch/userid_to_openuserid?access_token=ACCESS_TOKEN
7、userid Translation interface document address =https://developer.work.weixin.qq.com/document/path/95327
8、 Pay attention to ,userid Transformation is to pass access_token,corpid Transformation requires provider_access_token, These two are different .
3、 Be careful , After user activation , Need to login again , It will not directly jump to our homepage from the inactive page .
NOTE:
1、 If you still have questions , Please leave a message , I will reply as soon as I see the message .
边栏推荐
- Mobile Test Engineer occupation yyds dry goods inventory
- @JsonBackReference和@JsonManagedReference(解决对象中存在双向引用导致的无限递归)
- win10系统中的截图,win+prtSc保存位置
- egg. JS project deployment online server
- sublime text的编写程序时的Tab和空格缩进问题
- 延迟初始化和密封类
- Browser thread
- 【刷题】牛客网面试必刷TOP101
- 2022.02.13 - NC004. Print number of loops
- 同一局域网的手机和电脑相互访问,IIS设置
猜你喜欢
Image, CV2 read the conversion and size resize change of numpy array of pictures
软件卸载时遇到trying to use is on a network resource that is unavailable
Analysis of the source code of cocos2d-x for mobile game security (mobile game reverse and protection)
深度剖析C语言指针
synchronized 解决共享带来的问题
What is CSRF (Cross Site Request Forgery)?
C語言雙指針——經典題型
2022.02.13 - NC004. Print number of loops
sublime text中conda环境中plt.show无法弹出显示图片的问题
2022.02.13 - NC003. Design LRU cache structure
随机推荐
Problems in loading and saving pytorch trained models
egg. JS getting started navigation: installation, use and learning
延迟初始化和密封类
Pointer advanced --- pointer array, array pointer
Trying to use is on a network resource that is unavailable
hutool优雅解析URL链接并获取参数
LDAP Application Section (4) Jenkins Access
LDAP應用篇(4)Jenkins接入
企微服务商平台收费接口对接教程
Chrome浏览器的crash问题
[2022 广东省赛M] 拉格朗日插值 (多元函数极值 分治NTT)
marathon-envs项目环境配置(强化学习模仿参考动作)
Precise query of tree tree
2022 Inner Mongolia latest construction tower crane (construction special operation) simulation examination question bank and answers
堆排序详解
sys. argv
vulnhub hackme: 1
Permutation and combination function
2022 Inner Mongolia latest water conservancy and hydropower construction safety officer simulation examination questions and answers
LDAP application (4) Jenkins access