Thank you for visiting our Partner Zone. This area is an exclusive space for MYOB Partners. Find out how to Partner with MYOB.
October 2020
October 2020
Hi,
I am trying to query for past timesheets using Postman and am able to only get the current week's timesheet data (while no filter is used).
This query does not work: (see screenshot below)
{{company_file_uri}}/{{company_file_id}}/Payroll/Timesheet/?$filter=StartDate eq datetime'2020-10-19' and EndDate eq datetime'2020-10-25'
I've also tried filtering with only the StartDate or EndDate - no success.
While this query works:
{{company_file_uri}}/{{company_file_id}}/Payroll/Timesheet/ but only shows the current period's timesheets.
This seems to be the same issue as what was here: https://community.myob.com/t5/MYOB-API-questions-and-answers/Timesheets-Request-Only-Returns-Timeshe...
I've already tried the solution there with no success.
Also, if there is some prepared query that you can share that will provide a report similar to the one we can generate through REPORTS > Timesheets, that would be awesome.
Any assistance would be appreciated.
Regards,
Ed
Solved! Go to Solution.
October 2020
October 2020
Hi @EdCadorniga , for a range of timesheets, I wonder if this would work:
$filter=StartDate ge datetime'2020-10-19' and EndDate le datetime'2020-10-25'
or possibly this:
$filter=StartDate ge datetime'2020-10-19 00:00:00' and EndDate le datetime'2020-10-25 23:59:59'
I don't have access to any timesheet data atm, so I can't test it.
Regards, Mike (mike@datawise.co.nz)
DataWise Limited (www.datawise.co.nz), developers of:
DataWise ProActive - Custom Reporting from MYOB programs
(MYOB Business, including AccountRight Live, AccountRight v19.x and exo Payroll)
Bulk download of attachments (more details...)
October 2020 - last edited October 2020
October 2020 - last edited October 2020
Hi, @Mike_James.
Thanks for responding. I tested both filters and both were unsuccessful, unfortunately. I have attached the responses I have received.
Regards,
Ed
November 2020
November 2020
The issue still remains. Please help.
Thanks.
November 2020 - last edited November 2020
November 2020 - last edited November 2020
Hi there.
Thank you for reaching out and apologise for the delayed response.
The /{cf_uri}/Payroll/Timesheet endpoint contains a query/filter by default in the URI response of your standard request.
This query is compulsory and is what enables this area to display the timesheets in the current period without needing to have your own query to do so.
What I recommend is copy this URI from your response and use it as a template to create the query.
You will notice that this query isn't quite formatted like our typical Odata filters.
Here is what it will look like:
https://ar1.api.myob.com/accountright/36c69572-d2a7-4539-86df-5d47256d098c/Payroll/Timesheet/d6a5a299-0c4e-40f1-9a98-df1575cdf9d1?StartDate=2020-10-21T00:00:00&EndDate=2020-10-27T00:00:00"Edit the details/date and run your GET request using this and you will be able to display the timesheets within the date range.
Thanks,
@Tana
MYOB API Specialist
MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's
Did my answer help?
Mark it as a Solution
November 2020
November 2020
Thanks for your response, Tana.
I tried the query (after editing the dates) but still can't get data. One thing I noticed is that I don't have a variable for the Timesheet GUID. How do I get that data?
Ran the queries:
I tried it as is after I modified the dates - nogo.
I also tried changing the CF_Uri with our own - nogo.
***Tried without the {Timesheet GUID} and that worked.
{{company_file_uri}}/{{company_file_id}}/Payroll/Timesheet/?StartDate=2020-10-19T00:00:00&EndDate=2020-10-25T00:00:00
Does this mean I can no longer apply any filter to this query?
Not sure if that should be a new question but I'll mark your response as the solution.
Thank you for your help.
Regards,
Ed
November 2020
November 2020
Thank you for the update there.
The URI I posted came directly from the response headers when running a GET request to /{cf_uri}/Payroll/Timesheet/{timesheet URI} (We used insomnia for this test).
This URI automatically had the query at the end, so for us was just a matter of changing the dates and copy/pasting this URI as a standard GET request, this appears to be the only way run this query.
The image you have pasted I would assume wouldn't work, trying to use the params wont work like that i'm afraid and can only be entered as a request.
If you would like us to investgate this further create a support ticket here and we can run some tests using some of your details and try replicate our success.
Kind regards
Thanks,
@Tana
MYOB API Specialist
MYOB API Support Centre|MYOB App Marketplace|MYOB AccountRight API Endpoint Doc's
Did my answer help?
Mark it as a Solution
41
|
3195
|
|||
1
|
212
|
|||
33
|
1520
|
|||
9
|
580
|
|||
by
KILIQUIDWASTE
September
26
1056
|
26
|
1056
|