General Description
Digital Signature (DS) API purpose to facilitate using DocuSign API for signing and delivering PDF documents.
Authentication and authorization
Only authorized users or applications can use this API.
There are two scopes of authorization:
DigitalSignature.Sign
DigitalSignature.Admin
User in first scope can perform all actions, except managing DocuSign users.
You should have Admin scope otherwise.
First you need to get bearer token:
var token = await app.AcquireTokenForClient(new string[] {“ClientId}/.default" }).ExecuteAsync();
Where ClientId is ClientId of application which is trying to access DS API.
Then we need to add this token to HttpClient header:
_client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
After this HttpClient can perform Http request to DS endpoints.
DS API has the following controllers:
Documents: managing and processing documents (certificates and envelops) in DocuSign.
- We can download PDF documents and envelops from DocuSign.
Each document should be wrapped to envelope. Envelope can contain one or several documents.
You need provide EnvelopeId and DocumentId for getting document:/api/v2/Documents/Document/{EnvelopeID}/{DocumentID}
Or you can download envelop with documents inside:
/api/v2/Documents/Envelop{EnvelopeID}
You can also download all signed envelops:
/api/v2/Documents/Envelops
- Convert Html document to PDF
DocuSign sign only PDF documents. But you can send Html, Jpeg or MS Office document to DocuSign and DocuSign will convert it to pdf for you. Unfortunately, resulting PDF is not completely accessible.
But if you want to have more control you can convert Html to PDF yourself. We use for this Telerik document processing library.
You can use the following POST endpoint to convert Html to PDF:/api/v1/Documents/HTMLToPDF/
EVE: generating QR code for links to EVE
/wiki/spaces/MAR/pages/2577891341 is a website designed for the purpose of allowing users to check the validity of digital documents issued by Transport Canada.
Using DS API, you can generate search result links to EVE or generate QR instead links.
To get link:/api/v2/EVE/URL/
To get QR code:
/api/v2/EVE/URL/QRCodeImageForURL/
Signing: signing documents (Html. PDF, JPG and MS Office docs) in DocuSign
There are 3 ways to sign document:Embedded
In this case you provide required information and get back url for signing ceremony.
You need to provide the following information:
- sender and signer names and emails
- name of document
- html content or base64 content (only in version 2)
- signature position (absolute or anchor)Email Request
Template
You can specify signature position two ways:
- absolution position (X, Y) or
- anchor, marking some text as place where signature should be
Users: managing DocuSign users
- Create DocuSign user
- Update user information
- Delete user
These actions require Admin scope
Versioning
There are two version of DS API.
Current version is 2.
How to sign documents
We can sign the following documents: Html, pdf, word, excel, power pint and jpeg. In either way we get signed PDF from DocuSign.
There are 3 ways to sign document:
Embedded
Email Request
Template
Documents
Get current environment
/api/v1/Documents/CurrentEnvironment/
This GET endpoint allows you to download PDF document, proving EnvelopeID and DocumentID:
/api/v1/Documents/Document/{EnvelopeID}/{DocumentID}
Get envelop by id
/api/v1/Documents/Envelop{EnvelopeID}