Trending Topics: Latest from our forums (May 2023)

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

Thread: DocuSign API embedded signature implementation Symfony

https://stackoverflow.com/questions/76182828/

Summary: The developer is using Symfony with PHP Server code and is having trouble getting an access token to make DocuSign API calls using JWT

Answer: Originally the developer was trying to implement JWT by himself, but since he’s using PHP, it would be a better approach to use the DocuSign eSignature PHP SDK. Then he needed to run this code in order to obtain an access token using JWT (assuming he already has consent):

$api_client->getOAuth()->setOAuthBasePath('account-d.docusign.com');
function generate_jwt_token(ApiClient $apiClient) {
        $relativePath = "/../web/private.key";
        $basePath = $this->container->get('kernel')->getRootDir() . $relativePath;
        $jwt = $apiClient->requestJWTUserToken('Integration_Key', 'USER_ID', 
               file_get_contents($basePath), ['signature', 'impersonation']);
        return $jwt;
    }

Note: if you’re new to DocuSign development and would like to ramp up quickly on how to use JWT with PHP, we recommend using our Quickstart to generate personalized code using your developer account

Thread: DocuSign : Populate Dropdown options using php code in a docusign template before creating envelope

https://stackoverflow.com/questions/76172403/

Summary: The developer wants to use a template and have a drop-down for the signer to choose from. They want to be able to populate the values in the drop-down using PHP code.

Answer:  The name of the class in the DocuSign eSignature PHP SDK is ModelList and it goes in the array of tabs called ListTabs inside the tabs object. If you are using a template and need the values of the drop-down to be different for each envelope, and not set on the template level, you will have to make a call to replace the tabs by using the EnvelopeRecipientTab:update endpoint of the DocuSign eSignature REST API.

Thread: DocuSign automatic reminders for signing the template using PHP and Laravel API

https://stackoverflow.com/questions/76290754/

Summary: The developer wants to have reminders sent to recipients of the envelope that are sent using an integration they will build using PHP.

Answer: You can set custom reminders for envelopes that you sent using PHP code like this:

$envelopeDefinition = new \DocuSign\eSign\Model\EnvelopeDefinition(); 
$notification = new \DocuSign\eSign\Model\Notification(); 
$notification->setUseAccountDefaults('false'); 
# customize the notification for this envelope 
$reminders = new \DocuSign\eSign\Model\Reminders(); 
$reminders->setReminderEnabled('true'); 
$reminders->setReminderDelay('3'); 
# first reminder to be sent three days after envelope was sent 
$reminders->setReminderFrequency('2'); 
# keep sending reminders every two days 
$expirations = new \DocuSign\eSign\Model\Expirations(); 
$expirations->setExpireEnabled('true'); $expirations->setExpireAfter('30'); 
# envelope will expire after 30 days 
$expirations->setExpireWarn('2'); 
# expiration reminder would be sent two days before expiration 
$notification->setExpirations($expirations); 
$notification->setReminders($reminders); 
$envelopeDefinition->setNotification($notification);

Additional resources

Inbar Gazit
Author
Inbar Gazit
Sr. Manager, Developer Content
Published