I see this documentation of docusign JS embedding to get the event just for Signing view. Is this not relevant for when we create Preview urls of Envelope?
I have created and envelope and opening up a preview within an iframe. I wanted to catch events directly in my parent window but doesnt seem to be working.
Hello
To use focused view with i-frames you need to create your view, just like the article said, but also, you need to generate a sender view, and embed the view in the i-Frame.
You can check how to create your view here:
async function createSenderView(accessToken, accountId, envelopeId) {
const docusign = require('docusign-esign');
const apiClient = new docusign.ApiClient();
apiClient.setBasePath('https://demo.docusign.net/restapi');
apiClient.addDefaultHeader('Authorization', `Bearer ${accessToken}`);
const envelopesApi = new docusign.EnvelopesApi(apiClient);
const viewRequest = new docusign.ReturnUrlRequest();
viewRequest.returnUrl = 'https://application.test.com/return';
try {
const result = await envelopesApi.createSenderView(accountId, envelopeId, { returnUrlRequest: viewRequest });
return result.url;
} catch (error) {
console.error('Error creating sender view:', error);
throw error;
}
}
And you can check how to embed an URL here:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DocuSign Sender View</title>
</head>
<body>
<iframe id="docusign-sender-view" width="100%" height="100%" frameborder="0"></iframe>
<script>
async function embedSenderView() {
const senderViewUrl = 'YOUR_SENDER_VIEW_URL'; // Replace with your dynamically generated URL
const iframe = document.getElementById('docusign-sender-view');
iframe.src = senderViewUrl;
}
embedSenderView();
</script>
</body>
</html>
Hi Eduardo,
Thanks for your reply. I would like to add, I have done exactly as you mentioned of embedding senderViewUrl inside an iframe; but when creating SenderView - I can pass redirectUri in the api, right? now the issue I had was that redirectUri domain cannot be opened in an embedded iframe unfortunately. So I am unable to capture the event in the redirectUri and utilize the above solution.
Therefore I raised - if it were possible to, perhaps, publish the user’s events to the parent iframe for Embedded sender view (similar to using docusign-js in signing view )
Sign up
Already have an account? Login
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.
Customer Login/Registration Developer Login/RegistrationDocusign Community
You can login or register as either a Docusign customer or developer. If you don’t already have a Docusign customer or developer account, you can create one for free when registering.
Customer Login/Registration Developer Login/RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.