How to Open an Embedded Claim URL
For some of our examples such as Create Embedded Unclaimed Draft or Create Embedded Unclaimed Draft With Template you may have noticed that it returns a UnclaimedDraftResponse object. This object contains a claim url in the UnclaimedDraft object. In order to open this url you'll need to use the HelloSign Embedded JavaScript library.
Provided below is a basic example on how to open a claim url using a Visualforce page with an Apex controller. The controller retrieves the HelloSign client id which is required when attempting to open the claim url.
You can also use the following tool to quickly test: https://app.hellosign.com/api/embeddedTest
public class OpenClaimUrlController {
public String getClientId() {
return HelloSign.HelloSignDocumentService.getHelloSignClientId();
}
}
<apex:page controller="OpenClaimUrlController">
<script>
const client = new HelloSign({
clientId: '{!JSENCODE(clientId)}'
});
client.open(
// You may need to encode your url parameter value.
// https://www.urlencoder.org/ is a useful resource to use
'{!JSENCODE($CurrentPage.parameters.url)}'
);
</script>
<apex:includeScript value="{!URLFOR($Resource.hsAssets, 'libs/hellosign-embedded.js')}" />
</apex:page>
Updated over 4 years ago