D4Sign icon

D4Sign

Interact with the D4Sign API

Document Upload → Upload Attachment

AI-generated

Summary

Upload an attachment file to an existing document in D4Sign by providing either binary data from an incoming binary property or Base64-encoded content.

Inputs

  • Document UUID (required) — UUID of the target document to which the attachment will be uploaded. Example: 123e4567-e89b-12d3-a456-426614174000.
  • Content Source (required) — Choose how the file content will be provided: either from a binary property of the input item or as Base64 content.
  • Binary Property (required) — Name of the incoming binary property containing the file data if 'Binary Property' is selected as Content Source. Defaults to 'data'.
  • File Name — Optional filename to override the uploaded attachment's name. If left empty, it defaults to the original source filename, "attachment", or "document" depending on context.
  • Base64 Content (required) — Base64-encoded payload of the file content (raw or data URL). Whitespace and new lines are removed, and content is validated if Base64 Content is selected.
  • MIME Type (required) — MIME type of the Base64 content, e.g., application/pdf, image/png, image/jpeg.

Output shape

a single record

Returns the API response JSON confirming the upload status of the attachment. If binary content is uploaded, it is sent with multipart/form-data; otherwise, Base64 content is used in the request body. Errors are thrown if content or document UUID is invalid.

Examples

Example 1: Uploading a PDF attachment from a binary property 'fileData'

Set Document UUID to the target document's UUID, Content Source to 'Binary Property', and Binary Property to 'fileData'. Optionally set File Name to the desired attachment name.

Example 2: Uploading an image attachment from Base64 content

Set Document UUID to the target document's UUID, Content Source to 'Base64 Content', provide the Base64 string in Base64 Content, set MIME Type appropriately (e.g., image/png), and optionally set File Name.

Links

Discussion