Skip to content

Commit

Permalink
Add WeChat enterprise server ips API. Close #27
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Feb 9, 2015
1 parent 79e90c1 commit 296df7e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions wechatpy/enterprise/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(self, corp_id, secret, access_token=None):
self.message = api.WeChatMessage(self)
self.tag = api.WeChatTag(self)
self.media = api.WeChatMedia(self)
self.misc = api.WeChatMisc(self)

def fetch_access_token(self):
""" Fetch access token"""
Expand Down
1 change: 1 addition & 0 deletions wechatpy/enterprise/client/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
from .menu import WeChatMenu # NOQA
from .tag import WeChatTag # NOQA
from .user import WeChatUser # NOQA
from .misc import WeChatMisc # NOQA
15 changes: 15 additions & 0 deletions wechatpy/enterprise/client/api/misc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from wechatpy.client.api.base import BaseWeChatAPI


class WeChatMisc(BaseWeChatAPI):

def get_wechat_ips(self):
"""
获取微信服务器 IP 列表
:return: IP 地址列表
"""
res = self._get('getcallbackip')
return res['ip_list']

0 comments on commit 296df7e

Please sign in to comment.