Skip to main content
Newcomer
November 25, 2024
Question

Create an envelopp api does not work

  • November 25, 2024
  • 4 replies
  • 162 views

I need help with the POST request body for creating a DocuSign envelope. I want to create an envelope using a template and prefill custom fields. Here's my current request body:

{
  "templateId": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "templateRoles": [
    {
      "email": "email@gmail.com",
      "name": "Recipient Name",
      "roleName": "Signer 1"
    }
  ],
  "status": "sent",
  "customFields": {
    "textCustomFields": [
      {
        "name": "name",
        "value": "john"
      }
    ]
  }
}

Is this the correct structure for the request body?

4 replies

Hengfeng Ge
Hero
Hero
November 25, 2024

you can use curl or postman to test it whether the envelope is created success as you want.

 

FreeLink/甫连信息

🌍 DocuSign Partner | Partner Profile

🏆 DocuSign 2024 APAC Reseller Growth Partner of the Year

🌟 The only DocuSign Partner globally certified as both a Certified eSignature Administrator and eSignature Technical Consultant.

📊 DocuSign Community Leaderboard Top 5 contributor.

🚀 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.
SteeveNewcomerAuthor
Newcomer
November 25, 2024

I am using Postman, but I get this error message:
{"errorCode":"INVALID_CONTENT_TYPE","message":"Content Type specified is not supported."}

That’s why I am asking if I there is mistake in the body

Hengfeng Ge
Hero
Hero
November 25, 2024

you can reference this screenshot:

 

Hengfeng

FreeLink/甫连信息

🌍 DocuSign Partner | Partner Profile

🏆 DocuSign 2024 APAC Reseller Growth Partner of the Year

🌟 The only DocuSign Partner globally certified as both a Certified eSignature Administrator and eSignature Technical Consultant.

📊 DocuSign Community Leaderboard Top 5 contributor.

🚀 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.
JohnSantos
Guru
Guru
November 25, 2024

@Steeve 

The structure of your request body for creating an envelope using a template appears to be mostly correct. However, the error message {"errorCode":"INVALID_CONTENT_TYPE","message":"Content Type specified is not supported."} indicates an issue with the HTTP headers rather than the JSON body.

For DocuSign API requests, you need to set the Content-Type header properly. The correct value for a JSON request body is:  Content-Type: application/json

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.