[英]Is there a known offset limit for NetSuite REST API calls?
世界! 我們正在嘗試使用NetSuite SuiteQL REST API來下拉數據。 它對於我們采購的大多數記錄都非常有效,但是當我們遇到大表時,我們遇到了一個有趣的障礙。
由於單頁數據的已知限制是 1,000 行,我們只是以 1,000 的限制來調用它,並將偏移量設置為 1,000 行增量。 當我們為大於 100,000 行的記錄獲得 100,000 行的偏移量時,會發生一些有趣的事情。
如果我們調用https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=98000 ,我們會得到我們期望的所有鏈接。
{
"links": [
{
"rel": "previous",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=97000"
},
{
"rel": "first",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=0"
},
{
"rel": "next",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=99000"
},
{
"rel": "last",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=753000"
},
{
"rel": "self",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=98000"
}
],
"count": 1000,
"hasMore": true,
"items": [
{
[heres my data]...
將其設置為 99,000,很多信息就會消失。 就好像它認為這是最后一頁。
{
"links": [
{
"rel": "previous",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=98000"
},
{
"rel": "first",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=0"
},
{
"rel": "self",
"href": "https://myinstance.suitetalk.api.netsuite.com/services/rest/query/v1/suiteql?limit=1000&offset=99000"
}
],
"count": 1000,
"hasMore": false,
"items": [
{
[heres my data]...
將其設置為 100,000 會給我一個錯誤。
{
"type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.5",
"title": "Not Found",
"status": 404,
"o:errorDetails": [
{
"detail": "The specified query parameter 'offset' is out of bounds. Provide value between 0 and 753000.",
"o:errorQueryParam": "offset",
"o:errorCode": "INVALID_PARAMETER"
}
]
有沒有人見過這種行為? 我瀏覽了文檔,但找不到任何提及頁面偏移限制的內容,所以我認為這可能是某種錯誤(事實上它甚至告訴您最大范圍,並且明顯高於指定的偏移量使得我認為這是一個錯誤),但希望有人可能以前見過這個,甚至更好的是,對如何解決這個問題有想法!
NetSuite REST Web Services 的官方文檔提到了這個限制 [ 1 ]:
使用 SuiteQL 查詢,您最多可以返回 100,000 個結果。 有關詳細信息,請參閱 query.runSuiteQLPaged(options)。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.