This sample code shows you how to use Apache Wink RestClient to make a POST (/api/packages) request creating a new package at OneSpan Sign.
The payload I used in this example was:
{"status":"SENT","description":"New Package","language":"en","roles":[{"id":"Role1","signers":[{"company":"OneSpan Sign","firstName":"1.firstname","lastName":"1.lastname","email":"[email protected]"}]},{"id":"Role2","signers":[{"company":"OneSpan Sign","firstName":"2.firstname","lastName":"2.lastname","email":"[email protected]"}]}],"autocomplete":true,"emailMessage":"","documents":[{"approvals":[{"role":"Role1","fields":[{"page":0,"top":100,"subtype":"FULLNAME","height":50,"left":100,"width":200,"type":"SIGNATURE"}]},{"role":"Role2","fields":[{"page":0,"top":300,"subtype":"FULLNAME","height":50,"left":100,"width":200,"type":"SIGNATURE"}]}],"name":"Test Document"}],"name":"Example Package","type":"PACKAGE"}
Dependencies I used for the code was: