wechat.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. # 小程序基本配置
  3. $config['type'] = 3;
  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['send_msg'] = array
  24. (
  25. 'name' => '发送模板消息',
  26. 'method' => 'post',
  27. 'json' => true,
  28. 'url' => 'https://api.weixin.qq.com/cgi-bin/message/wxopen/template/send?',
  29. 'param' => array
  30. (
  31. 'access_token' => 'token',
  32. 'touser' => 'touser',
  33. 'template_id' => 'template_id',
  34. 'page' => 'page',
  35. 'form_id' => 'form_id',
  36. 'data' => 'data',
  37. 'emphasis_keyword' => 'emphasis_keyword',
  38. ),
  39. //针对一些返回的名称,做转换
  40. 'response' => array
  41. (
  42. ),
  43. );
  44. $config['get_msg'] = array
  45. (
  46. 'name' => '获取帐号下已存在的模板列表',
  47. 'method' => 'post',
  48. 'json' => true,
  49. 'url' => 'https://api.weixin.qq.com/cgi-bin/wxopen/template/list?',
  50. 'param' => array
  51. (
  52. 'access_token' => 'token',
  53. 'offset' => '0',
  54. 'count' => '20',
  55. ),
  56. //针对一些返回的名称,做转换
  57. 'response' => array
  58. (
  59. ),
  60. );
  61. $config['total_base'] = array
  62. (
  63. 'name' => '概况趋势',
  64. 'method' => 'post',
  65. 'json' => true,
  66. 'url' => 'https://api.weixin.qq.com/datacube/getweanalysisappiddailysummarytrend?',
  67. 'param' => array
  68. (
  69. 'access_token' => 'token',
  70. 'end_date' => 'end_date',
  71. 'begin_date' => 'begin_date',
  72. ),
  73. //针对一些返回的名称,做转换
  74. 'response' => array
  75. (
  76. ),
  77. );
  78. $config['total_visit'] = array
  79. (
  80. 'name' => '访问趋势',
  81. 'method' => 'post',
  82. 'json' => true,
  83. 'url' => 'https://api.weixin.qq.com/datacube/getweanalysisappiddailyvisittrend?',
  84. 'param' => array
  85. (
  86. 'access_token' => 'token',
  87. 'end_date' => 'end_date',
  88. 'begin_date' => 'begin_date',
  89. ),
  90. //针对一些返回的名称,做转换
  91. 'response' => array
  92. (
  93. ),
  94. );
  95. $config['code'] = array
  96. (
  97. 'name' => '获取小程序码',
  98. 'method' => 'post',
  99. 'json' => true,
  100. 'url' => 'https://api.weixin.qq.com/wxa/getwxacodeunlimit?',
  101. 'param' => array
  102. (
  103. 'access_token' => 'token',
  104. 'scene' => 'param',
  105. 'page' => 'path',
  106. 'width' => 'width',
  107. ),
  108. //针对一些返回的名称,做转换
  109. 'response' => array
  110. (
  111. 'img' => true,
  112. ),
  113. );
  114. return $config;