How to embed the Docusign UI in your app
This topic demonstrates how to embed the Docusign UI in your app. Creating a console view enables you to load the Docusign UI within your application, providing the same options and functionality as if you were logged in to your developer or production account. You can choose to load either the UI’s front page or a view of a specific envelope’s documents as the starting page.
Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby.
Required data
Running the code in this how-to requires this data:
Step 1. Obtain your OAuth token
To make the API call shown in this how-to, you need a valid OAuth access token. Docusign supports access tokens for three different recommended OAuth grant types: Public Authorization Code Grant, Confidential Authorization Code Grant, and JSON Web Token (JWT) Grant. Choose the OAuth grant type appropriate for your scenario.
See Confidential Authorization Code Grant for guidance on your options to get an Confidential Authorization Code Grant OAuth token.
Step 2. Create the console view request
Create a sender view and return the URL using the following steps:
- Instantiate the Docusign API client.
- Set the following default request header to add your access token (obtained using any of the Docusign authentication flows):
"Authorization" : "Bearer {Access Token String}" - Initialize the Envelopes API.
- Create a
ConsoleViewRequestobject that holds the redirect URL and the starting view. If the starting view will be of the documents of a particular envelope, it will also record that envelope’s ID. - Create the view request by calling
CreateConsoleView, and passing in your account ID and the console view request object. This will return an object containing the URL for the desired Docusign UI page.
Expected response
If you run this code example from our Quickstart or launcher projects, you should see a JSON response similar to the code shown.
Next steps
- Run this code example from our Quickstart or launcher projects: Bash, C#, Java, Node.js, PHP, PowerShell, Python, or Ruby.
- See how to Go-Live with a completed app and find the base path for API calls in the production environment.