1

I'm integrating salesforce with docusign API by using REST API. I've to crate the Envelope to send the template, and Template should be sent to Signing group. How can i send Template to signing group

I've tryied below code but it showing the error

"errorCode": "ACCOUNT_LACKS_PERMISSIONS", "message": "This Account lacks sufficient permissions. SigningGroups Disabled"

public class DocuSign {  

public void test(String email, String name){
String accountID = 'ec57264a-5e70-****-8ee1-ed2578cd3bdf'; 
String userName = 'f14763b1-***-**-8e89-ef7297adb9c0'; 
String passWord = '22223'; 
String integratorKey = 'EDRE-****-0f94-4e13-8b24-c7ebacb3464a'; 
String templateID = '6d3eb7ad-77ee-eeee-a22b-efb4f578fc0b'; 
String endPoint = 'https://demo.docusign.net/restapi/v2/accounts/'+accountID+'/envelopes'; 
//Apex HTTP Method Initialization. 

HttpRequest req = new HttpRequest(); 
req.setEndpoint(endPoint); 
req.setMethod('POST'); 

String authorizationHeader = '<DocuSignCredentials><Username>'+userName+'</Username><Password>'+Password+'</Password><IntegratorKey>'+integratorKey+'</IntegratorKey></DocuSignCredentials>'; 
req.setHeader('X-DocuSign-Authentication', authorizationHeader); 
req.setHeader('Accept','application/json'); 
req.setHeader('Content-Length','162100'); 
req.setHeader('Content-Type','application/json'); 
req.setHeader('Content-Disposition','form-data'); 


string json = '{'+
'"emailSubject":"DocuSign Templates Envelope Demo",'+
' "emailBlurb": "demo is sending you this request for your electronic signature.\n\nPlease review and electronically sign by following the link below. ",'+ 
'"status": "sent",'  + 
'"compositeTemplates": ['+    
'{'+
'"serverTemplates": ['+
'{'+
'"sequence": "1",'+
' "templateId": "'+templateID+'",'+ 
'}'+
'],'+
'"inlineTemplates": ['+
'{'+
'"sequence": "1",'+
'"recipients": {'+
'"signers": ['+
'{'+
' "signingGroupId": "3839076",'+
  '"name": "First Recipient",'+
'"recipientId": "1",'+      
'"roleName": "RoleOne"'+
'}'+
']'+
'}'+
'}'+
']'+
'},'+
'{'+
'"serverTemplates": ['+
'{'+
'"sequence": "1",'+
'"templateId": "'+templateID+'",'+ 
'}'+
'],'+
'"inlineTemplates": ['+
'{'+
'"sequence": "1",'+
'"recipients": {'+
'"signers": ['+
'{'+
'"signingGroupId": "3839076",'+
'"name": "First Recipient",'+
'"recipientId": "1",'+
'"roleName": "RoleOne"'+
'}'+
']'+
'}'+
'}'+
']'+
'}'+
']'+
'}';

 req.setBody(json); 
  Http http = new Http(); 
  HTTPResponse res; 
  try{ 
  //Docusign Request Callout. 
  res = http.send(req); 
  system.debug('DocuSign Response'+ res.getBody());      
  } 
  catch(Exception e){ 
  SYSTEM.DEBUG('!!!!');
    } 
 }
}
3
  • On its face the error indicates that SigningGroups aren't enabled in your Docusign account. If you haven't already, contact your Docusign account manager and ask them to enable it for you. More details here: support.docusign.com/en/guides/ndse-user-guide-signing-groups
    – Ginour
    Oct 14 '17 at 5:42
  • @Ginour Thanks your great hint. I was stuck here. I've contacted to support and they activated the signing group. My problem is solved.
    – Amol
    Oct 16 '17 at 12:48
  • Excellent @Amol, I'm going to move the comment to an answer.
    – Ginour
    Oct 17 '17 at 17:30
0

On its face the error indicates that SigningGroups aren't enabled in your Docusign account. If you haven't already, contact your Docusign account manager and ask them to enable it for you. More details here: support.docusign.com/en/guides/ndse-user-guide-signing-group‌​s

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.