Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/sharepoint/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby Xeroizer::ApiException:QueryParseException:无属性或字段';库存标识';存在_Ruby_Ruby On Rails 4_Rubygems_Xero Api_Xeroizer - Fatal编程技术网

Ruby Xeroizer::ApiException:QueryParseException:无属性或字段';库存标识';存在

Ruby Xeroizer::ApiException:QueryParseException:无属性或字段';库存标识';存在,ruby,ruby-on-rails-4,rubygems,xero-api,xeroizer,Ruby,Ruby On Rails 4,Rubygems,Xero Api,Xeroizer,我试图在一次API点击中获得所有发票。 因为,对于每个拥有100张发票的用户 它将超过API限制(分钟限制:在60秒的滚动窗口中调用60次) 我试图将所有发票id存储到一个数组中,从中我将获得用户的详细信息,然后在本地循环记录并显示它。这条路对吗 invoice_ids = user.estimates.select("invoice_id") || [] xero = Xeroizer::PrivateApplication.new(XERO_CONFIG["key"], XERO_CONFI

我试图在一次API点击中获得所有发票。 因为,对于每个拥有100张发票的用户

它将超过API限制(分钟限制:在60秒的滚动窗口中调用60次)

我试图将所有发票id存储到一个数组中,从中我将获得用户的详细信息,然后在本地循环记录并显示它。这条路对吗

invoice_ids = user.estimates.select("invoice_id") || [] xero = Xeroizer::PrivateApplication.new(XERO_CONFIG["key"], XERO_CONFIG["secret"], XERO_CONFIG["path"], :rate_limit_sleep => 5)
invoices = ['795f789b-5958-xxxx-yyyy-48436dbe7757','987g389b-5958-xxxx-yyyy-68636dbe5589'] 
inv_id = invoice_ids.pluck(:invoice_id) 
invoices = xero.Invoice.all(:where => 'InvoiceID==inv_id')
此外,我还收到以下错误:

Xeroizer::ApiException (QueryParseException: No property or field 'inv_id' exists in type 'Invoice')

看起来问题在于没有正确插入
inv\u id
s。您可能需要这样做:

invoices = xero.Invoice.all(:where => "InvoiceID==\"#{inv_id}\"")

您可能需要对
inv\u id
变量执行一些额外的格式设置,使其成为有效的Xero字符串

问题似乎在于没有正确插入
inv\u id
s。您可能需要这样做:

invoices = xero.Invoice.all(:where => "InvoiceID==\"#{inv_id}\"")
您可能需要对
inv\u id
变量执行一些额外的格式设置,使其成为有效的Xero字符串