mikcanf

Not retrieving list of packages

0 votes

/api/packages?predefined=all&from=1&to=99999&predefined=all

returns 

{

    "results": [],

    "count"0

}

I believe there should be 1000s of packages returned...


Reply to: Not retrieving list of packages

0 votes

Hi Mike,

 

Before we start to troubleshoot with the issue, I want to share with you some interesting facts regarding to the API retrieval API:

(1)OneSpan Sign API has a limitation of 100 return entities, so normally the "count" attribute returns you the total amount, and the "results" array at most includes 100 nodes.

{

    "results": [ ...

     ],

    "count": 224

}

(2)That's why normally it's suggested to use "&from=1&to=100", "&from=101&to=200", and so on to paginate through all packages.

(3)For other available parameters, most commonly used ones are:

"query": indicate the package status, available values are "COMPLETED", "ARCHIVED", "DRAFT", "SENT", "EXPIRED", "OPTED_OUT", "DECLINED"

"lastUpdatedStartDate": start date of a given time period, when the package get last updated 

"lastUpdatedEndDate":  end date of a given time period, when the package get last updated 

So the API could look like:
/api/packages?from=1&to=100&query=COMPLETED&lastUpdatedStartDate=2020-01-01&lastUpdatedEndDate=2020-07-28

/api/packages?from=101&to=200&query=COMPLETED&lastUpdatedStartDate=2020-01-01&lastUpdatedEndDate=2020-07-28

(4)API Key/ API Token only returns packages created by the holder of this key/token, won't return packages created by other senders.

 

In terms of the issue that you saw the return number is 0, are you invoking the API with API Token? Which sender this token belongs to? Have this sender created any packages?

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to:

0 votes

 

Hi Duo, I updated parms per below:

GET https://apps.e-signlive.ca/api/packages?from=1&to=100&query=COMPLETED&lastUpdatedStartDate=2020-01-01&lastUpdatedEndDate=2020-07-28

If I create Token via /apitoken/clientApp/accessToken with "type":"SENDER" + "email":"<my email>" and use generated Token as Authorization for /api/packages call I do get returned data, but seems only my data

 

If I create Token via /apitoken/clientApp/accessToken with "type":"OWNER" I don't get data, just {    "results": [],    "count"0 }

*note: I am not actual OWNER of target account, which could be issue but I still want to pull out list of ALL packages, not just my own. 

 


Reply to: Not retrieving list of packages

0 votes

Hi Mike,

 

It's expected that you can only pull your own packages, if given an API Token. In order to get list of ALL packages, you need a list of emails under your account, then create API Tokens for respectively senders and pull packages in separate calls.

 

Duo

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