Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of user Group developed by Wechat

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces the example analysis of the user group developed by Wechat. What is introduced in the article is very detailed and has certain reference value. Interested friends must finish reading it!

1: create a user group

Wechat, like QQ, can create a group name, delete a group name, modify a group name, and query a group name. These operations are all a series of interfaces. You only need to call the relevant API and send it in the form of curl to get the relevant results.

Create grouping

A public account supports the creation of up to 100 groups.

API call request description

Http request method: POST (please use https protocol) https://api.weixin.qq.com/cgi-bin/groups/create?access_token=ACCESS_TOKEN

POST data format: json

POST data example: {"group": {"name": "test"}}

Parameter description

Parameter description

Access_token call interface credential

Name grouping name (within 30 characters)

Example of JSON packet returned when normal:

{

"group": {

"id":

"name": "test"

}

}

The following is the implementation of the related code

We need to send the packet in the form of curl, and the result is a json data in the form of StdClass. We need to convert the stdClass into an array, so we create a func.php file, and the related operations of the following groups are based on these functions.

Using the access_token above, we can do whatever we want.

First we create the group, and we name the file creategroup.php

1 interface display

It looks like a very simple HTML code. I believe anyone with a HTML foundation can write it.

So how do you create a group? Quite simply, we just need to submit the API link to create the group in the past.

Related code

Untitled document

New grouping

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report