POST

PdfSigner.Send

Send / assign a PDF Signer template to a customer. Inserts (or reuses an unsigned) pdf_signer_customer row and returns sign_link. Optionally sends the sign_link to the customer via WhatsApp, Email, or SMS by setting send_via. This mirrors the dashboard Dynamic Content action buttons (WhatsApp icon, email icon, SMS icon). Requires owner or member-admin. Emits realtime pdfsigner.sent.

Permissions

  • User must be logged in with a valid bearer token.
  • Returned or changed records are limited by the user permissions, team access, folder access, and account settings.

Action

  • Runs the PdfSigner.Send function and returns JSON.

Push Service

Pushes event pdfsigner.sent to users who should see this change.

Automation

No automation is run for this function.

Special Instructions

  • sign_link encodes pdf_signer_customer.id (assignment), not the template id.
  • If an unsigned assignment already exists for the same template + customer, it is reused.
  • send_via is optional. If omitted, only the assignment is created (no notification sent).
  • For send_via=whatsapp: pass whatsapp_template_id (from WhatsApp templates list). If omitted, sends a plain message with the link.
  • For send_via=email: pass email_template_id, email_subject, and email_message. The email_message is plain text (base64-encoded internally).
  • For send_via=sms: pass optional sms_message (custom text prepended to the sign link).
  • The notification result is returned in the "notification" field of the response.

Required Parameters

NameTypeSampleExplanation
pdf_signer_id
post
int12Template id from PdfSigner.List. Aliases: id, data_id, update_id, pdf_signer.
customer_id
post
int267Customer (contactus) id. Aliases: cust_id, client_id, contact_id.

Optional Parameters

NameTypeSampleWhat it gives
send_via
post
stringwhatsappNotification channel: "whatsapp", "email", or "sms". Omit to skip sending. Aliases: send_by, notify.
whatsapp_template_id
post
int5WhatsApp template id (whatsapp_templates.id). Required when send_via=whatsapp and you want to use a template. Alias: text_for_write.
email_template_id
post
int3Email template id (email_template.id). Used when send_via=email.
email_subject
post
stringPlease sign your documentEmail subject. Used when send_via=email.
email_message
post
stringPlease click the link to sign.Email body text. Used when send_via=email.
sms_message
post
stringSign your document:Custom SMS message text prepended to sign link. Used when send_via=sms.

Authentication

Send the bearer token returned by Login in the request header.

Authorization: Bearer YOUR TOKEN

Sample Request

{
    "url": "\/app\/PdfSigner.Send",
    "method": "POST",
    "headers": {
        "Authorization": "Bearer YOUR TOKEN"
    },
    "body": {
        "pdf_signer_id": "12",
        "customer_id": "267",
        "send_via": "whatsapp",
        "whatsapp_template_id": "5"
    },
    "url_user": "https:\/\/{user}.bull36.com\/app\/PdfSigner.Send",
    "url_domain": "https:\/\/{domain}\/app\/PdfSigner.Send"
}

Endpoint

POST /app/PdfSigner.Send
POST https://{user}.bull36.com/app/PdfSigner.Send
POST https://{domain}/app/PdfSigner.Send

Sample Output

{
    "success": 1,
    "message": "PDF Signer sent to customer.",
    "pdf_signer_id": 12,
    "pdf_signer_customer_id": 88,
    "customer_id": 267,
    "hashed_id": "10b",
    "sign_link": "https:\/\/user.bull36.com\/dashboard\/user\/document-sign\/ODg%3D",
    "template_sign_link": "https:\/\/user.bull36.com\/dashboard\/user\/document-sign\/MTI%3D\/10b",
    "notification": {
        "channel": "whatsapp",
        "success": true
    },
    "socket_event": "pdfsigner.sent",
    "data": {
        "id": 88,
        "pdf_signer_customer_id": 88,
        "pdf_signer_id": 12,
        "customer_id": 267,
        "customer_name": "Acme Ltd",
        "sign_link": "https:\/\/user.bull36.com\/dashboard\/user\/document-sign\/ODg%3D"
    }
}

JavaScript Example

// Assign + send via WhatsApp
const token = 'YOUR TOKEN';
const body = new URLSearchParams({
  pdf_signer_id: '12',
  customer_id: '267',
  send_via: 'whatsapp',
  whatsapp_template_id: '5'
});
const res = await fetch('/app/PdfSigner.Send', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data.sign_link, data.notification);

Error Example

{
    "success": 0,
    "message": "Missing required parameter: customer_id"
}