wechat 0.8.10 → 0.8.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +5 -0
- data/README-CN.md +103 -103
- data/README.md +104 -103
- data/bin/wechat +3 -3
- data/lib/wechat/api.rb +13 -5
- data/lib/wechat/controller_api.rb +0 -1
- data/lib/wechat/ticket/jsapi_base.rb +8 -1
- metadata +17 -17
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 286b9044ac0251344656ec83b579f90ee2c7f87c
|
|
4
|
+
data.tar.gz: 0cca2037ba22fdeaa014ff5ba22bacf9f1de8c69
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96bfbb1119ac71a13bc6ee8cfca78fc8222ef0f4f16c559a7298c8707071c95d52fc52a751297e6d9606a7eac7b8a45501a099b6c09bc74b5ecf2897667b3305
|
|
7
|
+
data.tar.gz: ad6e1808cb90c14b1856529e2a8bb0a560bffc2a907f7c4f5167d0e75a4bf998e0c8a0f1e63eff14a78160f288836daa03b9710d08531f9bbec0dfed42db5307
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.8.11 (released at 7/25/2017)
|
|
4
|
+
|
|
5
|
+
* oauth2 state code not refresh at the same time of jsapi tickets refresh bug, many thanks @xiewenwei #192
|
|
6
|
+
* Add string type scene support for qrcode_create_scene. by @libuchao #191
|
|
7
|
+
|
|
3
8
|
## v0.8.10 (released at 6/19/2017)
|
|
4
9
|
|
|
5
10
|
* fix material_delete correctly.
|
data/README-CN.md
CHANGED
|
@@ -290,115 +290,115 @@ wechat gems 内部不会检查权限。但因公众号类型不同,和微信
|
|
|
290
290
|
```
|
|
291
291
|
$ wechat
|
|
292
292
|
Wechat Public Account commands:
|
|
293
|
-
wechat callbackip
|
|
294
|
-
wechat custom_image [OPENID, IMAGE_PATH]
|
|
295
|
-
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL]
|
|
296
|
-
wechat custom_news [OPENID, NEWS_YAML_PATH]
|
|
297
|
-
wechat custom_text [OPENID, TEXT_MESSAGE]
|
|
298
|
-
wechat custom_video [OPENID, VIDEO_PATH]
|
|
299
|
-
wechat custom_voice [OPENID, VOICE_PATH]
|
|
300
|
-
wechat customservice_getonlinekflist
|
|
301
|
-
wechat group_create [GROUP_NAME]
|
|
302
|
-
wechat group_delete [GROUP_ID]
|
|
303
|
-
wechat group_update [GROUP_ID, NEW_GROUP_NAME]
|
|
304
|
-
wechat groups
|
|
305
|
-
wechat material [MEDIA_ID, PATH]
|
|
306
|
-
wechat material_add [MEDIA_TYPE, PATH]
|
|
307
|
-
wechat material_count
|
|
308
|
-
wechat material_delete [MEDIA_ID]
|
|
309
|
-
wechat material_list [TYPE, OFFSET, COUNT]
|
|
310
|
-
wechat media [MEDIA_ID, PATH]
|
|
311
|
-
wechat media_hq [MEDIA_ID, PATH]
|
|
312
|
-
wechat media_create [MEDIA_TYPE, PATH]
|
|
313
|
-
wechat media_uploadimg [IMAGE_PATH]
|
|
314
|
-
wechat media_uploadnews [MPNEWS_YAML_PATH]
|
|
315
|
-
wechat menu
|
|
316
|
-
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH]
|
|
317
|
-
wechat menu_create [MENU_YAML_PATH]
|
|
318
|
-
wechat menu_delconditional [MENU_ID]
|
|
319
|
-
wechat menu_delete
|
|
320
|
-
wechat menu_trymatch [USER_ID]
|
|
321
|
-
wechat message_mass_delete [MSG_ID]
|
|
322
|
-
wechat message_mass_get [MSG_ID]
|
|
323
|
-
wechat message_mass_preview [WX_NAME, MPNEWS_MEDIA_ID]
|
|
324
|
-
wechat qrcode_create_limit_scene [SCENE_ID_OR_STR]
|
|
325
|
-
wechat qrcode_create_scene [
|
|
326
|
-
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH]
|
|
327
|
-
wechat short_url [LONG_URL]
|
|
328
|
-
wechat tag [TAGID]
|
|
329
|
-
wechat tag_add_user [TAG_ID, OPEN_IDS]
|
|
330
|
-
wechat tag_create [TAGNAME, TAG_ID]
|
|
331
|
-
wechat tag_del_user [TAG_ID, OPEN_IDS]
|
|
332
|
-
wechat tag_delete [TAG_ID]
|
|
333
|
-
wechat tag_update [TAG_ID, TAGNAME]
|
|
334
|
-
wechat tags
|
|
335
|
-
wechat template_message [OPENID, TEMPLATE_YAML_PATH]
|
|
336
|
-
wechat user [OPEN_ID]
|
|
337
|
-
wechat user_batchget [OPEN_ID_LIST]
|
|
338
|
-
wechat user_change_group [OPEN_ID, TO_GROUP_ID]
|
|
339
|
-
wechat user_group [OPEN_ID]
|
|
340
|
-
wechat user_update_remark [OPEN_ID, REMARK]
|
|
341
|
-
wechat users
|
|
342
|
-
wechat wxacode_download [WXA_CODE_PIC_PATH, PATH, WIDTH]
|
|
293
|
+
wechat callbackip # 获取微信服务器IP地址
|
|
294
|
+
wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息
|
|
295
|
+
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息
|
|
296
|
+
wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息
|
|
297
|
+
wechat custom_text [OPENID, TEXT_MESSAGE] # 发送文字客服消息
|
|
298
|
+
wechat custom_video [OPENID, VIDEO_PATH] # 发送视频客服消息
|
|
299
|
+
wechat custom_voice [OPENID, VOICE_PATH] # 发送语音客服消息
|
|
300
|
+
wechat customservice_getonlinekflist # 获取在线客服接待信息
|
|
301
|
+
wechat group_create [GROUP_NAME] # 创建分组
|
|
302
|
+
wechat group_delete [GROUP_ID] # 删除分组
|
|
303
|
+
wechat group_update [GROUP_ID, NEW_GROUP_NAME] # 修改分组名
|
|
304
|
+
wechat groups # 查询所有分组
|
|
305
|
+
wechat material [MEDIA_ID, PATH] # 永久媒体下载
|
|
306
|
+
wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传
|
|
307
|
+
wechat material_count # 获取永久素材总数
|
|
308
|
+
wechat material_delete [MEDIA_ID] # 删除永久素材
|
|
309
|
+
wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表
|
|
310
|
+
wechat media [MEDIA_ID, PATH] # 媒体下载
|
|
311
|
+
wechat media_hq [MEDIA_ID, PATH] # 高清音频下载
|
|
312
|
+
wechat media_create [MEDIA_TYPE, PATH] # 媒体上传
|
|
313
|
+
wechat media_uploadimg [IMAGE_PATH] # 上传图文消息内的图片
|
|
314
|
+
wechat media_uploadnews [MPNEWS_YAML_PATH] # 上传图文消息素材
|
|
315
|
+
wechat menu # 当前菜单
|
|
316
|
+
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH] # 创建个性化菜单
|
|
317
|
+
wechat menu_create [MENU_YAML_PATH] # 创建菜单
|
|
318
|
+
wechat menu_delconditional [MENU_ID] # 删除个性化菜单
|
|
319
|
+
wechat menu_delete # 删除菜单
|
|
320
|
+
wechat menu_trymatch [USER_ID] # 测试个性化菜单匹配结果
|
|
321
|
+
wechat message_mass_delete [MSG_ID] # 删除群发消息
|
|
322
|
+
wechat message_mass_get [MSG_ID] # 查询群发消息发送状态
|
|
323
|
+
wechat message_mass_preview [WX_NAME, MPNEWS_MEDIA_ID] # 预览图文消息素材
|
|
324
|
+
wechat qrcode_create_limit_scene [SCENE_ID_OR_STR] # 请求永久二维码
|
|
325
|
+
wechat qrcode_create_scene [SCENE_ID_OR_STR, EXPIRE_SECONDS] # 请求临时二维码
|
|
326
|
+
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH] # 通过ticket下载二维码
|
|
327
|
+
wechat short_url [LONG_URL] # 长链接转短链接
|
|
328
|
+
wechat tag [TAGID] # 获取标签下粉丝列表
|
|
329
|
+
wechat tag_add_user [TAG_ID, OPEN_IDS] # 批量为用户打标签
|
|
330
|
+
wechat tag_create [TAGNAME, TAG_ID] # 创建标签
|
|
331
|
+
wechat tag_del_user [TAG_ID, OPEN_IDS] # 批量为用户取消标签
|
|
332
|
+
wechat tag_delete [TAG_ID] # 删除标签
|
|
333
|
+
wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字
|
|
334
|
+
wechat tags # 获取所有标签
|
|
335
|
+
wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口
|
|
336
|
+
wechat user [OPEN_ID] # 获取用户基本信息
|
|
337
|
+
wechat user_batchget [OPEN_ID_LIST] # 批量获取用户基本信息
|
|
338
|
+
wechat user_change_group [OPEN_ID, TO_GROUP_ID] # 移动用户分组
|
|
339
|
+
wechat user_group [OPEN_ID] # 查询用户所在分组
|
|
340
|
+
wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名
|
|
341
|
+
wechat users # 关注者列表
|
|
342
|
+
wechat wxacode_download [WXA_CODE_PIC_PATH, PATH, WIDTH] # 下载小程序码
|
|
343
343
|
```
|
|
344
344
|
|
|
345
345
|
#### 企业号命令行
|
|
346
346
|
```
|
|
347
347
|
$ wechat
|
|
348
348
|
Wechat Enterprise Account commands:
|
|
349
|
-
wechat agent [AGENT_ID]
|
|
350
|
-
wechat agent_list
|
|
351
|
-
wechat batch_job_result [JOB_ID]
|
|
352
|
-
wechat batch_replaceparty [BATCH_PARTY_CSV_MEDIA_ID]
|
|
353
|
-
wechat batch_replaceuser [BATCH_USER_CSV_MEDIA_ID]
|
|
354
|
-
wechat batch_syncuser [SYNC_USER_CSV_MEDIA_ID]
|
|
355
|
-
wechat callbackip
|
|
356
|
-
wechat convert_to_openid [USER_ID]
|
|
357
|
-
wechat custom_image [OPENID, IMAGE_PATH]
|
|
358
|
-
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL]
|
|
359
|
-
wechat custom_news [OPENID, NEWS_YAML_PATH]
|
|
360
|
-
wechat custom_text [OPENID, TEXT_MESSAGE]
|
|
361
|
-
wechat custom_video [OPENID, VIDEO_PATH]
|
|
362
|
-
wechat custom_voice [OPENID, VOICE_PATH]
|
|
363
|
-
wechat department [DEPARTMENT_ID]
|
|
364
|
-
wechat department_create [NAME, PARENT_ID]
|
|
365
|
-
wechat department_delete [DEPARTMENT_ID]
|
|
366
|
-
wechat department_update [DEPARTMENT_ID, NAME]
|
|
367
|
-
wechat invite_user [USER_ID]
|
|
368
|
-
wechat material [MEDIA_ID, PATH]
|
|
369
|
-
wechat material_add [MEDIA_TYPE, PATH]
|
|
370
|
-
wechat material_count
|
|
371
|
-
wechat material_delete [MEDIA_ID]
|
|
372
|
-
wechat material_list [TYPE, OFFSET, COUNT]
|
|
373
|
-
wechat media [MEDIA_ID, PATH]
|
|
374
|
-
wechat media_create [MEDIA_TYPE, PATH]
|
|
375
|
-
wechat media_uploadimg [IMAGE_PATH]
|
|
376
|
-
wechat menu
|
|
377
|
-
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH]
|
|
378
|
-
wechat menu_create [MENU_YAML_PATH]
|
|
379
|
-
wechat menu_delconditional [MENU_ID]
|
|
380
|
-
wechat menu_delete
|
|
381
|
-
wechat menu_trymatch [USER_ID]
|
|
382
|
-
wechat message_send [OPENID, TEXT_MESSAGE]
|
|
383
|
-
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH]
|
|
384
|
-
wechat tag [TAG_ID]
|
|
385
|
-
wechat tag_add_department [TAG_ID, PARTY_IDS]
|
|
386
|
-
wechat tag_add_user [TAG_ID, USER_IDS]
|
|
387
|
-
wechat tag_create [TAGNAME, TAG_ID]
|
|
388
|
-
wechat tag_del_department [TAG_ID, PARTY_IDS]
|
|
389
|
-
wechat tag_del_user [TAG_ID, USER_IDS]
|
|
390
|
-
wechat tag_delete [TAG_ID]
|
|
391
|
-
wechat tag_update [TAG_ID, TAGNAME]
|
|
392
|
-
wechat tags
|
|
393
|
-
wechat template_message [OPENID, TEMPLATE_YAML_PATH]
|
|
394
|
-
wechat upload_replaceparty [BATCH_PARTY_CSV_PATH]
|
|
395
|
-
wechat upload_replaceuser [BATCH_USER_CSV_PATH]
|
|
396
|
-
wechat user [OPEN_ID]
|
|
397
|
-
wechat user_batchdelete [USER_ID_LIST]
|
|
398
|
-
wechat user_delete [USER_ID]
|
|
399
|
-
wechat user_list [DEPARTMENT_ID]
|
|
400
|
-
wechat user_simplelist [DEPARTMENT_ID]
|
|
401
|
-
wechat user_update_remark [OPEN_ID, REMARK]
|
|
349
|
+
wechat agent [AGENT_ID] # 获取企业号应用详情
|
|
350
|
+
wechat agent_list # 获取应用概况列表
|
|
351
|
+
wechat batch_job_result [JOB_ID] # 获取异步任务结果
|
|
352
|
+
wechat batch_replaceparty [BATCH_PARTY_CSV_MEDIA_ID] # 全量覆盖部门
|
|
353
|
+
wechat batch_replaceuser [BATCH_USER_CSV_MEDIA_ID] # 全量覆盖成员
|
|
354
|
+
wechat batch_syncuser [SYNC_USER_CSV_MEDIA_ID] # 增量更新成员
|
|
355
|
+
wechat callbackip # 获取微信服务器IP地址
|
|
356
|
+
wechat convert_to_openid [USER_ID] # userid转换成openid
|
|
357
|
+
wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息
|
|
358
|
+
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息
|
|
359
|
+
wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息
|
|
360
|
+
wechat custom_text [OPENID, TEXT_MESSAGE] # 发送文字客服消息
|
|
361
|
+
wechat custom_video [OPENID, VIDEO_PATH] # 发送视频客服消息
|
|
362
|
+
wechat custom_voice [OPENID, VOICE_PATH] # 发送语音客服消息
|
|
363
|
+
wechat department [DEPARTMENT_ID] # 获取部门列表
|
|
364
|
+
wechat department_create [NAME, PARENT_ID] # 创建部门
|
|
365
|
+
wechat department_delete [DEPARTMENT_ID] # 删除部门
|
|
366
|
+
wechat department_update [DEPARTMENT_ID, NAME] # 更新部门
|
|
367
|
+
wechat invite_user [USER_ID] # 邀请成员关注
|
|
368
|
+
wechat material [MEDIA_ID, PATH] # 永久媒体下载
|
|
369
|
+
wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传
|
|
370
|
+
wechat material_count # 获取永久素材总数
|
|
371
|
+
wechat material_delete [MEDIA_ID] # 删除永久素材
|
|
372
|
+
wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表
|
|
373
|
+
wechat media [MEDIA_ID, PATH] # 媒体下载
|
|
374
|
+
wechat media_create [MEDIA_TYPE, PATH] # 媒体上传
|
|
375
|
+
wechat media_uploadimg [IMAGE_PATH] # 上传图文消息内的图片
|
|
376
|
+
wechat menu # 当前菜单
|
|
377
|
+
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH] # 创建个性化菜单
|
|
378
|
+
wechat menu_create [MENU_YAML_PATH] # 创建菜单
|
|
379
|
+
wechat menu_delconditional [MENU_ID] # 删除个性化菜单
|
|
380
|
+
wechat menu_delete # 删除菜单
|
|
381
|
+
wechat menu_trymatch [USER_ID] # 测试个性化菜单匹配结果
|
|
382
|
+
wechat message_send [OPENID, TEXT_MESSAGE] # 发送文字消息
|
|
383
|
+
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH] # 通过ticket下载二维码
|
|
384
|
+
wechat tag [TAG_ID] # 获取标签成员
|
|
385
|
+
wechat tag_add_department [TAG_ID, PARTY_IDS] # 增加标签部门
|
|
386
|
+
wechat tag_add_user [TAG_ID, USER_IDS] # 增加标签成员
|
|
387
|
+
wechat tag_create [TAGNAME, TAG_ID] # 创建标签
|
|
388
|
+
wechat tag_del_department [TAG_ID, PARTY_IDS] # 删除标签部门
|
|
389
|
+
wechat tag_del_user [TAG_ID, USER_IDS] # 删除标签成员
|
|
390
|
+
wechat tag_delete [TAG_ID] # 删除标签
|
|
391
|
+
wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字
|
|
392
|
+
wechat tags # 获取所有标签
|
|
393
|
+
wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口
|
|
394
|
+
wechat upload_replaceparty [BATCH_PARTY_CSV_PATH] # 上传文件方式全量覆盖部门
|
|
395
|
+
wechat upload_replaceuser [BATCH_USER_CSV_PATH] # 上传文件方式全量覆盖成员
|
|
396
|
+
wechat user [OPEN_ID] # 获取用户基本信息
|
|
397
|
+
wechat user_batchdelete [USER_ID_LIST] # 批量删除成员
|
|
398
|
+
wechat user_delete [USER_ID] # 删除成员
|
|
399
|
+
wechat user_list [DEPARTMENT_ID] # 获取部门成员详情
|
|
400
|
+
wechat user_simplelist [DEPARTMENT_ID] # 获取部门成员
|
|
401
|
+
wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名
|
|
402
402
|
```
|
|
403
403
|
|
|
404
404
|
### 使用场景
|
data/README.md
CHANGED
|
@@ -220,6 +220,7 @@ class WechatFirstController < ActionController::Base
|
|
|
220
220
|
|
|
221
221
|
on :text, with:"help", respond: "help content"
|
|
222
222
|
end
|
|
223
|
+
```
|
|
223
224
|
|
|
224
225
|
Or you can provide full list of options.
|
|
225
226
|
|
|
@@ -305,115 +306,115 @@ Feel safe if you can not read Chinese in the comments, it's kept there in order
|
|
|
305
306
|
```
|
|
306
307
|
$ wechat
|
|
307
308
|
Wechat Public Account commands:
|
|
308
|
-
wechat callbackip
|
|
309
|
-
wechat custom_image [OPENID, IMAGE_PATH]
|
|
310
|
-
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL]
|
|
311
|
-
wechat custom_news [OPENID, NEWS_YAML_PATH]
|
|
312
|
-
wechat custom_text [OPENID, TEXT_MESSAGE]
|
|
313
|
-
wechat custom_video [OPENID, VIDEO_PATH]
|
|
314
|
-
wechat custom_voice [OPENID, VOICE_PATH]
|
|
315
|
-
wechat customservice_getonlinekflist
|
|
316
|
-
wechat group_create [GROUP_NAME]
|
|
317
|
-
wechat group_delete [GROUP_ID]
|
|
318
|
-
wechat group_update [GROUP_ID, NEW_GROUP_NAME]
|
|
319
|
-
wechat groups
|
|
320
|
-
wechat material [MEDIA_ID, PATH]
|
|
321
|
-
wechat material_add [MEDIA_TYPE, PATH]
|
|
322
|
-
wechat material_count
|
|
323
|
-
wechat material_delete [MEDIA_ID]
|
|
324
|
-
wechat material_list [TYPE, OFFSET, COUNT]
|
|
325
|
-
wechat media [MEDIA_ID, PATH]
|
|
326
|
-
wechat media_hq [MEDIA_ID, PATH]
|
|
327
|
-
wechat media_create [MEDIA_TYPE, PATH]
|
|
328
|
-
wechat media_uploadimg [IMAGE_PATH]
|
|
329
|
-
wechat media_uploadnews [MPNEWS_YAML_PATH]
|
|
330
|
-
wechat menu
|
|
331
|
-
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH]
|
|
332
|
-
wechat menu_create [MENU_YAML_PATH]
|
|
333
|
-
wechat menu_delconditional [MENU_ID]
|
|
334
|
-
wechat menu_delete
|
|
335
|
-
wechat menu_trymatch [USER_ID]
|
|
336
|
-
wechat message_mass_delete [MSG_ID]
|
|
337
|
-
wechat message_mass_get [MSG_ID]
|
|
338
|
-
wechat message_mass_preview [WX_NAME, MPNEWS_MEDIA_ID]
|
|
339
|
-
wechat qrcode_create_limit_scene [SCENE_ID_OR_STR]
|
|
340
|
-
wechat qrcode_create_scene [
|
|
341
|
-
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH]
|
|
342
|
-
wechat short_url [LONG_URL]
|
|
343
|
-
wechat tag [TAGID]
|
|
344
|
-
wechat tag_add_user [TAG_ID, OPEN_IDS]
|
|
345
|
-
wechat tag_create [TAGNAME, TAG_ID]
|
|
346
|
-
wechat tag_del_user [TAG_ID, OPEN_IDS]
|
|
347
|
-
wechat tag_delete [TAG_ID]
|
|
348
|
-
wechat tag_update [TAG_ID, TAGNAME]
|
|
349
|
-
wechat tags
|
|
350
|
-
wechat template_message [OPENID, TEMPLATE_YAML_PATH]
|
|
351
|
-
wechat user [OPEN_ID]
|
|
352
|
-
wechat user_batchget [OPEN_ID_LIST]
|
|
353
|
-
wechat user_change_group [OPEN_ID, TO_GROUP_ID]
|
|
354
|
-
wechat user_group [OPEN_ID]
|
|
355
|
-
wechat user_update_remark [OPEN_ID, REMARK]
|
|
356
|
-
wechat users
|
|
357
|
-
wechat wxacode_download [WXA_CODE_PIC_PATH, PATH, WIDTH]
|
|
309
|
+
wechat callbackip # 获取微信服务器IP地址
|
|
310
|
+
wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息
|
|
311
|
+
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息
|
|
312
|
+
wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息
|
|
313
|
+
wechat custom_text [OPENID, TEXT_MESSAGE] # 发送文字客服消息
|
|
314
|
+
wechat custom_video [OPENID, VIDEO_PATH] # 发送视频客服消息
|
|
315
|
+
wechat custom_voice [OPENID, VOICE_PATH] # 发送语音客服消息
|
|
316
|
+
wechat customservice_getonlinekflist # 获取在线客服接待信息
|
|
317
|
+
wechat group_create [GROUP_NAME] # 创建分组
|
|
318
|
+
wechat group_delete [GROUP_ID] # 删除分组
|
|
319
|
+
wechat group_update [GROUP_ID, NEW_GROUP_NAME] # 修改分组名
|
|
320
|
+
wechat groups # 查询所有分组
|
|
321
|
+
wechat material [MEDIA_ID, PATH] # 永久媒体下载
|
|
322
|
+
wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传
|
|
323
|
+
wechat material_count # 获取永久素材总数
|
|
324
|
+
wechat material_delete [MEDIA_ID] # 删除永久素材
|
|
325
|
+
wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表
|
|
326
|
+
wechat media [MEDIA_ID, PATH] # 媒体下载
|
|
327
|
+
wechat media_hq [MEDIA_ID, PATH] # 高清音频下载
|
|
328
|
+
wechat media_create [MEDIA_TYPE, PATH] # 媒体上传
|
|
329
|
+
wechat media_uploadimg [IMAGE_PATH] # 上传图文消息内的图片
|
|
330
|
+
wechat media_uploadnews [MPNEWS_YAML_PATH] # 上传图文消息素材
|
|
331
|
+
wechat menu # 当前菜单
|
|
332
|
+
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH] # 创建个性化菜单
|
|
333
|
+
wechat menu_create [MENU_YAML_PATH] # 创建菜单
|
|
334
|
+
wechat menu_delconditional [MENU_ID] # 删除个性化菜单
|
|
335
|
+
wechat menu_delete # 删除菜单
|
|
336
|
+
wechat menu_trymatch [USER_ID] # 测试个性化菜单匹配结果
|
|
337
|
+
wechat message_mass_delete [MSG_ID] # 删除群发消息
|
|
338
|
+
wechat message_mass_get [MSG_ID] # 查询群发消息发送状态
|
|
339
|
+
wechat message_mass_preview [WX_NAME, MPNEWS_MEDIA_ID] # 预览图文消息素材
|
|
340
|
+
wechat qrcode_create_limit_scene [SCENE_ID_OR_STR] # 请求永久二维码
|
|
341
|
+
wechat qrcode_create_scene [SCENE_ID_OR_STR, EXPIRE_SECONDS] # 请求临时二维码
|
|
342
|
+
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH] # 通过ticket下载二维码
|
|
343
|
+
wechat short_url [LONG_URL] # 长链接转短链接
|
|
344
|
+
wechat tag [TAGID] # 获取标签下粉丝列表
|
|
345
|
+
wechat tag_add_user [TAG_ID, OPEN_IDS] # 批量为用户打标签
|
|
346
|
+
wechat tag_create [TAGNAME, TAG_ID] # 创建标签
|
|
347
|
+
wechat tag_del_user [TAG_ID, OPEN_IDS] # 批量为用户取消标签
|
|
348
|
+
wechat tag_delete [TAG_ID] # 删除标签
|
|
349
|
+
wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字
|
|
350
|
+
wechat tags # 获取所有标签
|
|
351
|
+
wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口
|
|
352
|
+
wechat user [OPEN_ID] # 获取用户基本信息
|
|
353
|
+
wechat user_batchget [OPEN_ID_LIST] # 批量获取用户基本信息
|
|
354
|
+
wechat user_change_group [OPEN_ID, TO_GROUP_ID] # 移动用户分组
|
|
355
|
+
wechat user_group [OPEN_ID] # 查询用户所在分组
|
|
356
|
+
wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名
|
|
357
|
+
wechat users # 关注者列表
|
|
358
|
+
wechat wxacode_download [WXA_CODE_PIC_PATH, PATH, WIDTH] # 下载小程序码
|
|
358
359
|
```
|
|
359
360
|
|
|
360
361
|
#### Enterprise account command line
|
|
361
362
|
```
|
|
362
363
|
$ wechat
|
|
363
364
|
Wechat Enterprise Account commands:
|
|
364
|
-
wechat agent [AGENT_ID]
|
|
365
|
-
wechat agent_list
|
|
366
|
-
wechat batch_job_result [JOB_ID]
|
|
367
|
-
wechat batch_replaceparty [BATCH_PARTY_CSV_MEDIA_ID]
|
|
368
|
-
wechat batch_replaceuser [BATCH_USER_CSV_MEDIA_ID]
|
|
369
|
-
wechat batch_syncuser [SYNC_USER_CSV_MEDIA_ID]
|
|
370
|
-
wechat callbackip
|
|
371
|
-
wechat convert_to_openid [USER_ID]
|
|
372
|
-
wechat custom_image [OPENID, IMAGE_PATH]
|
|
373
|
-
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL]
|
|
374
|
-
wechat custom_news [OPENID, NEWS_YAML_PATH]
|
|
375
|
-
wechat custom_text [OPENID, TEXT_MESSAGE]
|
|
376
|
-
wechat custom_video [OPENID, VIDEO_PATH]
|
|
377
|
-
wechat custom_voice [OPENID, VOICE_PATH]
|
|
378
|
-
wechat department [DEPARTMENT_ID]
|
|
379
|
-
wechat department_create [NAME, PARENT_ID]
|
|
380
|
-
wechat department_delete [DEPARTMENT_ID]
|
|
381
|
-
wechat department_update [DEPARTMENT_ID, NAME]
|
|
382
|
-
wechat invite_user [USER_ID]
|
|
383
|
-
wechat material [MEDIA_ID, PATH]
|
|
384
|
-
wechat material_add [MEDIA_TYPE, PATH]
|
|
385
|
-
wechat material_count
|
|
386
|
-
wechat material_delete [MEDIA_ID]
|
|
387
|
-
wechat material_list [TYPE, OFFSET, COUNT]
|
|
388
|
-
wechat media [MEDIA_ID, PATH]
|
|
389
|
-
wechat media_create [MEDIA_TYPE, PATH]
|
|
390
|
-
wechat media_uploadimg [IMAGE_PATH]
|
|
391
|
-
wechat menu
|
|
392
|
-
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH]
|
|
393
|
-
wechat menu_create [MENU_YAML_PATH]
|
|
394
|
-
wechat menu_delconditional [MENU_ID]
|
|
395
|
-
wechat menu_delete
|
|
396
|
-
wechat menu_trymatch [USER_ID]
|
|
397
|
-
wechat message_send [OPENID, TEXT_MESSAGE]
|
|
398
|
-
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH]
|
|
399
|
-
wechat tag [TAG_ID]
|
|
400
|
-
wechat tag_add_department [TAG_ID, PARTY_IDS]
|
|
401
|
-
wechat tag_add_user [TAG_ID, USER_IDS]
|
|
402
|
-
wechat tag_create [TAGNAME, TAG_ID]
|
|
403
|
-
wechat tag_del_department [TAG_ID, PARTY_IDS]
|
|
404
|
-
wechat tag_del_user [TAG_ID, USER_IDS]
|
|
405
|
-
wechat tag_delete [TAG_ID]
|
|
406
|
-
wechat tag_update [TAG_ID, TAGNAME]
|
|
407
|
-
wechat tags
|
|
408
|
-
wechat template_message [OPENID, TEMPLATE_YAML_PATH]
|
|
409
|
-
wechat upload_replaceparty [BATCH_PARTY_CSV_PATH]
|
|
410
|
-
wechat upload_replaceuser [BATCH_USER_CSV_PATH]
|
|
411
|
-
wechat user [OPEN_ID]
|
|
412
|
-
wechat user_batchdelete [USER_ID_LIST]
|
|
413
|
-
wechat user_delete [USER_ID]
|
|
414
|
-
wechat user_list [DEPARTMENT_ID]
|
|
415
|
-
wechat user_simplelist [DEPARTMENT_ID]
|
|
416
|
-
wechat user_update_remark [OPEN_ID, REMARK]
|
|
365
|
+
wechat agent [AGENT_ID] # 获取企业号应用详情
|
|
366
|
+
wechat agent_list # 获取应用概况列表
|
|
367
|
+
wechat batch_job_result [JOB_ID] # 获取异步任务结果
|
|
368
|
+
wechat batch_replaceparty [BATCH_PARTY_CSV_MEDIA_ID] # 全量覆盖部门
|
|
369
|
+
wechat batch_replaceuser [BATCH_USER_CSV_MEDIA_ID] # 全量覆盖成员
|
|
370
|
+
wechat batch_syncuser [SYNC_USER_CSV_MEDIA_ID] # 增量更新成员
|
|
371
|
+
wechat callbackip # 获取微信服务器IP地址
|
|
372
|
+
wechat convert_to_openid [USER_ID] # userid转换成openid
|
|
373
|
+
wechat custom_image [OPENID, IMAGE_PATH] # 发送图片客服消息
|
|
374
|
+
wechat custom_music [OPENID, THUMBNAIL_PATH, MUSIC_URL] # 发送音乐客服消息
|
|
375
|
+
wechat custom_news [OPENID, NEWS_YAML_PATH] # 发送图文客服消息
|
|
376
|
+
wechat custom_text [OPENID, TEXT_MESSAGE] # 发送文字客服消息
|
|
377
|
+
wechat custom_video [OPENID, VIDEO_PATH] # 发送视频客服消息
|
|
378
|
+
wechat custom_voice [OPENID, VOICE_PATH] # 发送语音客服消息
|
|
379
|
+
wechat department [DEPARTMENT_ID] # 获取部门列表
|
|
380
|
+
wechat department_create [NAME, PARENT_ID] # 创建部门
|
|
381
|
+
wechat department_delete [DEPARTMENT_ID] # 删除部门
|
|
382
|
+
wechat department_update [DEPARTMENT_ID, NAME] # 更新部门
|
|
383
|
+
wechat invite_user [USER_ID] # 邀请成员关注
|
|
384
|
+
wechat material [MEDIA_ID, PATH] # 永久媒体下载
|
|
385
|
+
wechat material_add [MEDIA_TYPE, PATH] # 永久媒体上传
|
|
386
|
+
wechat material_count # 获取永久素材总数
|
|
387
|
+
wechat material_delete [MEDIA_ID] # 删除永久素材
|
|
388
|
+
wechat material_list [TYPE, OFFSET, COUNT] # 获取永久素材列表
|
|
389
|
+
wechat media [MEDIA_ID, PATH] # 媒体下载
|
|
390
|
+
wechat media_create [MEDIA_TYPE, PATH] # 媒体上传
|
|
391
|
+
wechat media_uploadimg [IMAGE_PATH] # 上传图文消息内的图片
|
|
392
|
+
wechat menu # 当前菜单
|
|
393
|
+
wechat menu_addconditional [CONDITIONAL_MENU_YAML_PATH] # 创建个性化菜单
|
|
394
|
+
wechat menu_create [MENU_YAML_PATH] # 创建菜单
|
|
395
|
+
wechat menu_delconditional [MENU_ID] # 删除个性化菜单
|
|
396
|
+
wechat menu_delete # 删除菜单
|
|
397
|
+
wechat menu_trymatch [USER_ID] # 测试个性化菜单匹配结果
|
|
398
|
+
wechat message_send [OPENID, TEXT_MESSAGE] # 发送文字消息
|
|
399
|
+
wechat qrcode_download [TICKET, QR_CODE_PIC_PATH] # 通过ticket下载二维码
|
|
400
|
+
wechat tag [TAG_ID] # 获取标签成员
|
|
401
|
+
wechat tag_add_department [TAG_ID, PARTY_IDS] # 增加标签部门
|
|
402
|
+
wechat tag_add_user [TAG_ID, USER_IDS] # 增加标签成员
|
|
403
|
+
wechat tag_create [TAGNAME, TAG_ID] # 创建标签
|
|
404
|
+
wechat tag_del_department [TAG_ID, PARTY_IDS] # 删除标签部门
|
|
405
|
+
wechat tag_del_user [TAG_ID, USER_IDS] # 删除标签成员
|
|
406
|
+
wechat tag_delete [TAG_ID] # 删除标签
|
|
407
|
+
wechat tag_update [TAG_ID, TAGNAME] # 更新标签名字
|
|
408
|
+
wechat tags # 获取所有标签
|
|
409
|
+
wechat template_message [OPENID, TEMPLATE_YAML_PATH] # 模板消息接口
|
|
410
|
+
wechat upload_replaceparty [BATCH_PARTY_CSV_PATH] # 上传文件方式全量覆盖部门
|
|
411
|
+
wechat upload_replaceuser [BATCH_USER_CSV_PATH] # 上传文件方式全量覆盖成员
|
|
412
|
+
wechat user [OPEN_ID] # 获取用户基本信息
|
|
413
|
+
wechat user_batchdelete [USER_ID_LIST] # 批量删除成员
|
|
414
|
+
wechat user_delete [USER_ID] # 删除成员
|
|
415
|
+
wechat user_list [DEPARTMENT_ID] # 获取部门成员详情
|
|
416
|
+
wechat user_simplelist [DEPARTMENT_ID] # 获取部门成员
|
|
417
|
+
wechat user_update_remark [OPEN_ID, REMARK] # 设置备注名
|
|
417
418
|
```
|
|
418
419
|
|
|
419
420
|
### Command line usage demo (partially)
|
data/bin/wechat
CHANGED
|
@@ -267,9 +267,9 @@ class App < Thor
|
|
|
267
267
|
puts wechat_api.user_batchget(openidlist.split(','))
|
|
268
268
|
end
|
|
269
269
|
|
|
270
|
-
desc 'qrcode_create_scene [
|
|
271
|
-
def qrcode_create_scene(
|
|
272
|
-
puts wechat_api.qrcode_create_scene(
|
|
270
|
+
desc 'qrcode_create_scene [SCENE_ID_OR_STR, EXPIRE_SECONDS]', '请求临时二维码'
|
|
271
|
+
def qrcode_create_scene(scene_id_or_str, expire_seconds = 604800)
|
|
272
|
+
puts wechat_api.qrcode_create_scene(scene_id_or_str, expire_seconds)
|
|
273
273
|
end
|
|
274
274
|
|
|
275
275
|
desc 'qrcode_create_limit_scene [SCENE_ID_OR_STR]', '请求永久二维码'
|
data/lib/wechat/api.rb
CHANGED
|
@@ -55,15 +55,23 @@ module Wechat
|
|
|
55
55
|
post 'user/info/updateremark', JSON.generate(openid: openid, remark: remark)
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def qrcode_create_scene(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
def qrcode_create_scene(scene_id_or_str, expire_seconds = 604800)
|
|
59
|
+
case scene_id_or_str
|
|
60
|
+
when 0.class
|
|
61
|
+
post 'qrcode/create', JSON.generate(expire_seconds: expire_seconds,
|
|
62
|
+
action_name: 'QR_SCENE',
|
|
63
|
+
action_info: { scene: { scene_id: scene_id_or_str } })
|
|
64
|
+
else
|
|
65
|
+
post 'qrcode/create', JSON.generate(expire_seconds: expire_seconds,
|
|
66
|
+
action_name: 'QR_STR_SCENE',
|
|
67
|
+
action_info: { scene: { scene_str: scene_id_or_str } })
|
|
68
|
+
end
|
|
69
|
+
|
|
62
70
|
end
|
|
63
71
|
|
|
64
72
|
def qrcode_create_limit_scene(scene_id_or_str)
|
|
65
73
|
case scene_id_or_str
|
|
66
|
-
when
|
|
74
|
+
when 0.class
|
|
67
75
|
post 'qrcode/create', JSON.generate(action_name: 'QR_LIMIT_SCENE',
|
|
68
76
|
action_info: { scene: { scene_id: scene_id_or_str } })
|
|
69
77
|
else
|
|
@@ -28,7 +28,6 @@ module Wechat
|
|
|
28
28
|
|
|
29
29
|
raise 'Can not get corpid or appid, so please configure it first to using wechat_oauth2' if appid.blank?
|
|
30
30
|
|
|
31
|
-
api.jsapi_ticket.ticket if api.jsapi_ticket.oauth2_state.nil?
|
|
32
31
|
oauth2_params = {
|
|
33
32
|
appid: appid,
|
|
34
33
|
redirect_uri: page_url || generate_redirect_uri(account),
|
|
@@ -4,7 +4,7 @@ require 'securerandom'
|
|
|
4
4
|
module Wechat
|
|
5
5
|
module Ticket
|
|
6
6
|
class JsapiBase
|
|
7
|
-
attr_reader :client, :access_token, :
|
|
7
|
+
attr_reader :client, :access_token, :jsapi_ticket_file, :access_ticket, :ticket_life_in_seconds, :got_ticket_at
|
|
8
8
|
|
|
9
9
|
def initialize(client, access_token, jsapi_ticket_file)
|
|
10
10
|
@client = client
|
|
@@ -23,6 +23,13 @@ module Wechat
|
|
|
23
23
|
retry unless (tries -= 1).zero?
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def oauth2_state
|
|
27
|
+
if @oauth2_state.blank? || remain_life_seconds < 180
|
|
28
|
+
ticket
|
|
29
|
+
end
|
|
30
|
+
@oauth2_state
|
|
31
|
+
end
|
|
32
|
+
|
|
26
33
|
# Obtain the wechat jssdk config signature parameter and return below hash
|
|
27
34
|
# params = {
|
|
28
35
|
# noncestr: noncestr,
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: wechat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.8.
|
|
4
|
+
version: 0.8.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Skinnyworm
|
|
@@ -13,25 +13,25 @@ cert_chain:
|
|
|
13
13
|
-----BEGIN CERTIFICATE-----
|
|
14
14
|
MIIDeDCCAmCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBBMRMwEQYDVQQDDAplcmlj
|
|
15
15
|
Lmd1b2N6MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZFgNj
|
|
16
|
-
|
|
16
|
+
b20wHhcNMTcwNzI1MDEwMDU1WhcNMTgwNzI1MDEwMDU1WjBBMRMwEQYDVQQDDApl
|
|
17
17
|
cmljLmd1b2N6MRUwEwYKCZImiZPyLGQBGRYFZ21haWwxEzARBgoJkiaJk/IsZAEZ
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
FgNjb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDw/v3xTyrXOdzt
|
|
19
|
+
0J3aFwBQ0mnDKW/E4INUekx4xzLnlCaGxZwUiv0tXfmXHPrCBjYcOYzA0viUNElO
|
|
20
|
+
jPNn+LvcZsTsiYLai8sIBHeBGlGTKfnMFDXABhLUD0wafCcjKvhcxLzCkvBwQWO3
|
|
21
|
+
sWukYhGTW1fPfUybWVRVtswwGIyqqLezKPbYTY56t7RCz1suv32ViAfg8kCSGoMz
|
|
22
|
+
hgrp9FLSMKyeYW/LrA8adF+9NLotRleaec75INi+9JJJ190iJU27rwGE9iXOhpJS
|
|
23
|
+
BUwYoduU3RJGwEr1HLmq20gZlTv5RKuQ91L4i7xDjmhJIVJTBoPNLXjE8dCJ/ZXs
|
|
24
|
+
FmDSu7R5AgMBAAGjezB5MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQW
|
|
25
|
+
BBSLMIsOJrcOkTsQvamhOVFJWD+ADDAfBgNVHREEGDAWgRRlcmljLmd1b2N6QGdt
|
|
26
26
|
YWlsLmNvbTAfBgNVHRIEGDAWgRRlcmljLmd1b2N6QGdtYWlsLmNvbTANBgkqhkiG
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
9w0BAQUFAAOCAQEA237a0TwFF52WZloXGIuH3O5ceswbp/A30UpHGZKHgtY3SWkZ
|
|
28
|
+
c2F3wlYoGZvM8l9Ec+ZEobcxuvq7wU5BSI3PFTUpFkt7m5wD0PW8AP+pGY/d5kBn
|
|
29
|
+
1AQAUJG4mGdKO3oWuWqs2TBFHuCgcNTGm00UMqnrV/tgI6iIoMWay/Y9R+0SAUJ+
|
|
30
|
+
DxjKAQnkF0JBznatQrHLMmKznDiR3DfgDTte7o0pvMf9mQzs9D+im0EhoASWFE/i
|
|
31
|
+
fGxGnQhzVaW07NKOCRrAZlrF8iqso4JR7Vm9bhFdzxUPLr70njwHLtDS2CHgo1VW
|
|
32
|
+
1xAjN8ZXXpAmVv7V6cI9RTmQHPu/fFn+E0sG9w==
|
|
33
33
|
-----END CERTIFICATE-----
|
|
34
|
-
date: 2017-
|
|
34
|
+
date: 2017-07-25 00:00:00.000000000 Z
|
|
35
35
|
dependencies:
|
|
36
36
|
- !ruby/object:Gem::Dependency
|
|
37
37
|
name: activesupport
|
metadata.gz.sig
CHANGED
|
Binary file
|