【问题标题】:Embedded Signing using jwt authentication in docusign在 docusign 中使用 jwt 身份验证进行嵌入式签名
【发布时间】:2019-09-14 03:23:32
【问题描述】:

我正在使用https://github.com/docusign/eg-01-php-jwt 示例通过电子邮件发送信封。但是使用这个例子我找不到任何嵌入式签名的方式。我想通过该示例使用嵌入式签名。

我已经使用发送信封的方法发送带有附件的电子邮件来签署文件

 try {
            print("\nSending an envelope...\n");
            $sendHandler = new SendEnvelope($apiClient);
           // $result = $sendHandler->send();
           /*To use sponsor email address in mail */
            $result = $sendHandler->send($uemail,$uname);

            printf("\nEnvelope status: %s. Envelope ID: %s\n", $result->getStatus(), $result->getEnvelopeId());

            print("\nList envelopes in the account...");
            $listEnvelopesHandler= new ListEnvelopes($apiClient);
            $envelopesList = $listEnvelopesHandler->listEnvelopes();
            $envelopes = $envelopesList->getEnvelopes();

            if(!is_null($envelopesList)  && count($envelopes) > 2) {
                printf("\nResults for %d envelopes were returned. Showing the first two:\n", count($envelopes));
                $envelopesList->setEnvelopes(array($envelopes[0],$envelopes[1]));
            } else {
                printf("\nResults for %d envelopes were returned:\n", count($envelopes));
            }
            # $envelopesList is an object that implements ArrayAccess. Convert to a regular array:
            $results = json_decode((string)$envelopesList, true);
            # pretty print it:
            print (json_encode($results, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
        } catch (Exception $e) {
            print ("\n\nException!\n");
            print ($e->getMessage());

            if ($e instanceof DocuSign\eSign\ApiException) {
                print ("\nAPI error information: \n");
                print ($e->getResponseObject());
            }


        }
        print("\nDone.\n");                             

【问题讨论】:

  • @InbarGazit .....

标签: php docusignapi


【解决方案1】:

您需要设置收件人的 signer_client_id。 查看此 PHP 代码 - https://github.com/docusign/eg-03-php-auth-code-grant/blob/master/src/EG001EmbeddedSigning.php 了解如何执行此操作并将其移动到您的代码中。

相关行是第 44 行:

'signer_client_id' => $this->signer_client_id,

【讨论】:

  • 但我使用的是 eg-01-php-jwt。你能帮我找到使用 eg-01-php-jwt 示例的任何方法来使用嵌入式签名吗?@InbarGazit
  • 我们在 Auth Code Grant 模型中只有此代码,但您可以更改代码以使用 JWT。查看github.com/docusign/eg-03-php-auth-code-grant/blob/master/src/… 以查看执行此操作的代码
  • @GurpreetSinghMatharu 欢迎您。您介意将此标记为已回答吗?
猜你喜欢
  • 2019-10-31
  • 2019-10-30
  • 2013-04-15
  • 2016-04-07
  • 1970-01-01
  • 2016-12-16
  • 1970-01-01
  • 2023-03-27
  • 2021-05-29
相关资源
最近更新 更多