Skip to main content
Active Voice
September 9, 2024
Question

docusign 500 error when trying to Create Envelope

  • September 9, 2024
  • 11 replies
  • 511 views

I am using C# docusign JWT SDK to authenticate. I am able to authenticate and get an access token back where I am able to successfully call GetUserInfo to get account information, but when I create an envelope from the downloaded example, and send that to the CreateEnvelope(account,envelope), it is generating a 500 error message with Stack Trace error…
“at DocuSign.eSign.Api.EnvelopesApi.CreateEnvelopeWithHttpInfo(String accountId, EnvelopeDefinition envelopeDefinition, CreateEnvelopeOptions options)”

My scopes are “signature” and “impersonation”

 

What am i not doing correctly?

 

Thanks

11 replies

JohnSantos
Guru
Guru
September 9, 2024

@cweeks 

Ensure that the EnvelopeDefinition object you are passing to CreateEnvelope is correctly structured. A common reason for a 500 Internal Server Error is malformed or incomplete data.

Can you share the structure of your API call?

Welcome to the DocuSign Community! Your feedback is highly valued. If you find my response helpful, please give it a "Like" and consider marking it as the "Best Answer" to assist others with similar issues.
cweeksActive VoiceAuthor
Active Voice
September 9, 2024

I have attached the example I am using to create the Envelope along with the json of the envelope object I am sending.

Hengfeng Ge
Hero
Hero
September 9, 2024

Have you got the api log for this request? is the base url correct?

FreeLink/甫连信息
🌍 DocuSign Partner | Partner Profile
🏆 2024 APAC Reseller Growth Partner of the Year
🔧 The first in APAC to pass the DocuSign eSignature Technical Consultant certification.
🚀 Expertise in DocuSign integrations with on-premises systems for leading enterprises across various industries.

Feel free to reach out for collaboration opportunities.

Welcome to the DocuSign Community! Your feedback is highly valued. If you find my response helpful, please give it a "Like" and consider marking it as the "Best Answer" to assist others with similar issues.
cweeksActive VoiceAuthor
Active Voice
September 10, 2024

I am not sure the API log logs 500 errors, as I do not see it anywhere. Does the base url change after authentication, and if so what would that be?

 

Thanks

Hengfeng Ge
Hero
Hero
September 10, 2024

You can get API logs as this document told. clear the log and enable it. then reproduce, then download the logs. if the request can’t be find in the api log, I think the url should be not correct. 

https://support.docusign.com/s/document-item?language=en_US&rsc_301&bundleId=jux1643235969954&topicId=poz1578456669909.html&_LANG=enus

 

FreeLink/甫连信息
🌍 DocuSign Partner | Partner Profile
🏆 2024 APAC Reseller Growth Partner of the Year
🔧 The first in APAC to pass the DocuSign eSignature Technical Consultant certification.
🚀 Expertise in DocuSign integrations with on-premises systems for leading enterprises across various industries.

Feel free to reach out for collaboration opportunities.

Welcome to the DocuSign Community! Your feedback is highly valued. If you find my response helpful, please give it a "Like" and consider marking it as the "Best Answer" to assist others with similar issues.
cweeksActive VoiceAuthor
Active Voice
September 10, 2024

Fiddler Classic does not even show a call out when calling the CreateEnvelope, so my guess is the envelope is not valid, but i am using the example docusign provided? Any suggestions? 

Hengfeng Ge
Hero
Hero
September 10, 2024

could you provide the code?

FreeLink/甫连信息
🌍 DocuSign Partner | Partner Profile
🏆 2024 APAC Reseller Growth Partner of the Year
🔧 The first in APAC to pass the DocuSign eSignature Technical Consultant certification.
🚀 Expertise in DocuSign integrations with on-premises systems for leading enterprises across various industries.

Feel free to reach out for collaboration opportunities.

Welcome to the DocuSign Community! Your feedback is highly valued. If you find my response helpful, please give it a "Like" and consider marking it as the "Best Answer" to assist others with similar issues.
September 11, 2024

Hi,

I have downloaded your envelope.json, changed the email for each recipient, and sent it via Postman and it worked correctly.

Here is the response from the API

{
"envelopeId": "61c8897b-xxxx-xxxx-xxxx-788454b53a16",
"uri": "/envelopes/61c8897b-xxxx-xxxx-xxxx-788454b53a16",
"statusDateTime": "2024-09-11T06:26:44.8030000Z",
"status": "sent"
}

If you can provide your C# code as other have suggested, this might help assist.

Docusign Employee
September 11, 2024

I would suggest you utilize Docusign's API Request Log to find the exact error you've got from the Docusign server. More information about how you can capture the log is here: https://support.docusign.com/en/guides/ndse-user-guide-api-request-logging

cweeksActive VoiceAuthor
Active Voice
September 11, 2024

Thanks everyone. It would seem I did not have the correct url.

for authentication i was using account-d.docusign.com but when posting to CreateEnvelope I was not putting the /restapi at the end.