Trending Topics: Latest from our forums (August 2022)

Here are some of the latest popular questions that the Docusign developers community asked on Stack Overflow in the month of August 2022. You too can ask questions by using the tag docusignapi in Stack Overflow.

Thread: How to get an access token with Authorization Code Grant, Docusign

Summary: The developer is using Python and is attempting to obtain an access token using Authorization Code Grant in order to make an eSignature REST API call to list all the templates in the account. The access token obtained using Python code doesn’t work, whereas the token obtained manually does seem to work.

Answer: It is highly recommended that when implementing Authorization Code Grant in your integration, you use an existing robust third-party library. This will reduce security risks for your application and help you quickly get your code working properly. For Python you can use the requests-oauthlib, or you can download our Quickstart code and then select Python and Auth Code Grant to see a working example.

Thread: Cannot invoke "" because "pemObject" is null

Summary: This developer is Java and attempting to authenticate to Docusign using JWT Grant. They are getting the error from Java when running the code. 

Answer: You can find the developer’s code in the Stack Overflow post. The recommended Java code to use for obtaining an access token using JWT Grant is provided below:

File pemFile = new File(filepath); 
Reader reader = new FileReader(pemFile); 
PemReader reader = new PemReader(reader); 
PemObject pemObject = reader.readPemObject(); 
byte[] bytes = pemObject.getContent();

You can find a full working code example in Java in our GitHub or download a Quickstart that includes JWT and Java.

Thread: How to add image in a documents in Docusign

Summary: The developer is interested in embedding an image inside a document that is sent for signature. They are wondering how to do that.

Answer: Images can be added to an envelope just like any other type of document. You can add documents with many different extension types (bmp, .gif, .jpg, .jpeg, .png, .tif, .tiff) to an envelope

However, if you want to embed an image inside another document, you may want to use a drawing tab. A drawing tab allows the recipient to upload an image to be embedded in the document. However, the content of drawing tabs cannot be updated via the API.

Additional resources

Inbar Gazit
Inbar Gazit
Sr. Manager, Developer Content