I have an object below returned from my module via REST API.
- I would like to return the Product object referenced by the foreign key in the same payload so that I do not have to do two REST calls. How do I achieve this in Dolibarr?
- How do I remove all the other properties returned on my object, I have only declared 5 properties and I only want to retrieve these from my REST API. The other properties that I did not declare for example fk_project,contact_id, origin e.t.c, I do not want them to be returned from Dolibarr.
{
"module": "grades",
"label": "A",
"description": "Grade A",
"date_creation": 1651621735,
"tms": 1651621735,
"fk_product": 5,
"import_key": null,
"status": 1,
"grade_order": 2,
"id": 1,
"entity": null,
"validateFieldsErrors": [],
"array_options": [],
"array_languages": null,
"linkedObjectsIds": null,
"fk_project": null,
"contact_id": null,
"user": null,
"origin": null,
"origin_id": null,
"ref": 1,
"ref_ext": null,
"region_id": null,
"demand_reason_id": null,
"transport_mode_id": null,
"model_pdf": null,
"last_main_doc": null,
"fk_bank": null,
"note_public": null,
"note_private": null,
"lines": null,
"date_validation": null,
"date_modification": null,
"specimen": 0
}