php - qs-01-php-embed-signing-ceremony.php 用户不属于帐号问题
问题描述
我USER_DOES_NOT_BELONG_TO_SPECIFIED_ACCOUNT
在尝试进行身份验证时遇到错误的 DocuSign API 问题。
首先,我在网站中设置了一个 url。url 带有我的 api 密钥和重定向地址。用户单击以访问它。转到account-d.docusign.com
登录页面并登录以授权我。我通过返回的授权码获得了访问令牌,然后调用了embedded_signing_ceremony
返回信封视图的方法。我设置$ accountId
为我自己的 API 帐户 ID 出了点问题。
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();
当用户 account_id 设置为 时$accountId
,我可以返回信封查看 url,但这不是我想要的结果,应该是我创建了信封并显示给用户签名
我想知道怎么设置才能达到我想要的效果
解决方案
使用 JWT 时使用了两个 GUID:
- AccountID - 这是正在使用的整个帐户。
- UserID - 这是将被模拟的用户。
现在,当您尝试调用 API 时,它将使用上面 #2 中的用户。该帐户位于 URL 上,您的环境是 Demo/Sandbox。
确保所有三个都指向同一个地方——URL 指向正确的环境,userId 和 accountID 与您正在使用的特定帐户以及来自正确环境的正确用户匹配。
推荐阅读
- sql - #在 Teradata 中更新和追加。/* 从表 2 更新表 1 中的现有记录。如果表 2 有新记录,则在表 1 中追加新记录 */
- python - Hooking every function call in Python
- c# - c# MVC - 在配置中禁用 asp.net 调试导致 FontAwesome 停止工作
- flutter - 在颤动中获取兄弟小部件的尺寸
- c# - 单元测试时模拟CancellationToken.IsCancellationRequested
- php - 权限被拒绝:复制/写入文件(laravel / php)
- python - Python 机器人电报
- docker - 在 Openshift 上运行 Sonarqube 以错误“ImagePullBackOff”结束
- javascript - Nodemailer 仅在生产中失败
- fortran - Fortran - 零减法导致越来越负面的结果