Error when going live on Docusign API

拜拜、爱过 提交于 2019-12-24 06:57:29

问题


After developing in the sandbox, we got our api key approved and promoted to a live account.

Since then we've been getting the following response -

response: { "errorCode": "ACCOUNT_LACKS_PERMISSIONS", "message": "This Account lacks sufficient permissions." } http code: 401 exeucted at: 2017-05-17 15:03:59

Based on my research and according to ACCOUNT_LACKS_PERMISSIONS error when creating envelope

A setting needs to be switched on the backend at Docusign. The user mentions -

"They changed a setting called In Session to Enabled in API section near limiter that only the account manager or tier 2 support can change. All is well."

The account ID is 30953035 API username bcbffa28-a316-473e-b2b7-48d964d909a7 The API request is below. This was working just fine under a Demo account. I've even upgraded to the Intermediate API in the hopes that it will resolve my issues but no dice.

Support says that I need to post here...


回答1:


This is caused by a bad account baseUrl that's being used in the request. When your integration performs authentication for a given user, if you are using Legacy auth (X-DocuSign-Authentication header) then you need to point to the following /login_information endpoint for the live system:

https://www.docusign.net/restapi/v2/login_information

When you get the response you then need to parse the baseUrl value that was returned and use that sub-domain for subsequent API requests. (Note that there are multiple sub-domains in the live system such as NA1, NA2, EU, etc)

The baseUrl that's returned will look something like:

https://na2.docusign.net/restapi/v2/accounts/12345/envelopes

Make sure you configure your code to read this sub-domain and use in subsequent requests, otherwise you if you simply use www for instance you will not be hitting the correct account endpoint and you'll receive the "Account lacks permissions" error you're receiving.




回答2:


Ergin's answer seems to work; however, he does not state which part of the baseUrl to keep after parsing. In his example the baseUrl = "https://na2.docusign.net/restapi/v2/accounts/12345/envelopes" In all subsequent calls after authApi.Login(); use "https://na2.docusign.net/restapi" as the URL and that should eliminate the error message.



来源:https://stackoverflow.com/questions/44030126/error-when-going-live-on-docusign-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!