This commit is contained in:
parent
77bd4b2d1a
commit
3f3611592e
|
@ -19,8 +19,27 @@ class Http(object):
|
||||||
return True, res.json().get('data')
|
return True, res.json().get('data')
|
||||||
return False, None
|
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__':
|
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(success)
|
||||||
print(data)
|
print(data)
|
||||||
|
|
Loading…
Reference in New Issue