简体   繁体   English

使用 Python 调用 Authenticated Beebole API

[英]Calling Authenticated Beebole API using Python

So I need to call beebole APIs with python.所以我需要用python调用beebole API。 (documentation https://beebole.com/timesheet-api/ ). (文档https://beebole.com/timesheet-api/ )。

I would also like to save the call in a csv/excel file (but for now If I am able to make the request work, is already a big step)我还想将调用保存在 csv/excel 文件中(但现在如果我能够使请求工作,已经是一大步)

I am trying the following - with the service person.get without success (I only get the message - process finished with code 0)我正在尝试以下 - 服务 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)

In case you didn't already solve it.如果你还没有解决它。 This should work for you:这应该适合你:

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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM