Document Generation

Returns sender fields for an envelope

GET
/v2.1/accounts/{accountId}/envelopes/{envelopeId}/docGenFormFields

Given an envelopeId, this method returns the sender fields found in that envelope's documents. After you retrieve the sender fields, use the DocumentGeneration::updateEnvelopeDocGenFormFields method to populate the fields.

If the specified envelope does not contain a document with sender fields, the method will return success (200) and an empty object ({}) in the response.

Next steps

Authorization

OAuth2
AuthorizationBearer <token>

OAuth 2.0 access token obtained via Authorization Code Grant or JWT Grant.

In: header

Path Parameters

accountId*string

The external account number (int) or account ID GUID.

envelopeId*string

The envelope's GUID.

Example: 93be49ab-xxxx-xxxx-xxxx-f752070d71ec

Response Body

application/json

application/json

curl -X GET "https://example.com/v2.1/accounts/string/envelopes/string/docGenFormFields"
{  "docGenFormFields": [    {      "docGenDocumentStatus": "string",      "docGenErrors": [        {          "errorCode": "string",          "message": "string",          "tagIdentifier": "string"        }      ],      "docGenFormFieldList": [        {          "connectedObjectDetails": {            "recordId": "string"          },          "defaultValue": "string",          "description": "string",          "filter": "string",          "format": {            "expression": "string",            "locale": "string"          },          "fullyQualifiedPath": "string",          "hidden": "string",          "label": "string",          "name": "string",          "options": [            {              "description": "string",              "label": "string",              "selected": "string",              "value": "string"            }          ],          "order": "string",          "predefinedValidation": "string",          "readOnly": "string",          "required": "string",          "rowValues": [            {              "docGenFormFieldList": [                {}              ]            }          ],          "type": "string",          "validation": {            "errorMessage": "string",            "expression": "string"          },          "value": "string"        }      ],      "documentId": "string"    }  ],  "errorDetails": {    "errorCode": "string",    "message": "string"  }}

Submits a batch of historical envelopes for republish to a webhook POST

This endpoint submits a batch of existing envelopes to a webhook of your choice. Set the webhook address with the `urlToPublishTo` request body parameter. This endpoint does not call an existing Connect configuration or create a new Connect listener to monitor new activity. It simply uses an ad hoc configuration to submit existing envelopes. You must include all the configuration data in the request body. The envelope data will always be transmitted in JSON format. XML, Salesforce, and eOriginal configuration types are not supported. Your request should match the following format: ``` { "envelopes": ["4280f274-xxxx-xxxx-xxxx-b218b7eeda08", "8373a938-xxxx-xxxx-xxxx-e992a2abae01"], "config": { "configurationType":"custom", "name": "Test", "urlToPublishTo":"YOUR-WEBHOOK-URL", "allowEnvelopePublish": "true", "enableLog": "true", "requiresAcknowledgement": "true", "IncludeHMAC": "true", "SignMessageWithX509Cert": "true", "deliveryMode": "SIM", "eventData": { "version": "restv2.1", "format": "json", "includedata": ["tabs","payment_tabs","custom_fields","powerform","recipients","folders","extensions","attachments", "prefill_tabs", "documents"] } } } ``` If the request succeeds, it returns a 201 (Created) HTTP response code and the response body property `processingStatus` will be set to `processing`. You can then view the status of each historical republish request in the [Bulk Actions Log](https://support.docusign.com/s/document-item?bundleId=pik1583277475390&topicId=nvf1648497452396.html).

Updates sender fields for an envelope PUT

This method dynamically generates an envelope's documents by populating its sender fields. The envelope must be in a draft state. Use the [DocumentGeneration::getEnvelopeDocGenFormFields](https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/documentgeneration/getenvelopedocgenformfields/) response to retrieve the list of sender fields for your envelope. Use that list to build the request for this method. For each field, specify the field name and the value to populate. For example, your request body might look like this: ```json { "docGenFormFields": [ { "documentId": "bf3202e1-xxxx-xxxx-xxxx-af4f41366879", "docGenFormFieldList": [ { "name": "Candidate_Name", "value": "Peggy Olson" }, { "name": "Job_Title", "value": "Technical Writer" }, { "name": "Manager_Name", "value": "Donald Draper" }, { "name": "Start_Date", "value": "1960-02-28" }, { "name": "Salary", "value": "3380" } ] } ] } ``` ### Important notes * If `update_docgen_formfields_only` is false (the default), the `documentId` changes after the update. * This endpoint does not validate number, date, or select data field values. The request can succeed even if a number or date field value is not a valid number or date, or if a select field value is not one of the allowed values. ### Related topics - [Learn about document generation in the eSignature concepts guide.](https://developers.docusign.com/docs/esign-rest-api/esign101/concepts/documents/document-generation/) - [See this method in use in your preferred coding language](https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-email-document-generation/).