<?php /** * Created by PhpStorm. * User: 青春已被放纵了 * Date: 2017/1/12 * Time: 14:24 */
//添加管理员 $access_token="w-IMwn19LbsSRZJIoBprGqw-1WzCtInxuh0qjSj8ND3qA3TJCrClM1A3Qts5XK22";//获取的access_token //echo $access_token;die; $data='{ "userid": "zhangsan", "name": "张三", "department": [1], "position": "产品经理", "mobile": "12345678901", "gender": "1", "email": "1234567890@qq.com", "weixinid": "zqd5288863", }'; $url='https://qyapi.weixin.qq.com/cgi-bin/user/create?access_token='.$access_token; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); $output = curl_exec($ch); var_dump($output);curl_close($ch);
//更新成员
- 请求说明
Https请求方式: POST
https://qyapi.weixin.qq.com/cgi-bin/user/update?access_token=ACCESS_TOKEN
请求包示例如下(如果非必须的字段未指定,则不更新该字段之前的设置值):
{ "userid": "zhangsan", "name": "李四", "department": [1], "position": "后台工程师", "mobile": "15913215421", "gender": "1", "email": "zhangsan@gzdev.com", "weixinid": "lisifordev", "enable": 1, }
//删除成员
想知道userid是什么吗 ?
其实userid就是账号
Https请求方式: GET
https://qyapi.weixin.qq.com/cgi-bin/user/delete?access_token=ACCESS_TOKEN&userid=zhangsan