python - 使用 Python 调用经过身份验证的 Beebole API
问题描述
所以我需要用 python 调用 beebole API。(文档https://beebole.com/timesheet-api/)。
我还想将调用保存在 csv/excel 文件中(但现在如果我能够使请求工作,已经是一大步了)
我正在尝试以下操作 - 使用服务 person.get 没有成功(我只收到消息 - 过程以代码 0 完成)
import requests
payload = {
"service": "person.get",
"id": user_ID
}
auth = {
"username": "token",
"password": "password"
}
url = "https://beebole-apps.com/api/v2"
req = requests.get(url, params=payload, auth=auth).json()
print(req)
解决方案
如果你还没有解决它。这应该适合你:
import requests
payload = {
"service": "person.get",
"id": user_ID
}
auth = ("token", 'x')
url = "https://beebole-apps.com/api/v2"
req = requests.post(url, json=payload, auth=auth).json()
print(req)
推荐阅读
- python - 尝试使用 OpenCV 显示图像时,Jupyter 内核崩溃
- arrays - 使用“comm”查找两个数组之间的匹配项
- ruby-on-rails - rails_admin 不允许我将枚举字段保留为 nil
- angular - 通过 url 和 ngxs 组合设置 Angular 8 应用程序的状态
- html - 根据 JSON 文件数据更改 span 类标题
- javascript - 读取数据并单击停止按钮
- events - 从单个 Lambda 调用多个 Lambda
- node.js - 如何根据特定的时间戳在不同的时间触发计划任务
- javascript - 如何像您的数据库一样通过 JSON 产品?
- connection - 如何在 VHDL 中将端口正确连接到总线?