乐于分享
好东西不私藏

appId和appSecret利用方法

appId和appSecret利用方法

文章首发于https://www.freebuf.com/articles/web/469130.html

微信小程序及公众号

参考链接: 

https://developers.weixin.qq.com/doc/subscription/guide/dev/api/

获取accesstoken

https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET

在获取accesstoken后可利用其他接口获取微信服务信息

获取微信API服务器IP

https://api.weixin.qq.com/cgi-bin/get_api_domain_ip?access_token=ACCESS_TOKEN

获取微信推送服务器IP

https://api.weixin.qq.com/cgi-bin/getcallbackip?access_token=ACCESS_TOKEN

操作评论

  1. 删除评论
POST /cgi-bin/comment/delete?access_token=ACCESS_TOKEN HTTP/1.1Hostapi.weixin.qq.comContent-Typeapplication/jsonContent-Length80{  "msg_data_id"MSG_DATA_ID,  "index"0,  "user_comment_id"USER_COMMENT_ID}

  1. 回复评论
POST /cgi-bin/comment/reply/add?access_token=ACCESS_TOKEN HTTP/1.1Hostapi.weixin.qq.comContent-Typeapplication/jsonContent-Length80{  "msg_data_id" : MSG_DATA_ID,  "index"0,  "user_comment_id"COMMENT_ID,  "content""内容"

  1. 删除回复
POST /cgi-bin/comment/reply/delete?access_token=ACCESS_TOKEN HTTP/1.1Hostapi.weixin.qq.comContent-Typeapplication/jsonContent-Length80{  "msg_data_id" : MSG_DATA_ID,  "index"0,  "user_comment_id"COMMENT_ID}

企业微信

参考链接:

https://developer.work.weixin.qq.com/document/path/91039

获取accesstoken

 https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET

获取企业微信接口IP段

 https://qyapi.weixin.qq.com/cgi-bin/get_api_domain_ip?access_token=ACCESS_TOKEN

获取企业微信回调IP段

https://qyapi.weixin.qq.com/cgi-bin/getcallbackip?access_token=ACCESS_TOKEN

创建成员

POST /cgi-bin/user/create?access_token=ACCESS_TOKEN HTTP/1.1Hostqyapi.weixin.qq.comContent-Typeapplication/jsonContent-Length320{"userid": "zhangsan","name": "张三","mobile": "+86 13800000000","department": [1],"position": "产品经理","gender": "1","email": "zhangsan@qq.com","enable": 1,"main_department": 1,"to_invite": true,"external_position": "高级产品经理"}

读取成员

https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token=ACCESS_TOKEN&userid=USERID

获取部门成员

https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID

获取部门成员详情

https://qyapi.weixin.qq.com/cgi-bin/user/list?access_token=ACCESS_TOKEN&department_id=DEPARTMENT_ID

邀请成员

POST /cgi-bin/batch/invite?access_token=ACCESS_TOKEN HTTP/1.1Hostqyapi.weixin.qq.comContent-Typeapplication/jsonContent-Length108{   "user": ["UserID1", "UserID2", "UserID3"],   "party": [1, 2, 3],   "tag": [101, 102, 103]}

获取加入企业二维码

https://qyapi.weixin.qq.com/cgi-bin/corp/get_join_qrcode?access_token=ACCESS_TOKEN&size_type=SIZE_TYPE

获取成员ID列表

POST /cgi-bin/user/list_id?access_token=ACCESS_TOKEN HTTP/1.1Hostqyapi.weixin.qq.comContent-Typeapplication/jsonContent-Length108{"cursor": "xxxxxxx","limit"10000}

飞书

参考链接:

https://open.feishu.cn/document/server-docs/api-call-guide/calling-process/get-access-token

获取accesstoken

POST https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal HTTP/1.1Host: open.feishu.cnContent-Type: application/json; charset=utf-8Content-Length: 88{    "app_id""APP_ID",    "app_secret""APP_SECRET"}

获取用户信息

GET /open-apis/contact/v3/users/7be5fg9a?department_id_type=open_department_id&user_id_type=open_id HTTP/1.1Hostopen.feishu.cnAuthorization: accesstoken

钉钉

参考文档:

https://open.dingtalk.com/document/development/obtain-user-token

https://developer.aliyun.com/ask/532363

获取accesstoken

https://oapi.dingtalk.com/gettoken?appkey=your_app_key&appsecret=your_app_secret&grant_type=client_credential

企业内部应用accesstoken

POST /v1.0/oauth2/accessToken HTTP/1.1Host:api.dingtalk.comContent-Type:application/json{  "appKey" : "dingeqqpkv3xxxxxx",  "appSecret" : "GT-lsu-taDAxxxsTsxxxx"}

获取微应用后台免登的accessToken

POST /v1.0/oauth2/ssoAccessToken HTTP/1.1Host:api.dingtalk.comContent-Type:application/json{  "corpid" : "String",  "ssoSecret" : "String"}

获取部门列表

POST /topapi/v2/department/listsub?access_token=ACCESS_TOKEN HTTP/1.1Hostoapi.dingtalk.comContent-Typeapplication/json; charset=utf-8Content-Length42{    "dept_id": 1,    "language": "zh_CN"}
本站文章均为手工撰写未经允许谢绝转载:夜雨聆风 » appId和appSecret利用方法

评论 抢沙发

4 + 9 =
  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
×
订阅图标按钮