问题
I can't authorize with docusign-python-api, wondering if anyone could help me figure out why I can't.
So the picture is my API key from the Admin>Api and Keys, as you can see, there is an error. I don't know what that means, where that came from.
I am trying to use the docusign-python-client (with python3)
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:
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
api_client.configure_jwt_authorization_flow(private_key_filename, oauth_base_url, integrator_key, user_id, 3600)
回答1:
Is your application one where the user will be present? If so, please try out the new Python code example launcher. It uses oauth authorization code grant.
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. Please start with it for JWT authentication.
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. See this help topic.
You can also add them programmatically via the API. See the EnvelopeCustomFields API resource.
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. 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. Custom field values can be included in the Envelopes::create API call, or can be added later via the EnvelopeCustomFields API resource.
来源:https://stackoverflow.com/questions/54241334/docusign-python-api-error-partner-authentication-failed