我最近建立了一个开发者的DocuSign帐户和集成的密钥,用的DocuSign的REST API玩,有一些问题
我可以用下面的REST调用我的帐户下获取一个用户的完整列表。
https://demo.docusign.net/restapi/v2/accounts/<accountid>/users?additional_info=true
但是,如果我尝试和检索特定用户(一个比我路过我的X-的DocuSign认证等)头,我收到HTTP 400错误有消息认为,“在请求中指定无效的用户ID。用户ID URI不符合认证的用户”
https://demo.docusign.net/restapi/v2/accounts/<accountid>/users/0d51a699-b17a-48b7-95b6-1e9e9806deb6
在这两种情况下我发送下面的头。
X-DocuSign-Authentication: <DocuSignCredentials><Username>{0}</Username><Password>{1}</Password><IntegratorKey>{2}</IntegratorKey></DocuSignCredentials>
我很惊讶,虽然我可以读取所有用户都很好,我不能只是看一个特定的用户。 当然,它似乎并不像这是安全的事情,因为我可以通过一个API读取用户,但使用相同的身份验证令牌不是其他。
我在想什么?
我想我可以去SOBO(代表发送的功能)的途径,但我想,以确认上述行为的预期。
更新#1
:我去了SOBO 办法 ,现在我得到一个不同的错误(USER_NOT_ACCOUNT_ADMIN),如下图所示
GET /restapi/v2/accounts/{accountid}/users/0fe29a55-5564-42a9-b09d-cbe699db13dd HTTP/1.1
Authorization: bearer {token for authenticating user}
X-DocuSign-Act-As-User: {operating user's email}
Accept: application/json
Host: demo.docusign.net
Connection: Keep-Alive
HTTP/1.1 401 Unauthorized
Cache-Control: no-cache
Content-Length: 100
Content-Type: application/json; charset=utf-8
Date: Thu, 17 Oct 2013 21:18:32 GMT
Strict-Transport-Security: max-age=7776000; includeSubDomains
{
"errorCode": "USER_NOT_ACCOUNT_ADMIN",
"message": "User is not an account administrator."
}
我也试着得到一个的OAuth令牌操作用户的第二SOBO方法,但回来HTTP 400错误下面的消息
{
"error": "invalid_request",
"error_description": "An OAuth2 error occurred."
}
因此,虽然我可以得到的autheitcating用户OAuth凭证,我不能够获得代表其操作用户或行为的OAuth令牌。
我已确保认证用户“帐户管理员”和既有“apiAccountWideAccess”和“•allowSendOnBehalfOf”设置为true。 设置为“假”的唯一的事情就是“canSendAPIRequests”。 在沙箱环境中我的帐户ID是 “601565a7-e9c7-463b-9d7c-622aed905ea8” 任何想法?
更新#2
相反,代表这两个认证用户和操作用户生成的OAuth令牌,我试图通过页眉下方,我终于可以得到其他用户的个人资料,并更新其他用户的个人资料。
X-DocuSign-Authentication: <DocuSignCredentials><SendOnBehalfOf>{operating userid}</SendOnBehalfOf><Username>{authenticating userid}</Username><Password>{authenticating user's password}</Password><IntegratorKey>{developer's integrator key}</IntegratorKey></DocuSignCredentials>
大! 因此,这里是一个什么样的工作状态,什么不可行。
没有SOBO头在任何地方工作
GET /restapi/v2/accounts/357938/users?additional_info=true // Read all users
GET /restapi/v2/accounts/357938/users?email=someshchandraatwork@gmail.com&additional_info=true // Read single user by email
POST /restapi/v2/accounts/357938/users // Add users
DELETE /restapi/v2/accounts/357938/users // Close users
* 与SOBO工程在X-的DocuSign-认证头
PUT /restapi/v2/accounts/357938/users/74a021e1-3090-4843-b9ab-cceb7cd119f4/profile // Update user's profile
GET /restapi/v2/accounts/357938/users/74a021e1-3090-4843-b9ab-cceb7cd119f4/profile // Read user's profile
仍然不使用或不SOBO工作**
GET /restapi/v2/accounts/357938/users/74a021e1-3090-4843-b9ab-cceb7cd119f4/settings
GET /restapi/v2/accounts/357938/users/74a021e1-3090-4843-b9ab-cceb7cd119f4
在这两种不工作的情况下我得到以下错误
- 如果没有SOBO我得到错误的用户ID不匹配autheitcating用户。
- 随着SOBO我得到错误不是用户不是一个管理员帐户
我非常感激在解决没有工作的情况下任何帮助。 如需要,我可以提供更多的detaisl。
第二,我想实现这样一个场景,我可以在账户停用用户,使他们无法再登录到的DocuSign。 随后,我想与他们他们是残疾人收到了相同的权限再次启用该用户。
我看到,用户有一个“userStatus”领域,并想知道如果我可以用它来重新激活用户,然后根据需要重新激活。 如果这是支持那么什么值对应停用用户?
我注意到的另一件事是,在删除一个用户,用户只有软删除,因为我仍然可以查询与状态“封闭”的用户。 这将解决我的“停用”的问题。 但是我不知道是否有一种方法可以再次在用户已经被“关闭”激活呢?