# Sending for signing

{% hint style="info" %}
BoloForms BASE\_URL to use <https://sapi.boloforms.com/signature/pdf-template-lambda>
{% endhint %}

1. Get the API key from [Key Generation](/api-guides/key-generation.md)
2. Get the [documentId](/api-guides/send-pdf-template-for-signing/getting-documentid.md)&#x20;
3. Prepare the JSON Body&#x20;

```json
{
  "signingType": "PDF_TEMPLATE", // "PDF_TEMPLATE" or "FORM_TEMPLATE"
  "receiversList": [
    {
     "name": "Chirag Gupta", // name of the role
      "email": "support@boloforms.com", // email of the role
      "message": "Message me when you're done", // you can leave this empty it will take the message from emailData 
      "subject": "Please sign this Chirag", // you can leave this empty it will take the message from emailData 
      "roleTitle": "Senior Doctor", // this has to exactly same as the role you added otherwise it will not work properly
      "roleColour": "#FEE0EF" // give color to your role you can pass any hex code but it's nessacary
    },
     {
      "name": "Chirag Gupta", // name of the role
      "email": "support@boloforms.com", // email of the role
      "message": "Message me when you're done",// you can leave this empty it will take the message from emailData 
      "subject": "Please sign this Paresh",// you can leave this empty it will take the message from emailData 
      "roleTitle": "Junior Doctor",// this has to exactly same as the role you added otherwise it will not work properly
      "roleColour": "#8FB1C8" // give color to your role you can pass any hex code but it's nessacary
    }
  ],
  "mailData": {
   "subject": "subject", 
    // this is the global subject if you will not add anything in the receiversList
    // subject this will be sent
    "message": "message"
    // this is the global message if you will not add anything in the receiversList
    // message this will be sent
  },
  "documentId": "42d3b486-g946-4744-86cb-7ee25f634576",
  "pdfData": "data:application/pdf;base64,JVBERi0xLjQKJSDi48/TCjMKMApvYmoKPDwKL1R5cGUKL0NhdGFsb2cKL05hbWVzCjw8Cj4+Ci9QYWdlTGFiZWxzCjw8Ci9OdW1zClsKMAo8PAovUwovRAov"
}
```

```
"signingType": "PDF_TEMPLATE" or "FORM_TEMPLATE" which you want to send for signing
```

```json
 "receiversList": [
     {
      "name": "Chirag Gupta", // name of the role
      "email": "support@boloforms.com", // email of the role
      "message": "Message me when you're done", // you can leave this empty it will take the message from emailData 
      "subject": "Please sign this Chirag", // you can leave this empty it will take the message from emailData 
      "roleTitle": "Senior Doctor", // this has to exactly same as the role you added otherwise it will not work properly
      "roleColour": "#FEE0EF" // give color to your role you can pass any hex code but it's nessacary
    },
  ],
```

```json
"mailData": {
  "subject": "subject", 
  // this is the global subject if you will not add anything in the receiversList
  // subject this will be sent
  "message": "message"
  // this is the global message if you will not add anything in the receiversList
  //  message this will be sent
}
```

```
"documentId": is the document Id which you got from previous step
```

```
"pdfData": pdf data in base64 format
```

4. Send a POST request with the prepared JSON body

Example Request

{% tabs %}
{% tab title="Node JS" %}

```javascript
const axios = require('axios');
let data = JSON.stringify({
  "signingType": "PDF_TEMPLATE",
  "receiversList": [
    {
      "name": "Chirag Gupta",
      "email": "support@boloforms.com",
      "message": "Message me when you're done",
      "subject": "Please sign this Chirag",
      "roleTitle": "Senior Doctor",
      "roleColour": "#FEE0EF"
    },
    {
      "name": "Chirag Gupta",
      "email": "support@boloforms.com",
      "message": "Message me when you're done",
      "subject": "Please sign this Paresh",
      "roleTitle": "Junior Doctor",
      "roleColour": "#8FB1C8"
    }
  ],
  "mailData": {
    "subject": "subject",
    "message": "message"
  },
  "documentId": "YOUR_PDF_DOCUMENT_ID",
  "pdfData": "data:application/pdf;base64,JVBERi0xLjQKJSDi48/TCjMKMApvYmoKPDwKL1R5cGUKL0NhdGFsb2cKL05hbWVzCjw8Cj4+Ci9QYWdlTGFiZWxzCjw8Ci9OdW1zClsKMAo8PAovUwovRAov"
});

let config = {
  method: 'post',
  maxBodyLength: Infinity,
  url: 'https://sapi.boloforms.com/signature/pdf-template-lambda',
  headers: { 
    'x-api-key': 'YOUR_API_KEY', 
    'Content-Type': 'application/json'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
var myHeaders = new Headers();
myHeaders.append("x-api-key", "YOUR_API_KEY");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
  "signingType": "PDF_TEMPLATE",
  "receiversList": [
    {
      "name": "Chirag Gupta",
      "email": "support@boloforms.com",
      "message": "Message me when you're done",
      "subject": "Please sign this Chirag",
      "roleTitle": "Senior Doctor",
      "roleColour": "#FEE0EF"
    },
    {
      "name": "Chirag Gupta",
      "email": "support@boloforms.com",
      "message": "Message me when you're done",
      "subject": "Please sign this Paresh",
      "roleTitle": "Junior Doctor",
      "roleColour": "#8FB1C8"
    }
  ],
  "mailData": {
    "subject": "subject",
    "message": "message"
  },
  "documentId": "YOUR_PDF_DOCUMENT_ID",
  "pdfData": "data:application/pdf;base64,JVBERi0xLjQKJSDi48/TCjMKMApvYmoKPDwKL1R5cGUKL0NhdGFsb2cKL05hbWVzCjw8Cj4+Ci9QYWdlTGFiZWxzCjw8Ci9OdW1zClsKMAo8PAovUwovRAov"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://sapi.boloforms.com/signature/pdf-template-lambda", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));
```

{% endtab %}

{% tab title="Java" %}

```java
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n    \"signingType\": \"PDF_TEMPLATE\", \n    \"receiversList\": [\r\n        {\r\n            \"name\": \"Chirag Gupta\", \n            \"email\": \"support@boloforms.com\", \n            \"message\": \"Message me when you're done\", \n            \"subject\": \"Please sign this Chirag\", \n            \"roleTitle\": \"Senior Doctor\", \n            \"roleColour\": \"#FEE0EF\" \n        },\r\n        {\r\n            \"name\": \"Chirag Gupta\", \n            \"email\": \"support@boloforms.com\", \n            \"message\": \"Message me when you're done\", \n            \"subject\": \"Please sign this Paresh\", \n            \"roleTitle\": \"Junior Doctor\", \n            \"roleColour\": \"#8FB1C8\" \n        }\r\n    ],\r\n    \"mailData\": {\r\n        \"subject\": \"subject\",\r\n        \n        \n        \"message\": \"message\"\r\n        \n        \n    },\r\n    \"documentId\": \"YOUR_PDF_DOCUMENT_ID\",\r\n    \"pdfData\": \"data:application/pdf;base64,JVBERi0xLjQKJSDi48/TCjMKMApvYmoKPDwKL1R5cGUKL0NhdGFsb2cKL05hbWVzCjw8Cj4+Ci9QYWdlTGFiZWxzCjw8Ci9OdW1zClsKMAo8PAovUwovRAov\"\r\n}");
Request request = new Request.Builder()
  .url("https://sapi.boloforms.com/signature/pdf-template-lambda")
  .method("POST", body)
  .addHeader("x-api-key", "YOUR_API_KEY")
  .addHeader("Content-Type", "application/json")
  .build();
Response response = client.newCall(request).execute();
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
$client = new Client();
$headers = [
  'x-api-key' => 'YOUR_API_KEY',
  'Content-Type' => 'application/json'
];
$body = '{
  "signingType": "PDF_TEMPLATE",
  "receiversList": [
    {
      "name": "Chirag Gupta",
      "email": "support@boloforms.com",
      "message": "Message me when you're done",
      "subject": "Please sign this Chirag",
      "roleTitle": "Senior Doctor",
      "roleColour": "#FEE0EF"
    },
    {
      "name": "Chirag Gupta",
      "email": "support@boloforms.com",
      "message": "Message me when you're done",
      "subject": "Please sign this Paresh",
      "roleTitle": "Junior Doctor",
      "roleColour": "#8FB1C8"
    }
  ],
  "mailData": {
    "subject": "subject",
    "message": "message"
  },
  "documentId": "YOUR_PDF_DOCUMENT_ID",
  "pdfData": "data:application/pdf;base64,JVBERi0xLjQKJSDi48/TCjMKMApvYmoKPDwKL1R5cGUKL0NhdGFsb2cKL05hbWVzCjw8Cj4+Ci9QYWdlTGFiZWxzCjw8Ci9OdW1zClsKMAo8PAovUwovRAov"
}';
$request = new Request('POST', 'https://sapi.boloforms.com/signature/pdf-template-lambda', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();

```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://signature-docs.boloforms.com/api-guides/send-pdf-template-for-signing/sending-for-signing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
