UpWork API 没有正确找到实体
UpWork API not finding entity properly
我可以使用以下方法获取我的公司 ID 和团队 ID:
companies.Api(client).get_list()
=> 这个returns公司ID
companies.Api(client).get_specific('COMPANY_ID')
=> 这是 returns 团队和团队 ID 的列表。公司 ID 必须正确,因为 API 正确 returns 我们公司的团队。
然而,当我运行:
time.Gds(client).get_by_team_full(company_id,team_id,params)
我得到:
{'errors': [{'message': 'Not Found: No entity found for parameters :
COMPANY_ID',
'reason': 'other'}], 'status': 'error', 'version': '0.6'}
文档说要使用 time.Api(client)
,但是当我尝试这样做时,我得到:
AttributeError: 模块 'upwork.routers.reports.time' 没有属性 'Api'
拜托,contact Support Team,这可能与您的个人数据有关,无法在此处解决。
我联系了支持团队,他们向我指出了以下端点:
https://developers.upwork.com/?lang=python#companies-and-teams_list-teams-in-company
然后我使用了下面的UpworkAPI方法:
companies.Api(client).get_teams('TEAM_ID')
有一个字符串ID与我之前使用的整数ID不同。这个新的字符串 ID 正是我需要使用的正确 ID。
我可以使用以下方法获取我的公司 ID 和团队 ID:
companies.Api(client).get_list()
=> 这个returns公司ID
companies.Api(client).get_specific('COMPANY_ID')
=> 这是 returns 团队和团队 ID 的列表。公司 ID 必须正确,因为 API 正确 returns 我们公司的团队。
然而,当我运行:
time.Gds(client).get_by_team_full(company_id,team_id,params)
我得到:
{'errors': [{'message': 'Not Found: No entity found for parameters : COMPANY_ID', 'reason': 'other'}], 'status': 'error', 'version': '0.6'}
文档说要使用 time.Api(client)
,但是当我尝试这样做时,我得到:
AttributeError: 模块 'upwork.routers.reports.time' 没有属性 'Api'
拜托,contact Support Team,这可能与您的个人数据有关,无法在此处解决。
我联系了支持团队,他们向我指出了以下端点: https://developers.upwork.com/?lang=python#companies-and-teams_list-teams-in-company
然后我使用了下面的UpworkAPI方法:
companies.Api(client).get_teams('TEAM_ID')
有一个字符串ID与我之前使用的整数ID不同。这个新的字符串 ID 正是我需要使用的正确 ID。