简体   繁体   English

docusign-python-api错误:PARTNER_AUTHENTICATION_FAILED

[英]docusign-python-api error: PARTNER_AUTHENTICATION_FAILED

I can't authorize with docusign-python-api, wondering if anyone could help me figure out why I can't. 我无法使用docusign-python-api进行授权,想知道是否有人可以帮助我弄清楚为什么我不能这样做。

So the picture is my API key from the Admin>Api and Keys, as you can see, there is an error. 因此,图片是我的Admin> Api and Keys中的API密钥,如您所见,这是一个错误。 I don't know what that means, where that came from. 我不知道那是什么意思,它是从哪里来的。

在此处输入图片说明

I am trying to use the docusign-python-client (with python3) 我正在尝试使用docusign-python-client(与python3一起使用)

https://github.com/docusign/docusign-python-client https://github.com/docusign/docusign-python-client

after pip installing it I just ran the script under Usage in the readme, and on the line: 在安装pip之后,我只是在自述文件中的“ 用法”下运行了该脚本,然后在线:

login_info = auth_api.login(api_password='true', include_account_id_guid='true')

I get the following error : 我收到以下错误:

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': '8cbbb3f9-2fb1-450e-a03e-ecf180e599b5', 'Date': 'Thu, 17 Jan 2019 17:09:12 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}'

My credentials are: 我的凭证是:

integrator_key = e89c2480-6dd8-4f38-9787-08ee5ecf4407#Integrator key from image
base_url = "https://demo.docusign.net/restapi"
oauth_base_url = "account-d.docusign.com" # use account.docusign.com for Live/Production
redirect_uri = "https://www.docusign.com/api" #didn't change, so doesn't match my callback uri in image
private_key_filename = os.path.join(BASE_DIR, "keys/docusign_private_key.txt") #I commented out the line that uses this
user_id = my.name@mycompany.com #email I use to login to docusign

Once again, i do not use private_key_filename because I commented out the line 再一次,我不使用private_key_filename,因为我注释掉了这一行

api_client.configure_jwt_authorization_flow(private_key_filename, oauth_base_url, integrator_key, user_id, 3600) 

Is your application one where the user will be present? 您的应用程序是用户将要出现的应用程序之一吗? If so, please try out the new Python code example launcher . 如果是这样,请尝试使用新的Python代码示例启动器 It uses oauth authorization code grant. 它使用oauth授权代码授予。

If there won't be a user available to login, then you're creating a Service Integration. 如果没有用户可登录,则说明您正在创建服务集成。 In that case, you need to create a key pair for the Integration Key and provide the private key to your app. 在这种情况下,您需要为集成密钥创建一个密钥对,并将私钥提供给您的应用程序。 An example of this type of app is the eg-01-python-jwt example. 此类应用程序的示例为eg-01-python-jwt示例。 Please start with it for JWT authentication. 请先从中进行JWT身份验证。

Added: Custom Fields for Retrieve 已添加:检索的自定义字段

Envelope Custom Fields optionally store metadata for an envelope. 信封自定义字段可以选择存储信封的元数据 They're commonly used to categorize envelopes and to store data about an envelope in a machine-readable format that won't be seen by the signer(s) or any other recipients. 它们通常用于对信封进行分类,并以机器可读的格式存储有关信封的数据,签名者或任何其他收件人不会看到它们。

Envelope Custom Fields can be added via the DocuSign Web Tool. 可以通过DocuSign Web工具添加信封自定义字段。 See this help topic. 请参阅此帮助主题。

You can also add them programmatically via the API. 您还可以通过API以编程方式添加它们。 See the EnvelopeCustomFields API resource. 请参阅EnvelopeCustomFields API资源。

Use cases 用例

Typically, if envelopes will be sent from the DocuSign web tool, then the sender can also use the web tool to set the envelope's custom fields. 通常,如果将从DocuSign Web工具发送信封,那么发件人也可以使用Web工具设置信封的自定义字段。 Custom Fields can be created/configured as required and as drop-down select fields to help with data integrity issues. 可以根据需要以及作为下拉选择字段来创建/配置“自定义字段”,以帮助解决数据完整性问题。

If an API integration application is creating the envelopes on behalf of the sender, then the application should usually also set the custom fields when the envelope is created. 如果API集成应用程序代表发送者创建信封,则在创建信封时,该应用程序通常还应设置自定义字段。 Custom field values can be included in the Envelopes::create API call, or can be added later via the EnvelopeCustomFields API resource. 自定义字段值可以包含在Envelopes :: create API调用中,也可以稍后通过EnvelopeCustomFields API资源添加。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM