wechat.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. # 公众号基本配置
  3. $config['type'] = 2;
  4. $config['token'] = array
  5. (
  6. 'name' => '获取公众号的token',
  7. 'method' => 'get',
  8. 'json' => false,
  9. 'url' => 'https://api.weixin.qq.com/cgi-bin/token?',
  10. 'param' => array
  11. (
  12. 'appid' => 'appid',
  13. 'secret' => 'secret',
  14. 'grant_type' => 'client_credential',
  15. ),
  16. //针对一些返回的名称,做转换
  17. 'response' => array
  18. (
  19. 'access_token' => 'token',
  20. 'expires_in' => 'expires_in',
  21. ),
  22. );
  23. $config['ticket'] = array
  24. (
  25. 'name' => '获取公众号的ticket',
  26. 'method' => 'get',
  27. 'json' => false,
  28. 'url' => 'https://api.weixin.qq.com/cgi-bin/ticket/getticket?',
  29. 'param' => array
  30. (
  31. 'type' => 'jsapi',
  32. 'access_token' => 'token',
  33. ),
  34. //针对一些返回的名称,做转换
  35. 'response' => array
  36. (
  37. 'jsapi_ticket' => 'ticket',
  38. 'expires_in' => 'expires_in',
  39. ),
  40. );
  41. $config['batchget_material'] = array
  42. (
  43. 'name' => '获取素材列表',
  44. 'method' => 'post',
  45. 'json' => true,
  46. 'url' => 'https://api.weixin.qq.com/cgi-bin/material/batchget_material?',
  47. 'param' => array
  48. (
  49. 'access_token' => 'token',
  50. 'type' => 'news',
  51. 'offset' => 'offset',
  52. 'count' => 'count',
  53. ),
  54. //针对一些返回的名称,做转换
  55. 'response' => array
  56. (
  57. ),
  58. );
  59. $config['get_material'] = array
  60. (
  61. 'name' => '获取永久素材',
  62. 'method' => 'post',
  63. 'json' => true,
  64. 'url' => 'https://api.weixin.qq.com/cgi-bin/material/get_material?',
  65. 'param' => array
  66. (
  67. 'access_token' => 'token',
  68. 'media_id' => 'media_id',
  69. ),
  70. //针对一些返回的名称,做转换
  71. 'response' => array
  72. (
  73. ),
  74. );
  75. $config['getusersummary'] = array
  76. (
  77. 'name' => '获取用户增减数据',
  78. 'method' => 'post',
  79. 'json' => true,
  80. 'url' => 'https://api.weixin.qq.com/datacube/getusersummary?',
  81. 'param' => array
  82. (
  83. 'access_token' => 'token',
  84. 'end_date' => 'end_date',
  85. 'begin_date' => 'begin_date',
  86. ),
  87. //针对一些返回的名称,做转换
  88. 'response' => array
  89. (
  90. ),
  91. );
  92. $config['getusercumulate'] = array
  93. (
  94. 'name' => '获取累计用户数据',
  95. 'method' => 'post',
  96. 'json' => true,
  97. 'url' => 'https://api.weixin.qq.com/datacube/getusercumulate?',
  98. 'param' => array
  99. (
  100. 'access_token' => 'token',
  101. 'end_date' => 'end_date',
  102. 'begin_date' => 'begin_date',
  103. ),
  104. //针对一些返回的名称,做转换
  105. 'response' => array
  106. (
  107. ),
  108. );
  109. $config['getarticlesummary'] = array
  110. (
  111. 'name' => '获取图文群发每日数据',
  112. 'method' => 'post',
  113. 'json' => true,
  114. 'url' => 'https://api.weixin.qq.com/datacube/getarticlesummary?',
  115. 'param' => array
  116. (
  117. 'access_token' => 'token',
  118. 'end_date' => 'end_date',
  119. 'begin_date' => 'begin_date',
  120. ),
  121. //针对一些返回的名称,做转换
  122. 'response' => array
  123. (
  124. ),
  125. );
  126. $config['getuserread'] = array
  127. (
  128. 'name' => '获取图文统计数据',
  129. 'method' => 'post',
  130. 'json' => true,
  131. 'url' => 'https://api.weixin.qq.com/datacube/getuserread?',
  132. 'param' => array
  133. (
  134. 'access_token' => 'token',
  135. 'end_date' => 'end_date',
  136. 'begin_date' => 'begin_date',
  137. ),
  138. //针对一些返回的名称,做转换
  139. 'response' => array
  140. (
  141. ),
  142. );
  143. return $config;