You need to enable JavaScript to run this app.
DocuSign JSON to SDK tool
Documentation
Input:
JSON
Fluent
Note: Only the
Envelopes:create
and
EnvelopeViews:createRecipient
API calls are supported.
{ "envelopeDefinition": { "emailSubject": "Please sign the attached document", "status": "sent", "documents": [ { "filename": "anchorfields.pdf", "name": "Example document", "fileExtension": "pdf", "documentId": "1" } ], "recipients": { "signers": [ { "email": "signer_email@example.com", "name": "Signer's name", "recipientId": "1", "clientUserId": "1000", "tabs": { "signHereTabs": [ { "anchorString": "/sig1/", "anchorXOffset": "20", "anchorUnits": "pixels" } ] } } ] } }, "envelopesCreateQP": {}, "createRecipientViewReq": { "returnUrl": "https://docusign.com", "authenticationMethod": "none", "clientUserId": "1000", "email": "signer_email@example.com", "userName": "Signer's name" } }
Output:
C#
PHP
Java
Node.JS
Python
Ruby
VB
JSON
Download Framework
Download Code
// DocuSign example. Generated: Fri, 15 Nov 2024 23:06:36 GMT // DocuSign (c) 2024. MIT License -- https://opensource.org/licenses/MIT // @see https://developers.docusign.com -- DocuSign Developer Center using System.Collections.Generic; using System.IO; using System; using DocuSign.eSign.Api; using DocuSign.eSign.Client; using DocuSign.eSign.Model; namespace CSharp_example { class Program { // Use an OAuth flow to obtain an access tokens private const string accessToken = ""; private const string accountId = ""; private const string basePath = "https://demo.docusign.net/restapi"; // Create the envelope request and send it to DocuSign // Returns the resulting envelopeId or "" static string SendDocuSignEnvelope() { SignHere signHereTab1 = new SignHere { AnchorString = "/sig1/", AnchorUnits = "pixels", AnchorXOffset = "20" }; List<SignHere> signHereTabs1 = new List<SignHere> {signHereTab1}; Tabs tabs1 = new Tabs { SignHereTabs = signHereTabs1 }; Signer signer1 = new Signer { ClientUserId = "1000", Email = "signer_email@example.com", Name = "Signer's name", RecipientId = "1", Tabs = tabs1 }; List<Signer> signers1 = new List<Signer> {signer1}; Recipients recipients1 = new Recipients { Signers = signers1 }; Document document1 = new Document { DocumentId = "1", FileExtension = "pdf", DocumentBase64 = ReadContent("anchorfields.pdf"), // filename is anchorfields.pdf Name = "Example document" }; List<Document> documents1 = new List<Document> {document1}; EnvelopeDefinition envelopeDefinition = new EnvelopeDefinition { Documents = documents1, EmailSubject = "Please sign the attached document", Recipients = recipients1, Status = "sent" }; ApiClient apiClient = new ApiClient(basePath); apiClient.Configuration.AddDefaultHeader("Authorization", "Bearer " + accessToken); EnvelopesApi envelopesApi = new EnvelopesApi(apiClient); try { EnvelopeSummary results = envelopesApi.CreateEnvelope(accountId, envelopeDefinition); Console.WriteLine($"Envelope status: {results.Status}. Envelope ID: {results.EnvelopeId}"); return results.EnvelopeId; } catch (ApiException e) { Console.WriteLine("Exception while creating envelope!"); Console.WriteLine($"Code: {e.ErrorCode}\nContent: {e.ErrorContent}"); //Console.WriteLine(e.Message); return ""; } } // Request the URL for the recipient view (Signing Ceremony) static void RecipientView(string envelopeId) { bool doRecipientView = true; RecipientViewRequest recipientViewRequest = new RecipientViewRequest { AuthenticationMethod = "none", ClientUserId = "1000", Email = "signer_email@example.com", ReturnUrl = "https://docusign.com", UserName = "Signer's name" }; if (!doRecipientView || envelopeId == "") { return; // EARLY return } ApiClient apiClient = new ApiClient(basePath); apiClient.Configuration.AddDefaultHeader("Authorization", "Bearer " + accessToken); EnvelopesApi envelopesApi = new EnvelopesApi(apiClient); try { ViewUrl results = envelopesApi.CreateRecipientView(accountId, envelopeId, recipientViewRequest); Console.WriteLine("Create recipient view succeeded."); Console.WriteLine("Open the signing ceremony's long URL within 5 minutes:"); Console.WriteLine(results.Url); } catch (ApiException e) { Console.WriteLine("Exception while requesting recipient view!"); Console.WriteLine($"Code: {e.ErrorCode}\nContent: {e.ErrorContent}"); //Console.WriteLine(e.Message); } } /// <summary> /// This method read bytes content from files in the project's Resources directory /// </summary> /// <param name="fileName">resource path</param> /// <returns>return Base64 encoded content as string</returns> internal static string ReadContent(string fileName) { byte[] buff = null; string path = Path.Combine(Directory.GetCurrentDirectory(), @"..\..\..\Resources", fileName); using (FileStream stream = new FileStream(path, FileMode.Open, FileAccess.Read)) { using (BinaryReader br = new BinaryReader(stream)) { long numBytes = new FileInfo(path).Length; buff = br.ReadBytes((int)numBytes); } } return Convert.ToBase64String(buff); } // The mainline static void Main(string[] args) { Console.WriteLine("Starting..."); string envelopeId = SendDocuSignEnvelope(); RecipientView(envelopeId); Console.WriteLine("Done."); } } }
download framework
download example