无法创建集成商密钥Docusign

时间:2019-01-17 18:03:39

标签: docusignapi

使用Docusign python API时,我不断收到以下错误消息

找不到或禁用了指定的集成商密钥。未指定集成商密钥

Exception when calling DocuSign API: (401)
Reason: Unauthorized
HTTP response headers: HTTPHeaderDict({'Cache-Control': 'no-cache', 'Content-Length': '165', 'Content-Type': 'application/json; charset=utf-8', 'X-DocuSign-TraceToken': '2818f346-79f7-4c81-a1e1-b8da0f5556a6', 'Date': 'Thu, 17 Jan 2019 17:52:40 GMT', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'})
HTTP response body: b'{\r\n  "errorCode": "PARTNER_AUTHENTICATION_FAILED",\r\n  "message": "The specified Integrator Key was not found or is disabled. An Integrator key was not specified."\r\n}'

因此,我尝试创建新的Integrator密钥,但并不真正知道回调URI应该是什么,也不了解我在做什么。

我注意到,每次创建密钥时,如果刷新浏览器,状态都会变为“错误”-任何人都知道如何生成状态为“演示”的集成密钥,并且可以用来进行API调用

enter image description here

以下是我如何设置集成商密钥的示例:

enter image description here


编辑

我创建了一个自己的新沙箱,当我在其中创建API密钥时,它不会转为“错误”,而是保持状态“演示”

API密钥配置如下

enter image description here

和要调用的代码类似于

integrator_key = MY_KEY_FROM_SCREENSHOT
base_url = "https://demo.docusign.net/restapi"
oauth_base_url = 'account-d.docusign.com'
redirect_uri = 'http://localhost:8000'
user_id = MY_EMAIL


#NOTHING HERE REALLY
private_key_filename = os.path.join(BASE_DIR, "keys/docusign_private_key.txt")

oauth_login_url = api_client.get_jwt_uri(integrator_key, redirect_uri, oauth_base_url)
# configure the ApiClient to asynchronously get an access token and store it
#api_client.configure_jwt_authorization_flow(private_key_filename, oauth_base_url, integrator_key, user_id, 3600)
docusign.configuration.api_client = api_client
auth_api = AuthenticationApi()
try:
    login_info = auth_api.login(api_password='true', include_account_id_guid='true')

1 个答案:

答案 0 :(得分:0)

嗯,我不知道为什么集成密钥的状态变为“错误”。

一些想法:

  1. 添加重定向URI时,请在URI的开头包含http://https://。例如,输入http://127.0.0.1:8000/tools/ds_api
  2. 不要单击Review Transactions下拉菜单中的Actions选项。只有在准备好进行在线测试时,才应该这样做。