Welcome to "Developing with DocuSign."
This episode covers the DocuSign Visual Studio extension.
This extension makes it easy for you
to add DocuSign functionality to your Visual Studio projects.
I'm Matt Lusher, of the DocuSign developer-content team.
We create content and tools to help you
develop DocuSign integrations.
In this video, I'm going to walk you
through installing the DocuSign Visual Studio extension,
and using it to create a new project.
You'll find the DocuSign.
Visual Studio extension in the Visual Studio marketplace.
Search for DocuSign.
Download the extension and open the VSIX file.
The extension will be automatically installed.
You can also install the extension
directly from within Visual Studio,
using the Extensions Manager.
Simply choose Manage Extensions from the Extensions menu.
The Extensions Manager will open to the Visual Studio
marketplace.
Search the marketplace for DocuSign,
and you'll find the extension.
Click Download.
And once the extension is downloaded, close
Visual Studio, to launch the Extensions Installer.
The DocuSign Visual Studio extension
supports both Visual Studio 2019 and Visual Studio 2017.
For this walkthrough, I'm using Visual Studio 2019,
Community Edition.
Open Visual Studio and create a new project.
The New Project dialog opens automatically
by default. If you don't see it, choose File, New, then Project.
Enter DocuSign in the search box.
You'll now see four new project types--
DocuSign console apps for .NET Core and .NET Framework,
plus DocuSign ASP.NET apps, for both .NET Core and .NET
Framework in C Sharp.
For this walkthrough, I'm going to create a DocuSign ASP.NET
for the .NET framework.
Select the project type you want and click Next.
Now it's time to configure your project.
Give it a name.
I'm using My First DocuSign App.
I'm accepting the defaults for where it's located
and the name of the solution file.
I'm also selecting the latest version of the .NET Framework.
Next, select the specific type of ASP.NET to create.
I'm selecting an ASP.NET MVC application.
Once you've selected yours, click Create.
Since this is a DocuSign application,
you've got to select which type of authentication
you want to use.
The DocuSign extension supports two-- authentication workflows
Authorization Code Grant and JSON Web Token Grant.
For most scenarios, we recommend Authorization Code Grant .
It requires that the user of your app
log in to DocuSign and authorize your app,
before DocuSign will grant your app an access token
to use DocuSign APIs.
However, if your scenario doesn't
require that users log in, you can use JSON Web Token Grant.
In this workflow, your app authenticates
wants on behalf of a single user,
and then uses that authentication
to access DocuSign APIs for everything it does.
For this video, I'm choosing Authorization Code Grant.
To use Authorization Code Grant, you'll
need an integration key, a redirect URI, and a secret key.
The integration key is automatically
generated for your application when you register it
in DocuSign admin.
At the same time, you can add a secret key, also generated
by DocuSign.
You need to supply the redirect URI yourself.
This is a URL that points to the place in your application
where you'll want your users to go once they've logged in.
More info about these settings is available on the DocuSign
Developer Center.
Once you've filled these in, click Finish,
and Visual Studio will create your project.
As part of the project, you can import
working code from any of DocuSign's
e-signature API-code examples.
Just check the ones you want, and the DocuSign Visual Studio
extension will load them into your project automatically.
For any of these code examples, you
can find pages on the DocuSign developer center that
walk you through the examples and describe
how the code works.
For this walkthrough, I'm selecting Embedded Signing
Ceremony and Creating An Envelope From The Template.
Choose the ones you want and click Add.
You can see that the extension has added
two files to the project--
Create An Envelope From Template.CS and Embedded
Signing Ceremony.CS.
The third file, DSL Win Startup CS,
is added to implement authentication to the DocuSign
e-signature REST API.
Depending on the type of application
you've chosen to create, you'll need to add some custom
code to your project.
For an ASP.NET app for the .NET framework,
you'll need to make three changes.
First, open the WEB.config file.
This is a standard configuration file for ASP.NET apps.
In the App Settings section, add this key,
which you can get from the Extensions marketplace page.
You'll need to replace your app URL, including the brackets,
with the actual URL for your app.
During development, this will most likely on local-host
address to your personal web server on your dev machine.
When you're ready to deploy, change this
to the live-production URL, where your app will
be made available.
Next, open the Filter Config.CS file and add two lines.
You can get these lines from the marketplace page.
First, to the Using section at the top, add this line.
Make sure you replace your namespace, including
the brackets, with the namespace for your app.
Since that's defined in the line below,
it's a simple copy-paste.
Second, add this line to the register global filters method.
Finally, open DSL Win Startup.CS.
Insert this line, which you can get from the marketplace page--
at the top, just above the namespace definition.
You'll need to replace your namespace,
including the brackets, with the namespace for your app.
Since that's defined in the line below,
it's as easy as a copy-paste.
Saves your changes to all three files, and you're done.
Your project is now ready to work with DocuSign APIs.
You can experiment with any example code you've imported,
and write your own code as well, to complete
your app as you see fit.
You can also use the DocuSign Visual Studio extension,
to configure an existing project to use DocuSign APIs.
To do that, right-click your project in Visual Studio
to open the context menu and find the DocuSign pop-up menu.
Choose Configure Project.
The extension will walk you through the same steps,
to configure DocuSign settings as if you
were creating a new project.
Now that you've seen how easy it is to use the DocuSign Visual
Studio extension to create and configure projects
to use the DocuSign APIs, you're ready to begin developing
with DocuSign in Visual Studio.
Want to know more about DocuSign's signs APIs?
The DocuSign Developer Center contains guides, how-to's, SDKs
and other tools, and lots of resources,
to help you learn how to develop integrations with DocuSign.
And thanks for watching.