This page will show Work orders relevant to the user. User should be able to view single work order too.
GET ~/api/JobsView
On our servicedesk, we have 2 main list : Pending and Completed. Because it requires optimization you have 2 specials functions that can be called to retrieve these lists.
Getting Pending Work Orders (return all root work orders with status NOT Completed/Canceled):
GET /api/JobsView/GetPending
GET /api/JobsView/GetCompleted
Grab user selected workorder.id from the list to show that Work Order.
GET ~/api/JobsView(User_selected_id)
Based on the work order shown, use it to filter on root_parent_id
GET ~/api/JobsView?$filter=root_parent_id+eq%Your_Root_Jobs.Id%
This query is done db dDbFileView where you specify that you wants all document linked to your work order (table_name=jobs) and giving the object id with the params id_in_table.
GET ~/api/DbFileView?$filter=db_table_name+eq+'jobs'+and+id_in_table+eq+%Your_Jobs.id%
Be aware the query on DbFileView didn't return you the content of the file. For that, you need to make one distinct call on DbFileView/GetFileThumbnail