Skip to main content

We have a request to automatically generate a docusign gen template that contains merge fields from an opportunity then automatically send it.

I found this video on YouTube https://youtu.be/cjOFo_j1PS0?si=FG-Sz0Qna9dUbfq5

Which uses the genAndConvertEnvelope endpoint and provides a code example in the link but I’m new to Apex and stuck as to how to use the genAndSendEnvelope end point to go one step further and send the generated document via the api.

Does anyone have any apex code examples they could share or any advice on how to do it please?

I would like to do it with combination of flow and invocable apex where flow passes recordId, docusign templateId (with merge fields), recipient name and email as invocable variables to the apex class then use an at future method to make the callout to generate the document, create envelope, add generated document to envelope, set recipients and then send to recipient.

Has anyone done something similar?

https://developers.docusign.com/docs/docgensend-api/reference/accounts/envelopes/creategenandsendenvelopes/

Hi MJT,

My name is Conar and I'm with DocuSign Developer Support.
Thanks for reaching out, with regards to how to use the CreateGenAndSendEnvelopes endpoint, you can use the explorer tool (URL below) to test how to create the call:

https://developers.docusign.com/docs/docgensend-api/reference/accounts/envelopes/creategenandsendenvelopes/?explorer=true

To get advice on how to build your custom solution you would need to reach out to our Professional Services team.
The Professional Services team is a team that can assist with more in depth construction of projects that fall outside of the break fix nature of support.
This service would come at an added cost.

I'm not sure if that is something you are interested in so I'll just leave the contact information and links to learn more about this team below:

- https://www.docusign.com/sites/default/files/Enterprise%20Professional%20Services%20Overview.pdf
- General Information: https://www.docusign.com/sites/default/files/DocuSign-Professional-Services-Overview.pdf

Please confirm if this case can be closed.

Best regards,
Conar | DocuSign Developer Support


Reply