Xero发票API可以返回日期范围,但不允许我添加页面参数。我做错了什么?

huangapple go评论57阅读模式
英文:

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==&quot;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==&quot;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==&quot;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==&quot;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==&quot;ACCREC&quot; AND Date&gt;=DateTime(2022,12,15) AND Date&lt;=DateTime(2022,12,31) AND Page=1

你遇到了什么错误?

你可以尝试以下代码:

GET https://api.xero.com/api.xro/2.0/Invoices?where=Date&gt;=DateTime(2022,12,15) AND Date&lt;=DateTime(2022,12,31)&amp;page=1
英文:

Did you get an error when using

api.xero.com/api.xro/2.0/Invoices?where=Type==&quot;ACCREC&quot; AND Date&gt;=DateTime(2022,12,15) AND Date&lt;=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&gt;=DateTime(2022,12,15) AND Date&lt;=DateTime(2022,12,31)&amp;page=1

huangapple
  • 本文由 发表于 2023年7月24日 00:04:29
  • 转载请务必保留本文链接:https://go.coder-hub.com/76749173.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定