Cannot get offset to work properly with Rest API

  • 13 June 2020
  • 0 replies
  • 43 views

Hi,
I'm trying to use the rest api but the offset is skipping strangely

for example if I use this

https://xxx.sysaidit.com/api/v1/list/company?offset=0&limit=10

I get this
{
"id": "company",
"caption": "Company",
"values": [
{
"id": "785",
"caption": "360 Gearboxes and Diffs"
},
{
"id": "861",
"caption": "3MP Internal"
},
{
"id": "842",
"caption": "3MP Pty Ltd"
},
{
"id": "4",
"caption": "A.J. Stockman Pty. Ltd"
},
{
"id": "727",
"caption": "Accent Hydroponics Pty Ltd"
},
{
"id": "723",
"caption": "Accountsoft Business Computing Pty Ltd"
},
{
"id": "694",
"caption": "Ace Packaging Supplies"
},
{
"id": "2",
"caption": "Action Bearing Distributors Pty Ltd"
},
{
"id": "698",
"caption": "Advance Build"
},
{
"id": "3",
"caption": "Aeria Country Floors Pty Limited"
}
]
}

If I do this


https://xxx.sysaidit.com/api/v1/list/company?offset=2&limit=10
I would have thought I would start at the 3rd item but I'm getting the 5th. Also I'm only getting 8.

{
"id": "company",
"caption": "Company",
"values": [
{
"id": "727",
"caption": "Accent Hydroponics Pty Ltd"
},
{
"id": "723",
"caption": "Accountsoft Business Computing Pty Ltd"
},
{
"id": "694",
"caption": "Ace Packaging Supplies"
},
{
"id": "2",
"caption": "Action Bearing Distributors Pty Ltd"
},
{
"id": "698",
"caption": "Advance Build"
},
{
"id": "3",
"caption": "Aeria Country Floors Pty Limited"
},
{
"id": "688",
"caption": "Agrispray Australian"
},
{
"id": "5",
"caption": "Alanco Australia"
}
]
}

0 replies

Be the first to reply!

Reply