I am working with the headless APIs to build a custom UI with the Documoto data backend.
I have two main concerns.
There are a lot of api calls needed for using this.
In the example below I make a total of 54 API calls just to see get to one documoto page. 42 calls on the first page and 12 calls on the second page. (The second page is also a smaller example of the parts list for a page)
Ideal State:
I don't think the first page could be perfect but even if well could use our logic on the search API then the toc API contained the raw images it would reduce to 2 calls.
The second page if the boms API contained the hot points and raw thumbnail files that would reduce that one to 2 calls.
I have no way to retrieve thumbnails for Chapter in a book (media item).
I am building two custom UI pages that are Fecon branded.
The first one contains a serial number search that uses some custom login to find our "Parts Manual" that has that serial number tagged to it and display pages of the book (and chapters with pages in it).
For this I have created a middleware API that retrieve all needed data from a few Documoto APIs listed below:
I use search API to find the book with the word Parts in it. /api/ext/library/search/v1?q={serial} (Where serial is the search term from the pages text input box)
I use the entityId of that book or media to get the Table of Contents to find pages and chapter to display name and page id. /api/ext/library/media/v1/{entityId}/tocs
I use the id of each page to loop through and get the thumbnail image to show on page/shapter card. /api/ext/library/pages/v1/{pageId}/thumbnails
I have to run this 1 time for each page
After grabbing this data my middleware API return it a one clean json file as attached after passing in a search term. (BookPagesReturn.json)
Clicking on a page takes me to a sub page to view the data contained in the page of the book.
Here my middleware api is called to retrieve images and data for the specific page.
I use the pageId to get the bom part number, qty, description and it's id for that page. /api/ext/library/pages/v1/{pageId}/boms
I loop through each item in the bom to get the part images. /api/ext/library/parts/v1/{partId}/thumbnails
I call the hot points API to get the hot points for that page by it's id. /api/ext/library/pages/v1/{pageId}/hotpoints
I call the illustration to get the image for the page. /api/ext/library/pages/v1/{pageId}/page-illustrations
After grabbing this data my middleware API return it a one clean json file as attached after passing in a pageId. (PageDataReturn.json)