gberde | Posts: 19

How to update Onespan sign layouts using APIs?

0 votes

I have a template with 550 label fields. I saved the fields to a new layout. Now, I need to shift all 550 label fields 8 pixels up. Doing it manually is a painful process. 

Is there a way I can do this - 

1. Update my layout to move all those 550 label fields 8 pixels up using API endpoint

2. Apply the updated layout to my template. 

Is there an Endpoint to achieve step1 ?


Duo_Liang | Posts: 3776

Reply to: How to update Onespan sign layouts using APIs?

0 votes

Hi gberde,

 

Thanks for your post! You can either directly modify the template fields, or modify the layout fields then apply the layout in designer. Either way, you'd follow the similar steps below:

(1)Get the template or the layout ID and retrieve the template/layout JSON via below API:

GET /api/packages/{template_id_or_layout_id}

(2)Locate the fields under "documents" > "approvals". Because we can modify all fields under a signature/approval in one shot, we'll Get and Update each signature:

GET /api/packages/{template_id_or_layout_id}/documents/{document_id}/approvals/{approval_id}

With the response, loop through the "fields" and filter by their "subtype" by "LABEL". For each label field, decrease their "top" attribute by 8 pixel. Then send back the modified JSON via:

PUT /api/packages/{template_id_or_layout_id}/documents/{document_id}/approvals/{approval_id}

 

If it's a one-time operation, you can share your template/layout JSON to [email protected] and I can help you process the JSON. Otherwise you probably want to develop some script to programmatically handle the JSON considering the large amount of fields.

 

Duo

 

 


Duo_Liang | Posts: 3776

Reply to: How to update Onespan sign layouts using APIs?

0 votes

PS: for all your API calls, don't forget to add this request header to avoid missing field types - 

Accept: application/json; esl-api-version=11.53.1

 

Duo


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