365体育备用网址报道6.1.4给用户打标签_365体育备用网址官网资讯

批量给用户打标签的接口如下:
https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging?access_token=ACCESS_TOKEN
接口运行时,提交POST数据例子如下:

{
    "openid_list":[
        "oiPuduGV7gJ_MOSfAWpVmhhgXh-U",
        "oiPuduBAk2wcGe8QH955kbDZctOg"
    ],
    "tagid":103
}

要求参数说明如表6-5所示:

表6-5给用户打标签要求参数说明
该接口的核心代码实现如下:

 1$access_token = "-4fPq655nSH7ruHqEIIAxVyDpbRZFL4yPudfMuVhcin5PorYwWiTL7RZNuNlsSw_z_MDK5HCd4IKP0VpPBSLID41kWMOKvT1OBXvgt2UjeG1hZhdBuTF9DpG0XcMAG35ZAVjAIALMH";
 2
 3$data = '{
 4     "openid_list":[
 5         "oiPuduJnJSC0D3Eet7_i2IJwj-5k",
 6         "oiPuduBAk2wcGe8QH955kbDZctOg"
 7     ],
 8     "tagid":103
 9 }';
10$url = "https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging?access_token=$access_token";
11$result = https_request($url, $data);
12var_dump($result);
13
14function https_request($url, $data = null)
15 {
16$curl = curl_init();
17     curl_setopt($curl, CURLOPT_URL, $url);
18     curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
19     curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);
20if (!empty($data)){
21         curl_setopt($curl, CURLOPT_POST, 1);
22         curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
23     }
24     curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
25$output = curl_exec($curl);
26     curl_close($curl);
27return$output;
28 }

上述代码执行后,返回如下:

{"errcode": 0, "errmsg": "ok"}
------分隔线----------------------------

公布评论 (116人察看0条评论)
请自觉遵守互联网相关的政策法规,严禁公布色情、暴力、反动的言论。
用户名: 验证码: 点击我更换国际金多宝娱乐
最新评论