Docusignapi 与Salesforce进行DocuSign隐式授权

Docusignapi 与Salesforce进行DocuSign隐式授权,docusignapi,docusignapextoolkit,Docusignapi,Docusignapextoolkit,我正在使用RESTAPI将DocuSign与salesforce集成,以便发送信封。 在发送任何信封之前,我正在进行隐式授权,以便生成代币,但我不确定获取代币的正确方式。 我使用GET方法,但得到的是HTML格式的响应 public class SendDocumentsWithDocuSign { public void test(){ String accountID = 'a6e74d5a-****-****-****-28f3bec67ccf';

我正在使用RESTAPI将DocuSign与salesforce集成,以便发送信封。 在发送任何信封之前,我正在进行隐式授权,以便生成代币,但我不确定获取代币的正确方式。 我使用GET方法,但得到的是HTML格式的响应

public class SendDocumentsWithDocuSign {  
    
    public void test(){
        String accountID = 'a6e74d5a-****-****-****-28f3bec67ccf'; 
        String userName = 'f2326e06-****-****-****-a1aee682da08'; 
        String passWord = 'password@123'; 
        String integrationKey = 'b19b477c-****-****-a8a5-8ff88ea771cc';
        String templateID = '5259faf7-****-****-a493-ba19ce5d633c'; 
        String redirectURL='https://www.salesforce.com';
        
        //Request the implicit grant
        String TOKEN_URL = 'https://account-d.docusign.com/oauth/auth?response_type=token&scope=signature&client_id='+integrationKey+'&redirect_uri='+redirectURL;
        String authenticationHeader = 
            '<DocuSignCredentials>' + 
            '<Username>' + userName+ '</Username>' +
            '<Password>' + password + '</Password>' + 
            '<IntegratorKey>' + integrationKey  + '</IntegratorKey>' + 
            '</DocuSignCredentials>';           
        
        
        HttpRequest httpreq = new HttpRequest();
        HttpResponse httpres = new HttpResponse();
        Http httpCall = new Http();        
        
        httpreq.setEndpoint(TOKEN_URL);
        httpreq.setMethod('GET');
        //httpreq.setHeader('X-DocuSign-Authentication', authenticationHeader);
        httpreq.setHeader('Content-Type', 'application/json');
        httpreq.setHeader('Accept', 'application/json');
        httpres = httpCall.send(httpreq);
        System.debug(httpres.getHeaderKeys());
        System.debug(httpres.getHeader('X-DocuSign-TraceToken'));
        System.debug(httpres.getHeader('Set-Cookie'));
        System.debug(httpres.getBody());
}
}

我想获取访问令牌以调用DocuSign文档中给出的restapi

要使用DocuSign APEX toolkit,您需要遵循toolkit的身份验证方法,因为这是使用APEX toolkit中(所需)集成密钥的唯一方法

请参阅工具箱的

如果您没有使用APEX工具包,那么您需要在SalesForce的能力范围内工作。这是一种方法。另一个

[32]|DEBUG|(X-DocuSign-Node, X-Content-Type-Options, X-DocuSign-TraceToken, Pragma, Date, X-Frame-Options, Strict-Transport-Security, Cache-Control, Content-Security-Policy, Set-Cookie, ...)
[33]|DEBUG|4d4cac98-7cc9-4b3e-a1fe-c12e871b7065
[34]|DEBUG|__RequestVerificationToken=ARFea2sGN3iGpAjBGHGwCJcB0; path=/; secure; HttpOnly
[35]|DEBUG|

 input name="__RequestVerificationToken" type="hidden" value="ARFea2sGN3iGpAjBGHGwCJcAAAAA0"