Action summary
DocuSign -> Send Document for Sign
Function Documentation: Docusign -> Sign Document
Overview
This function facilitates sending documents for signature using the DocuSign API. It requires inputs such as the API key, file, recipient's email and name. The function validates the inputs and processes the request by making an API call to DocuSign, ensuring that the document is delivered to the recipient for electronic signature. Once signed, the function retrieves the signed document and provides status updates on the signing process.
Inputs
docusign_jwt_token (registry/text) Required
- Description: The JWT token used to authenticate requests to the DocuSign API.
- Example:
jwt_token_abc123
file (file resource) Required
- Description: The file resource to be sent for signing.
- Example:
contract.pdf
account_id (text) Required
- Description: The DocuSign account ID associated with the signer.
- Example:
12345
documents_id (text) Required
- Description: The document ID for the file to be signed.
- Example:
doc_67890
email_subject (text) Required
- Description: The subject of the email sent to the signer.
- Example:
Please sign this document.
signer_name (text) Required
- Description: The name of the signer.
- Example:
John Doe
signer_email (email) Required
- Description: The email address of the signer.
- Example:
johndoe@example.com
file_extension (enum) Required
- Description: The file extension of the document being sent.
- Example:
pdf
document_name (text) Required
- Description: The name of the document being sent for signature.
- Example:
Contract_Agreement
Function Stack
1. Try / Catch Block
1. Get File Resource Data From: input: file
- Purpose: Retrieves the file data to be sent to DocuSign.
- Return Value: The file data is stored as
filedata
.
Group: Docusign API Request
- API Request To:
https://app.docusign.com/restapi/v2.1/accounts/{account_id}/envelopes
- Purpose: Sends a request to the DocuSign API to create an envelope for signing.
- Return Value: The API response is stored as
api_response
.
3. Create Variable: response
- Variable:
var: response = var: api_response.response.result
- Purpose: This stores the response from the DocuSign API, such as the envelope ID and status of the request.
2 Error Handling (Catch)
- Create Variable:
response
- Purpose: If the API call fails or returns an error, this block catches the error and provides an error message.
Response
The function returns the result of the DocuSign API request for document signing.
Success Response
{
"envelopeId": "fb4d88f8-a685-4943-a060-5******",
"uri": "/envelopes/fb4d88f8-a685-4943-a060-5a49bc14f538",
"statusDateTime": "2024-10-09T07:26:20.1570000Z",
"status": "sent"
}
Error response
{
"type": "error",
"error": {
"code": "invalid_document",
"message": "The provided document is invalid or missing."
}
}
Example
Input
{
"docusign_jwt_token": "{jwt_token}",
"file": "{file}",
"account_id": "{account_id}",
"documents_id": "{documents_id}",
"email_subject": "{email_subject}",
"signer_name": "{signer_name}",
"signer_email": "{signer_email}",
"file_extension": "{file_extension}",
"document_name": "{document_name}"
}
Output
{
"envelopeId": "fb4d88f8-a685-4943-a060-5a49bc1******",
"uri": "/envelopes/fb4d88f8-a685-4943-a060-5a49bc14f538",
"statusDateTime": "2024-10-09T07:26:20.1570000Z",
"status": "sent"
}
Version notes
2024-10-11 21:57:12
Function Documentation: Docusign -> Sign Document
Overview
This function facilitates sending documents for signature using the DocuSign API. It requires inputs such as the API key, file, recipient's email and name. The function validates the inputs and processes the request by making an API call to DocuSign, ensuring that the document is delivered to the recipient for electronic signature. Once signed, the function retrieves the signed document and provides status updates on the signing process.
Inputs
docusign_jwt_token (registry/text) Required
- Description: The JWT token used to authenticate requests to the DocuSign API.
- Example:
jwt_token_abc123
file (file resource) Required
- Description: The file resource to be sent for signing.
- Example:
contract.pdf
account_id (text) Required
- Description: The DocuSign account ID associated with the signer.
- Example:
12345
documents_id (text) Required
- Description: The document ID for the file to be signed.
- Example:
doc_67890
email_subject (text) Required
- Description: The subject of the email sent to the signer.
- Example:
Please sign this document.
signer_name (text) Required
- Description: The name of the signer.
- Example:
John Doe
signer_email (email) Required
- Description: The email address of the signer.
- Example:
johndoe@example.com
file_extension (enum) Required
- Description: The file extension of the document being sent.
- Example:
pdf
document_name (text) Required
- Description: The name of the document being sent for signature.
- Example:
Contract_Agreement
Function Stack
1. Try / Catch Block
1. Get File Resource Data From: input: file
- Purpose: Retrieves the file data to be sent to DocuSign.
- Return Value: The file data is stored as
filedata
.
Group: Docusign API Request
- API Request To:
https://app.docusign.com/restapi/v2.1/accounts/{account_id}/envelopes
- Purpose: Sends a request to the DocuSign API to create an envelope for signing.
- Return Value: The API response is stored as
api_response
.
3. Create Variable: response
- Variable:
var: response = var: api_response.response.result
- Purpose: This stores the response from the DocuSign API, such as the envelope ID and status of the request.
2 Error Handling (Catch)
- Create Variable:
response
- Purpose: If the API call fails or returns an error, this block catches the error and provides an error message.
Response
The function returns the result of the DocuSign API request for document signing.
Success Response
{
"envelopeId": "fb4d88f8-a685-4943-a060-5******",
"uri": "/envelopes/fb4d88f8-a685-4943-a060-5a49bc14f538",
"statusDateTime": "2024-10-09T07:26:20.1570000Z",
"status": "sent"
}
Error response
{
"type": "error",
"error": {
"code": "invalid_document",
"message": "The provided document is invalid or missing."
}
}
Example
Input
{
"docusign_jwt_token": "{jwt_token}",
"file": "{file}",
"account_id": "{account_id}",
"documents_id": "{documents_id}",
"email_subject": "{email_subject}",
"signer_name": "{signer_name}",
"signer_email": "{signer_email}",
"file_extension": "{file_extension}",
"document_name": "{document_name}"
}
Output
{
"envelopeId": "fb4d88f8-a685-4943-a060-5a49bc1******",
"uri": "/envelopes/fb4d88f8-a685-4943-a060-5a49bc14f538",
"statusDateTime": "2024-10-09T07:26:20.1570000Z",
"status": "sent"
}