qs-01- php -embed-церемония подписания. php пользователь не относится к проблеме аккаунта - PullRequest
0 голосов
/ 10 марта 2020

У меня проблема с API DocuSign, когда я получаю ошибку USER_DOES_NOT_BELONG_TO_SPECIFIED_ACCOUNT при попытке аутентификации.

Сначала я установил URL-адрес на веб-сайте. URL содержит мой ключ API и адрес перенаправления. Пользователь нажимает, чтобы получить к нему доступ. Go на страницу входа account-d.docusign.com и войдите, чтобы авторизовать меня. Я получил токен доступа через возвращенный код авторизации, а затем вызвал метод embedded_signing_ceremony, чтобы вернуть представление конверта. Я установил $ accountId в свой собственный идентификатор учетной записи API. Что-то пошло не так.

Caught exception: Error while requesting server, received a non successful HTTP code [400] with response Body: O: 8: "stdClass": 2: {s: 9: "errorCode"; s: 41: "USER_DOES_NOT_BELONG_TO_SPECIFIED_ACCOUNT"; s: 7: "message"; s: 60: "The specified User is not a member of the specified Account.";} DocuSign API error information: string (166) "O: 8:" stdClass ": 2: {s: 9 : "errorCode"; s: 41: "USER_DOES_NOT_BELONG_TO_SPECIFIED_ACCOUNT"; s: 7: "message"; s: 60: "The specified User is not a member of the specified Account.";} "
function embedded_signing_ceremony($user_name,$user_sub,$user_email,$user_token){
    #
    # The document $fileNamePath will be signed by <signer_name> via an
    # embedded signing ceremony.

    # Settings
    # Fill in these constants
    #
    # Obtain an OAuth access token from https://developers.docusign.com/oauth-token-generator
    $accessToken=$user_token;
   # Obtain your accountId from demo.docusign.com -- the account id is shown in the drop down on the
    # upper right corner of the screen by your picture or the default picture. 
    $accountId ="0fe939e9-73bb-48e3-8887-e32d581ba578";  
  # Recipient Information:
    $signerName = $user_name;
    $signerEmail =$user_email;
    # The document you wish to send. Path is relative to the root directory of this repo.
    $fileNamePath = 'qs-php-master/demo_documents/World_Wide_Corp_lorem.pdf';
    # The url of this web application's folder. If you leave it blank, the script will attempt to figure it out.
    $baseUrl = '';
    $clientUserId =$user_sub; #  Used to indicate that the signer will use an embedded
                        # Signing Ceremony. Represents the signer's userId within
                        # your application.
    $authenticationMethod = 'None'; # How is this application authenticating
                                    # the signer? See the `authenticationMethod' definition
                                    # https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient

    # The API base_path
    $basePath = 'https://demo.docusign.net/restapi';

    # Constants
    $appPath = getcwd();

Когда для user account_id установлено значение $accountId, я могу вернуть URL-адрес представления конверта, но это не так результат, который я хочу, должен состоять в том, что я создал конверт и показал его пользователю для подписи

Я хочу знать, как настроить его для достижения желаемого эффекта

1 Ответ

0 голосов
/ 10 марта 2020

При использовании JWT используются два GUID:

  1. AccountID - это общая используемая учетная запись.
  2. UserID - это пользователь, который будет выдавать себя за другого.

Теперь, когда вы попытаетесь вызвать API, он будет использовать пользователя из # 2 выше. Учетная запись указана в URL-адресе, а env в вашем случае - Demo / Sandbox.

Убедитесь, что все три точки на одном и том же месте - URL-адрес соответствует правильной среде, userId и accountID соответствуют указанной вами c учетной записи. Используете и правильный пользователь из правильной среды.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...