python对接微吼

阅读: 评论:0

python对接微吼

python对接微吼

class AccountSync(object):def __init__(self):# 微吼self.auth_type = 1  # 授权类型,1为验证帐号和密码(目前只通过帐号和密码验证)self.account = 'xxx'  # auth_type为1时为必填项,用于登录e.vhall的帐号,是在“帐号设置”页面里查找到的“帐号”self.password = 'xxxx'  # auth_type为1时为必填项,用于登录e.vhall的密码,用于登录的密码self.wh_find_url = ""  # 获取微吼用户IDself.wh_add_url = ""  # 创建微吼用户# 添加微吼用户def set_wh_user(self, user_list):if user_list:for user in user_list:username = user['name_']password = user['password_']body = {"third_user_id": username,"auth_type": self.auth_type,"account": self.account,"password": self.password}find_res = hx_request.post(url=self.wh_find_url, headers=self.headers, parameters=body)if find_res.data['code'] != '200':  # 微吼没有该用户('微吼没有用户: %s' % user)body['pass'] = passwordresponse = hx_request.post(url=self.wh_add_url, headers=self.headers, parameters=body)if response.data['code'] != 200:  # 增加微吼用户失败('增加微吼用户失败: %s, error_msg:%s' % (user, response.data['msg']))if response.data['code'] == 200:  # 增加微吼用户成功logger.info('增加微吼用户成功: %s' % user)

其他接口微吼api文档:

.html

本文发布于:2024-02-01 06:56:37,感谢您对本站的认可!

本文链接:https://www.4u4v.net/it/170674179934711.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:python
留言与评论(共有 0 条评论)
   
验证码:

Copyright ©2019-2022 Comsenz Inc.Powered by ©

网站地图1 网站地图2 网站地图3 网站地图4 网站地图5 网站地图6 网站地图7 网站地图8 网站地图9 网站地图10 网站地图11 网站地图12 网站地图13 网站地图14 网站地图15 网站地图16 网站地图17 网站地图18 网站地图19 网站地图20 网站地图21 网站地图22/a> 网站地图23