Skip to main content
Question

docusign 500 error when trying to Create Envelope


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

@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?


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


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
🔧 First globally to pass DocuSign eSignature Technical Consultant certification
🚀 Expertise in DocuSign integrations with in-house systems for leading enterprises across various industries.

Feel free to reach out for collaboration opportunities.


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


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
🔧 First globally to pass DocuSign eSignature Technical Consultant certification
🚀 Expertise in DocuSign integrations with in-house systems for leading enterprises across various industries.

Feel free to reach out for collaboration opportunities.


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? 


could you provide the code?

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

Feel free to reach out for collaboration opportunities.


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.


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


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.


that's good news, I,also meet this,issue before.

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

Feel free to reach out for collaboration opportunities.


Reply