英文:
Xero Invoice API Can return date range but won't let me add page parameter. What am i doing wrong
问题
我对Xero API还不太熟悉,但已经成功实现了大部分功能。我正在尝试返回一个日期范围内的发票列表。我可以使用以下网址来实现:
https://api.xero.com/api.xro/2.0/Invoices?where=Type=="ACCREC" AND Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31)
这个方法可以正常工作并返回发票,但只返回摘要信息(没有发票明细)。我知道使用这个端点需要使用分页来从API获取所有信息,但我似乎无法弄清楚如何添加分页。如果我使用以下链接:
https://api.xero.com/api.xro/2.0/Invoices?where=Type=="ACCREC" AND Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31)?Page=1
它会返回一个错误。我做错了什么?
英文:
I am pretty new to Xero API but have gotten most things working. I am trying to return a list of invoices from a date range. I can do this by using the following url
https://api.xero.com/api.xro/2.0/Invoices?where=Type=="ACCREC" AND Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31)
This works fine and returns the invoices but only returns the summary info (no invoicelines). I know that using the endpoint required you to use pagination to get the all the info from the api but i can't seem to figure out how to add the pagination to this. If i use this
https://api.xero.com/api.xro/2.0/Invoices?where=Type=="ACCREC" AND Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31)?Page=1
it returns an error. What am i doing wrong?
答案1
得分: 0
你在使用以下代码时是否遇到错误?
api.xero.com/api.xro/2.0/Invoices?where=Type=="ACCREC" AND Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31) AND Page=1
你遇到了什么错误?
你可以尝试以下代码:
GET https://api.xero.com/api.xro/2.0/Invoices?where=Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31)&page=1
英文:
Did you get an error when using
api.xero.com/api.xro/2.0/Invoices?where=Type=="ACCREC" AND Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31) AND Page=1
what error did you get?
Can you try
GET https://api.xero.com/api.xro/2.0/Invoices?where=Date>=DateTime(2022,12,15) AND Date<=DateTime(2022,12,31)&page=1
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论