All Projects → docusign → code-examples-python

docusign / code-examples-python

Licence: MIT license
Python code examples and launcher

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to code-examples-python

code-examples-csharp
C# code examples and launcher
Stars: ✭ 34 (+9.68%)
Mutual labels:  docusign, rooms-api, click-api
code-examples-node
Node.js code examples and launcher
Stars: ✭ 40 (+29.03%)
Mutual labels:  docusign, rooms-api, click-api
code-examples-php
PHP code examples
Stars: ✭ 34 (+9.68%)
Mutual labels:  docusign, rooms-api, click-api
docusign-bundle
Symfony bundle to create electronic signatures with DocuSign
Stars: ✭ 27 (-12.9%)
Mutual labels:  docusign
blockusign
A decentralized, encrypted document signing tool where you own and control your own documents, contracts and data. It is built on Blockstack
Stars: ✭ 48 (+54.84%)
Mutual labels:  docusign
docusign-esign-csharp-client
The Official DocuSign C# Client Library used to interact with the eSignature REST API. Send, sign, and approve documents using this client.
Stars: ✭ 112 (+261.29%)
Mutual labels:  docusign
Vulnerable-OAuth-2.0-Applications
vulnerable OAuth 2.0 applications: understand the security implications of your OAuth 2.0 decisions.
Stars: ✭ 224 (+622.58%)
Mutual labels:  authorization-code-grant
ms-identity-javascript-angular-spa-aspnetcore-webapi
An Angular single-page application that authenticates users with Azure AD and calls a protected ASP.NET Core web API using MSAL Angular
Stars: ✭ 72 (+132.26%)
Mutual labels:  authorization-code-grant

Python Launcher Code Examples

GitHub repo: code-examples-python

This GitHub repo includes code examples for the DocuSign Admin API, Click API, eSignature REST API, Monitor API, and Rooms API. By default, the launcher will display the eSignature examples. To switch between API code examples, select "Choose API" in the top menu.

Introduction

This repo is a Python 3 application that supports the following authentication workflows:

  • Authentication with DocuSign via Authorization Code Grant. When the token expires, the user is asked to re-authenticate. The refresh token is not used.

  • Authentication with DocuSign via JSON Web Token (JWT) Grant. When the token expires, it updates automatically.

eSignature API

For more information about the scopes used for obtaining authorization to use the eSignature API, see Required scopes.

For a list of code examples that use the eSignature API, see the How-to guides overview on the DocuSign Developer Center.

Rooms API

Note: To use the Rooms API, you must also create your Rooms developer account. Examples 4 and 6 require that you have the DocuSign Forms feature enabled in your Rooms for Real Estate account.
For more information about the scopes used for obtaining authorization to use the Rooms API, see Required scopes.

For a list of code examples that use the Rooms API, see the How-to guides overview on the DocuSign Developer Center.

Click API

For more information about the scopes used for obtaining authorization to use the Click API, see Required scopes

For a list of code examples that use the Click API, see the How-to guides overview on the DocuSign Developer Center.

Monitor API

Note: To use the Monitor API, you must also enable DocuSign Monitor for your organization.

For information about the scopes used for obtaining authorization to use the Monitor API, see the scopes section.

For a list of code examples that use the Monitor API, see the How-to guides overview on the DocuSign Developer Center.

Admin API

Note: To use the Admin API, you must create an organization in your DocuSign developer account. Also, to run the DocuSign CLM code example, CLM must be enabled for your organization.

For information about the scopes used for obtaining authorization to use the Admin API, see the scopes section.

For a list of code examples that use the Admin API, see the How-to guides overview on the DocuSign Developer Center.

Installation

Prerequisites

Note: If you downloaded this code using Quickstart from the DocuSign Developer Center, skip items 1 and 2 as they were automatically performed for you.

  1. A free DocuSign developer account; create one if you don't already have one.

  2. A DocuSign app and integration key that is configured to use either Authorization Code Grant or JWT Grant authentication.

    This video demonstrates how to obtain an integration key.

    To use Authorization Code Grant, you will need an integration key and a secret key. See Installation steps for details.

    To use JWT Grant, you will need an integration key, an RSA key pair, and the User ID GUID of the impersonated user. See Installation steps for JWT Grant authentication for details.

    For both authentication flows:

    If you use this launcher on your own workstation, the integration key must include a redirect URI of http://localhost:3000/ds/callback

    If you host this launcher on a remote web server, set your redirect URI as

    {base_url}/ds/callback

    where {base_url} is the URL for the web app.

  3. Python 3.

  4. If you are working on a Windows with a Python version after 3.10 you will also need to install Microsoft C++ Build Tools. After installing that run pip install --upgrade setuptools.

Installation steps

Note: If you downloaded this code using Quickstart from the DocuSign Developer Center, skip step 4 as it was automatically performed for you.

  1. Extract the Quickstart ZIP file or download or clone the code-examples-python repository.
  2. In your command-line environment, switch to the folder:
    cd <Quickstart folder> or cd code-examples-python
  3. To install dependencies, run: pip3 install -r requirements.txt (or pipenv can be used)
  4. To configure the launcher for Authorization Code Grant authentication, create a copy of the file app/ds_config_sample.py and save the copy as app/ds_config.py.
    1. Add your integration key. On the Apps and Keys page, under Apps and Integration Keys, choose the app to use, then select Actions > Edit. Under General Info, copy the Integration Key GUID and save it in ds_config.py as your ds_client_id.
    2. Generate a secret key, if you don’t already have one. Under Authentication, select + ADD SECRET KEY. Copy the secret key and save it in ds_config.py as your ds_client_secret.
    3. Add the launcher’s redirect URI. Under Additional settings, select + ADD URI, and set a redirect URI of http://localhost:3000/ds/callback. Select SAVE.
    4. Set a name and email address for the signer. In ds_config.py, save an email address as signer_email and a name as signer_name.
      Note: Protect your personal information. Please make sure that ds_config.py will not be stored in your source code repository.
  5. Run the launcher:python run.py
    Note: You will need to alias the python command to run Python 3 or use python3 run.py
  6. Open a browser to http://localhost:3000

Installation steps for JWT Grant authentication

Note: If you downloaded this code using Quickstart from the DocuSign Developer Center, skip step 4 as it was automatically performed for you.
Also, in order to select JSON Web Token authentication in the launcher, in app/ds_config.py, change the quickstart setting to "false".

  1. Extract the Quickstart ZIP file or download or clone the code-examples-python repository.
  2. In your command-line environment, switch to the folder: cd <Quickstart folder> or cd code-examples-python
  3. To install dependencies, run: pip3 install -r requirements.txt (or pipenv can be used)
  4. To configure the launcher for JWT Grant authentication, create a copy of the file app/ds_config_sample.py and save the copy as app/ds_config.py.
    1. Add your User ID. On the Apps and Keys page, under My Account Information, copy the User ID GUID and save it in ds_config.py as your ds_impersonated_user_id.
    2. Add your integration key. On the Apps and Keys page, under Apps and Integration Keys, choose the app to use, then select Actions > Edit. Under General Info, copy the Integration Key GUID and save it in ds_config.py as your ds_client_id.
    3. Generate an RSA key pair, if you don’t already have one. Under Authentication, select + GENERATE RSA. Copy the private key, and save it in a new file named app/private.key.
    4. Add the launcher’s redirect URI. Under Additional settings, select + ADD URI, and set a redirect URI of http://localhost:3000/ds/callback. Select SAVE.
    5. Set a name and email address for the signer. In ds_config.py, save an email address as signer_email and a name as signer_name.
      Note: Protect your personal information. Please make sure that your ds_config.py and private.key files will not be stored in your source code repository.
  5. Run the launcher:python run.py
    Note: You will need to alias the python command to run Python 3 or use python3 run.py
  6. Open a browser to http://localhost:3000
  7. On the black navigation bar, select Login.
  8. From the picklist, select JSON Web Token > Authenticate with DocuSign.
  9. When prompted, log in to your DocuSign developer account. If this is your first time using the app, select ACCEPT at the consent window.
  10. Select your desired code example.

JWT grant remote signing project

See DocuSign Quickstart overview on the DocuSign Developer Center for more information on how to run the JWT grant remote signing project.

Installation steps for JWT grant remote signing example

Follow the instructions below if you downloaded the JWT grant remote signing example.

  1. Extract the Quickstart ZIP file or download or clone the code-examples-python repository.
  2. Run the JWT console project: python jwt_console.py. If you do not already have the docusign-esign package, it will be installed for you when you start the project. Note: You will need to alias the python command to run Python 3 or use python3 run.py
  3. Follow the prompts from the command line to grant consent in your browser.
  4. Return to the command line and follow the prompts to enter the names and email addresses of your recipients.
  5. Check your email to sign the example document.

Payments code example

To use the payments code example, create a test payment gateway on the Payments page in your developer account. See Configure a payment gateway for details.

Once you've created a payment gateway, save the Gateway Account ID GUID to ds_config.py.

License and additional information

License

This repository uses the MIT License. See LICENSE for details.

Pull Requests

Pull requests are welcomed. Pull requests will only be considered if their content uses the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].