media.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. # 数据收集的配置
  3. return array
  4. (
  5. # 查询多媒体素材是否存在
  6. 'media' => array
  7. (
  8. 'url' => 'https://api.weixin.qq.com/cgi-bin/material/get_material?',
  9. 'param' => array
  10. (
  11. 'access_token' => 'token',
  12. 'media_id' => Dever::input('media_id'),
  13. ),
  14. # json 传输
  15. 'json' => true,
  16. ),
  17. # 删除多媒体素材
  18. 'media_delete' => array
  19. (
  20. 'url' => 'https://api.weixin.qq.com/cgi-bin/material/del_material?',
  21. 'param' => array
  22. (
  23. 'access_token' => 'token',
  24. 'media_id' => Dever::input('media_id'),
  25. ),
  26. # json 传输
  27. 'json' => true,
  28. ),
  29. # 新增永久多媒体素材 素材必须是从media类处理的
  30. 'media_add' => array
  31. (
  32. 'url' => 'https://api.weixin.qq.com/cgi-bin/material/add_material?',
  33. 'param' => Dever::load('weixin/media.data'),
  34. # json 传输
  35. //'json' => true,
  36. ),
  37. # 新增临时多媒体素材 素材必须是从media类处理的
  38. 'media_add_temp' => array
  39. (
  40. 'url' => 'https://api.weixin.qq.com/cgi-bin/media/upload?',
  41. 'param' => Dever::load('weixin/media.data'),
  42. # json 传输
  43. //'json' => true,
  44. ),
  45. # 新增图文素材
  46. 'media_add_thead' => array
  47. (
  48. //'url' => 'https://api.weixin.qq.com/cgi-bin/media/uploadnews?',
  49. 'url' => 'https://api.weixin.qq.com/cgi-bin/material/add_news?',
  50. 'param' => Dever::load('weixin/media.data_thead'),
  51. # json 传输
  52. 'json' => true,
  53. ),
  54. # 群发消息时,需要再次上传一次视频
  55. 'media_add_video' => array
  56. (
  57. 'url' => 'https://api.weixin.qq.com/cgi-bin/media/uploadvideo?',
  58. 'param' => array
  59. (
  60. 'access_token' => 'token',
  61. 'media_id' => Dever::input('media_id'),
  62. 'title' => Dever::input('title'),
  63. 'description' => Dever::input('description'),
  64. ),
  65. # json 传输
  66. 'json' => true,
  67. ),
  68. # 获取永久素材的信息
  69. 'media_get' => array
  70. (
  71. 'url' => 'https://api.weixin.qq.com/cgi-bin/material/get_material?',
  72. 'param' => array
  73. (
  74. 'access_token' => 'token',
  75. 'media_id' => Dever::input('media_id'),
  76. ),
  77. # json 传输
  78. 'json' => true,
  79. ),
  80. );