PTC Arbortext Content Delivery Development > Development > Create BookPrint Using REST End Points
Create BookPrint Using REST End Points
To create bookprint using REST end points, perform the following steps:
Step 1: Create Book
In order to print, we first need to create an empty book.
REST Call
<protocol>:/<server_host_name>:<port>/<web_app_name>/servlet/servicecenter/rest/bulkPrint/create
Headers
The header required to make the REST call is:
Response
The below image shows the response of the call.
The metadata.value attribute is important and you can use in making the next REST call.
Step 2: To name the Book (Optional)
To name the book use the below REST call.
REST Call
<protocol>://<host>:<port>/ACD/servlet/servicecenter/rest/bulkprint/setBulKPrintName?bulkPrintId=com.ptc.micro.users.model.UserXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXbulkPrintName=<new_book_name>
Header
The header required to make the REST call is:
Input Parameter
setBulKPrintName
Response
Below is the image of the response:
Step 3: To Add Item to Existing Book and Add Item with Effectivity
After creating an empty book, in order to add item use the below REST call.
REST Call
<protocol>:/<server_host_name>:<port>/<web_app_name>/servlet/servicecenter/rest/bulkPrint/:itemId/ add?bulkPrintId=com.ptc.micro.users.model.User-5bbba58444d5a008688e100a1680076479226
Headers
The header required to make the REST call is:
To add item with effectivity, use the below REST call.
REST call
<protocol>:/<server_host_name>:<port>/<web_app_name>/servlet/servicecenter/rest/bulkPrint/:itemId/ add?bulkPrintId=com.ptc.micro.users.model.User-5bbba58444d5a008688e100a1678970182375&$filter =&effectivity=ContextId+eq+'Product%3A%3AVj0xfnsicklkIjoiSU5TRVJWSUNFUk9PVCIsIm9wIjpbIklOU0V SVklDRVJPT1QiLCJQT0xBUklTIiwiU05PV0ZBTUlMWSIsIklORFkiLCJJTkVWODAwIl0sIm5uIjo4MywidHMiOjE2NzU zNTU2NDk5NjN9'+and+FRONTu0020_SUSPENSION+eq+'INDY_SUSP'+and+MOUNTAINu0020_BAR+eq+'YES'+and+S ADDLEu0020_BAGS+eq+'NONE_'+and+WINDSHIELD+eq+'TALL+SMOKE'+and+REARu0020_SUSPENSION+eq+'PRO-C C'+and+ENGINE+eq+'800+CLEANFIRE'+and+PASSENGERu0020_SEAT+eq+'NONE'+and+HANDGUARDS+eq+'FALSE '+and+TRACK+eq+'COBRA+1.35'+and+CHASSIS+eq+'PRO-RIDE'https:/localhost:8443/ACD/servlet/servicecenter/rest/bulkPrint/:itemId/ add?bulkPrintId=com.ptc.micro.users.model.User-5bbba58444d5a008688e100a1678970182375&$filter =&effectivity=ContextId+eq+'Product%3A%3AVj0xfnsicklkIjoiSU5TRVJWSUNFUk9PVCIsIm9wIjpbIklOU0V SVklDRVJPT1QiLCJQT0xBUklTIiwiU05PV0ZBTUlMWSIsIklORFkiLCJJTkVWODAwIl0sIm5uIjo4MywidHMiOjE2NzU zNTU2NDk5NjN9'+and+FRONTu0020_SUSPENSION+eq+'INDY_SUSP'+and+MOUNTAINu0020_BAR+eq+'YES'+and+S ADDLEu0020_BAGS+eq+'NONE_'+and+WINDSHIELD+eq+'TALL+SMOKE'+and+REARu0020_SUSPENSION+eq+'PRO-C C'+and+ENGINE+eq+'800+CLEANFIRE'+and+PASSENGERu0020_SEAT+eq+'NONE'+and+HANDGUARDS+eq+'FALSE '+and+TRACK+eq+'COBRA+1.35'+and+CHASSIS+eq+'PRO-RIDE'
Header
The header required to make the REST call is:
Input Parameter
itemId refers to the document like PDF, PartsList, or Media which needs to be printed. We can first run the search REST call with the document name or title to find this ID, if not already known. Below are some example of an itemId:
bulkPrintId refers to the metadata.value attribute from the response of create book REST call.
Response
Below is the image of the response:
Step 4: To Print a Book
To print a book, use the below REST call.
REST Call
<protocol>://<server_host_name>:<port>/<web_app_name>/servlet/servicecenter/rest/bulkPrint/print?bulkPrintId=com.ptc.micro.users.model.User-XXXXXXXXXXXXXXXXXXXXXXXXXXX&pageSize=A4&orientation=Portrait
Input Parameter
bulkPrintId refers to the metadata.value attribute from the response of create book REST call.
Below is the image of the response:
Step 5: To Get Status
To get status, use the below REST call.
REST Call
<protocol>:/<server_host_name>:<port>/<web_app_name>/servlet/servicecenter/rest/bulkPrint/status
Header
The header required to make the REST call is:
Response
Below is the image of the response:
From the response of JSON take the bulkOutputUrl as the attribute and run the URL to download the PDF.
Was this helpful?