kalkusa

Incorrect count of results when querying packages

0 votes

I'm querying packages from OneSpan Sign REST API. I don't use any filters, so I expect to get all of the packages. There are two, one in the inbox, and one in the drafts folder. 

Here's query

curl -X GET "https://sandbox.esignlive.com/api/packages" -H "accept: application/json; esl-api-version=11" -H "Authorization: Basic API KEY"

Response contains JSON with

{

   "count": 2"

   "results": [ ... ]

}

Surprisingly results array contains only one JSON (describing the package). Am I doing something wrong or is there a bug in the API?


Reply to: Incorrect count of results when querying packages

1 votes

Hi kalkusa,

 

Thanks for the post! Please be advised that you need to explictly set the "from" and "to" parameters, in order to retrieve multiple entities, otherwise only the first one will be returned like what you're experiencing.

OneSpan Sign package retrieval API has a limitation of 100 return entities. So according to the "count" normally you do 

GET /api/packages?from=1&to=100

GET /api/packages?from=101&to=200

So on so forth.

 

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off