First off, I'm really new to the python requests module and using API in general. Chances are I made a basic mistake somewhere.
I'm trying to retrieve data from the exactonline API. Some data (eg: list of projects and cost transactions) I can retrieve relatively simply, so bearer code and current division should be ok. However, when I try to request data regarding hours worked I get only Null and 0 values.
I'm using requests as specified by this page: https://start.exactonline.nl/docs/HlpRestAPIResources.aspx?SourceAction=10
To be specific, I've tried these 4 functions:
- RecentHours
- HoursByDate
- HoursById
- RecentHoursByNumberOfWeeks
For RecentHours I use
headers = {'Authorization': 'Bearer ' + bearer_token}
result = requests.get('https://start.exactonline.nl/api/v1/' + CURRENT_DIVISION + "/read/project/RecentHours",
headers=headers,
params=query_args)
return(result.text)
For HoursByWeek I use (I currently only request one piece of information because that way I'm sure I didn't make any typo's in the query_args):
headers = {'Authorization': 'Bearer ' + bearer_token}
query_args = {'numberOfWeeks': '15',
'select': 'AccountCode'}
result = requests.get('https://start.exactonline.nl/api/v1/' + CURRENT_DIVISION + "/read/project/RecentHoursByNumberOfWeeks",
headers=headers,
params=query_args)
return(result.text)
All return status code 200, and no data.
According to this page (https://support.exactonline.com/community/s/knowledge-base?language=en_GB#All-All-DNO-Content-resp-codes-error-handling) this means I don't have access rights to this information. However, when I log in without using API I can access this information, so that seems strange to me. I've also tried logging in with the account with the highest freedom, but this still returns only null information.