subscribe.py 916 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # -*- coding: utf-8 -*-
  2. # !/usr/bin/env python
  3. from __future__ import absolute_import, unicode_literals
  4. from library.wechatpy.client.api.base import BaseWeChatAPI
  5. class WeChatNewtmpl(BaseWeChatAPI):
  6. API_BASE_URL = 'https://api.weixin.qq.com/wxaapi/newtmpl/'
  7. pass
  8. def get_category(self):
  9. return self._get(
  10. 'getcategory'
  11. )
  12. def get_pub_template_title_list(self, ids, start, limit):
  13. params = {
  14. 'ids': ids,
  15. 'start': start,
  16. 'limit': limit,
  17. }
  18. return self._get(
  19. 'getpubtemplatetitles', params=params
  20. )
  21. def get_pub_template_key_words_by_id(self, tid):
  22. params = {
  23. 'tid': tid
  24. }
  25. return self._get(
  26. 'getpubtemplatekeywords', params=params
  27. )
  28. def get_template_list(self):
  29. return self._get(
  30. 'gettemplate'
  31. )