diff --git a/apps/jqr/ksy_http.py b/apps/jqr/ksy_http.py index 2dddcd3..94b01f2 100644 --- a/apps/jqr/ksy_http.py +++ b/apps/jqr/ksy_http.py @@ -19,8 +19,27 @@ class Http(object): return True, res.json().get('data') return False, None + # api/newusermsg/getkeywordreplymsg?corpId=&userId=&uId=&externalUserId=&sendType=&content= + @classmethod + def get_keyword_reply_msg(cls, corpid, userid, external_userid, uid=None, send_type=0, content=None): + # sendType 0 私聊,1 群聊 + uid = uid or 3 + url = f'{cls.BASE_URL}/api/newusermsg/getkeywordreplymsg' + params = { + 'corpId': corpid, + 'userId': userid, + 'externalUserId': external_userid, + 'uId': uid, + 'sendType': send_type, + 'content': content, + } + res = requests.get(url, params=params) + if res.status_code == 200: + return True, res.json().get('data') + return False, None + if __name__ == '__main__': - success, data = Http.get_new_user_msg('ww4450b72962300373', 'mg04598', 'wmAHf_bwAA90A6vdT0dDsWyqZJGgJOIg') + success, data = Http.get_new_user_msg('ww056d00fac4950f54', 'agent-Wang', 'wmy1VmQgAAd1BJaEHCrdOttQop7gg8Rg') print(success) print(data)