Use Microsoft Word to create a document template. Add template tags to indicate where dynamic content will be inserted. For example:

Figure 1: Example of a document template in Microsoft Word with template tags.
Create a JSON file with the data that will replace the template tags. Ensure the JSON structure matches the template tags. For example:
{
"customer_name": "Rajesh Kumar",
"product": {
"name": "Mystery Novel",
"price": "399.00"
},
"order": {
"number": "789012",
"date": "2024-12-04",
"delivery_date": "2024-12-10"
},
"company": {
"name": "BookVista Publishers",
"address": {
"street": "123 Book Street",
"city": "Mumbai",
"zip": "400001"
}
},
"author": "Anita Desai"
}
To interact with the Adobe Document Generation API, you need to obtain an API key from the Adobe Developer Console. Follow these steps:
client_id and client_secret as you will need these for authentication.
Figure 3: Steps to obtain an API key from the Adobe Developer Console.
Use Adobe’s Identity Management Service (IMS) to generate an access token.
Endpoint: https://ims-na1.adobelogin.com/ims/token
Request:
POSTContent-Type: application/x-www-form-urlencodedclient_id=<YOUR_CLIENT_ID>client_secret=<YOUR_CLIENT_SECRET>grant_type=client_credentialsResponse:
Status: 200 OK
{
"access_token": "<ACCESS_TOKEN>",
"token_type": "bearer",
"expires_in": 86399
}

Figure 4: Generating an access token using Postman.
Get a pre-signed URL for uploading your file to Adobe’s cloud storage.
Endpoint: https://pdf-services.adobe.io/assets
Request:
POSTAuthorization: Bearer <ACCESS_TOKEN>Content-Type: application/jsonBody for DOCX (Raw JSON)
{
"mediaType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
Body for PDF (Raw JSON)
{
"mediaType": "application/pdf"
}
Response:
Status: 200 OK
{
"upload_uri": "<UPLOAD_URI>",
"asset_id": "<ASSET_ID>"
}

Figure 5: Requesting a presigned URI for file upload using Postman.
Use the pre-signed URL to upload your file to Adobe’s cloud storage.
Request:
PUTExample:
PUT <UPLOAD_URI> HTTP/1.1
Host: <UPLOAD_HOST>
<FILE_CONTENT>
Response:
Status: 200 OK
{
"status": "success"
}
Figure 6: Uploading the file to Adobe’s cloud storage using Postman.
Submit a document generation job to Adobe’s API, specifying the desired format (DOCX or PDF) and providing the JSON data for merge.
Endpoint: https://pdf-services.adobe.io/operation/documentgeneration
Request:
POSTAuthorization: Bearer <ACCESS_TOKEN>Content-Type: application/jsonBody (Raw JSON):
{
"assetID": "",
"outputFormat": "docx", // Change to "pdf" if you want a PDF
"jsonDataForMerge": {
"author": "Gary Lee",
"Company": {
"Name": "Projected",
"Address": "19718 Mandrake Way",
"PhoneNumber": "+1-100000098"
}
}
}
Response:
x-request-id: <JOB_ID>
Figure 7: Sending a document generation request using Postman.
Endpoint: https://pdf-services-ue1.adobe.io/operation/documentgeneration//status
Request:
GETAuthorization: Bearer <ACCESS_TOKEN>x-api-key: <YOUR_CLIENT_ID>Response:
Status: 200 OK
{
"status": "done/in progress",
"asset": {
"metadata": {
"type": "application/vnd.openxmlformats-officedocument. wordprocessingml.document",
"size": 580360
},
"downloadUri": "<DOWNLOAD_URI>",
"assetID": "urn:aaid:AS:UE1:08b0c24c-90ad-4ab0-aec3-291bfd421abf"
}
}

Figure 8: Polling the status of document generation using Postman.
Once the document generation is complete, download the output file from Adobe’s cloud storage.
Endpoint: <DOWNLOAD_URI>
Request:
GETResponse:
Example:
GET <DOWNLOAD_URI> HTTP/1.1
Host: <DOWNLOAD_URI>
Response:

Figure 9: Downloading the generated document using Postman.
Notes:
"format": "docx" or "format": "pdf" line in the request payload. The output_uri you receive in Step 8 will point to the generated file in the specified format.This completes the detailed steps for integrating with Adobe Document Services API. 😊📄🚀