Odyssee Mobile

API User Guide

What are Db Reports

In Odyssee, you can fill report (form) on different entities, like on a Work Order (entity=jobs).
These reports are based on the Info Fields system.
All these reports are saved on the table db_report and available on the API to let you extract the information you need.
Because it's a bit more complex that en entity with few fields, you will find on this page some explanation about how to extract these information.

Db Report Type

The field db_report.db_report_type_id is the foreign key to the admin table db_report_type that contains the list of all the types of reports.
It is the report type that defines what are the chapters and the fields.

Creating a report on an object (like a Work Order) saves the line on table db_report (user_id,date_start,description).
The information filled on the fields are saved into the table db_info_data, as how it's working for Info Fields.

Db Table Id / Id In Table

Because all the reports (so the form filled) are saved into one single table, we need a way to only retrieve reports created on 1 entity (like "The reports on this JobsId").
To do that, the table uses the common method with 2 fields : db_table_id and id_in_table.
- db_table_id:contains the ID of the table of the linked object (Example for a Work Order Report : 8FBBD742-A3B1-439A-898A-16541AD8E7EF).
- id_in_table:contains the ID of the linked object (For a Work Order Report, it will contains the jobs.id value.

Extract Data

Let's take a real situation as example : The reports created on a Work Order need to be imported on the ERP when the work order is approved.
Let's see the different calls to have the chapters, then the fields and finally the value.

Find the db_report:

We will list the db_report created on my Work Order that was just approved (jobs.id=f5934eb2-0f73-41a2-b726-12601dff35cb).

Request URL :


Result :


Find the chapter:

As we can see, we have 1 report that has been created on ths Work Order. We will now grab the chapter.
Thanks to the db_report_type_id, we can uses the InfoFields (The field db_info_category_id=db_report_type_id).

Request URL :


Result :


Find the fields and the values

We have 2 chapters , Header and Details. All is now about the InfoFields logic.

To list the fields, make a call on controller /api/DbInfoField and filter on the db_info_data.

To list the value of the field, make a call on controller /api/DbInfoData, specify the db_info_field_id previously found AND target_id should be your db_report.id retrieved on the first call when listed the db_report.

That's ALL !