Merge Header API

How to create a merge Header using AYAN PDF apis?

User can retrieve details of an existing customer using two ways:

  1. Login via AYAN PDF: User can navigate to “AYAN PDF” page and can click a button (on top right corner) “Login” to login to an existing account for AYAN PDF. Once the login information is filled up, it will redirect user on to dashboard page of AYAN PDF account.
  2. Using AYAN Retrieve Customer API: User can use the retrieve customer api of AYAN PDF to retrieve the details for any existing customer of AYAN PDF. Once the request is made with all the required information, the api will return the customer details in the callout response.


Parameter Value Description
Endpoint URL The API endpoint url on which request will be sent
Method POST Set the Callout method as POST
Content-Type application/json Set “application/json” as content type for this request
Authorization Bearer <<API Token>> Use the API token of a customer. Customer can find the token in AYAN PDF account or they can re-generate a new token using Generate Token API.
Request Body (JSON)

“no_of_files”: “2”,

All the information in the JSON Body are not mandatory. Each attribute represents as below:

  1. name – represents the customer first name (Optional)
  2. custom_fileName – the name of the final merged file (Optional). The default file name is: “AYANPDF_mergedFile”
  3. email – represents the email on which merged file will be sent once the process to merge files is completed (Required)
  4. cc – represents the email which will be added as CC address, once the process to merge files is completed (Optional) 
  5. merge_id- this is required field and its should be a unique number (Required)
  6. no_of_files- represents the total number of files which will be merged in this merge request. This number should be greater than 1. (Required)
  7. organisation_id – represents a system through which request was made. (Optional) 
Response with Code =1 {
“message”: “ok”,
“data”: {
“merge_id”: “67671”,
“merge_date”: “2023-02-06T21:34:16.519Z”,
“expire_at”: “2023-02-13T21:34:16.519Z”,
“no_of_files”: 2,
“download_link”: “”,
“merge_by”: “Mohit”,
“merge_file_name”: “testMergeFile”,
“merge_folder_name”: “testMergeFile67671”,
“email_sent_to”: “”,
“connect_used”: “”,
“organisation_id”: “test101”,
“merge_status”: “open”,
“email_sent”: “pending”,
“code”: 1
If the response “code” is 1, then it represents your request is successfully submitted and api returns the below the parameters:


Response with code=0 {
“message”: “error”,
“data”: {
“message”: “<<error message>>.”
“code”: 0
  • If “code” is 0 with message=”error”, then it represents your request is failed due to either of below reasons:
    • Number of Files requested to merge should be greater than 1
    • The merge_id is not unique. Kindly check your code and try again
    • “You have consumed your connects limit. Kindly contact your administrator for more details

An API Key is must to use any API on AYAN PDF. If you are facing any issues in retrieve account or finding an api key, you can reach us at

This tool is available on Appexchange and Click on below button to install the
latest version of BOFC

or learn more

Leave a Reply

Your email address will not be published. Required fields are marked *

Think you know Salesforce?
Fill in the details to Get Started

If a user is working in Salesforce when the login hours end, what will happen?

A Salesforce Administrator has 7 million records that need to be loaded into Salesforce and wants to do it in one batch. How can the records be uploaded in one batch?

Which of the following can a Case Queue be used for?

Which of the following statements are true about resetting passwords when users get locked out of a Salesforce org that does NOT have single sign-on enabled through an identity service other than Salesforce?

What is true about dynamic dashboards?

Your score is


This will close in 0 seconds