dzhu2005

How to load layouts via API for sender by email address/OneSpan account

0 votes

Please note that we are currently using .NET SDK to integrate with OneSpan and need to load layouts for sender accounts. Each sender is identified by their email address. Currently with the code noted below, we are able to load shared layouts but not layouts that are specific to a user. Our questions are:

  1. How to load layout by sender’s email address
  2. How to tell the layout is shared or not

 

PageRequest pageRequest = new PageRequest(1, 100);

var layouts = eslClient.LayoutService.GetLayouts(Direction.ASCENDING, pageRequest)

 

Kindly advise.

 


Reply to: How to load layouts via API for sender by email address/OneSpan account

0 votes

Hi Daniel,

 

Actually for the layout retrieval API, there are two parameters "ownerUserId" and "ownerEmail" that allows to filter by sender. These two parameters are newly added and unfortunately hasn't been introduced to SDK. If it's possible to re-implement the function with RESTful code instead of SDK, this could definitely be one solution.

If with purely SDK code, you will need to create separate OssClient objects with senders' respective API Keys or API Tokens, in order to retrieve the layouts created by themselves.
-API Token could be more SDK friendly, check below blog for the steps to register client app and request access token:
OneSpan Sign Release 11.34: API Token for Client Application

-To retrieve sender's API Key, you'll need some custom code to achieve the goal, refer to the sample code I shared in below post:

https://community.onespan.com/forum/get-senders-api-keys

 

In order to tell if a layout is shared or not, it's identified by DocumentPackage.Visibility (Enum), "ACCOUNT" means it's shared and "SENDER" means it's not shared.

 

Duo

Duo Liang OneSpan Evangelism and Partner Integrations Developer


Reply to: How to load layouts via API for sender by email address/OneSpan account

0 votes

Hi Duo,

 

Thank you for your reply, I will try REST API. Is that possible to mix .NET SDK and REST API? I will keep our existing code to continue to use .NET SDK, and only use REST API to manage the layout.

 

Do I need contact support to enable REST API on my account? What is the server endpoint for Canada Accounts?

 

Thanks.

 


Reply to: How to load layouts via API for sender by email address/OneSpan account

0 votes

Hi dzhu2005,

 

Yes, it's possible to use RESTful API and SDK functions in a hybrid way. You don't need to contact support team, if you are able to use your API Key, the REST API service should be enabled by default. For CA sandbox environment, your API endpoint will be "https://sandbox.e-signlive.ca/api" (e.g. GET https://sandbox.e-signlive.ca/api/packages).

 

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