This topic is locked

REST web service extra data / JSON body

10/1/2021 6:08:19 AM
PHPRunner General questions
J
Jack72 author

From our customers I would like to send some information through REST API and save the data in a master and detail table.
I managed to use the endpoint with 'api/v1.php?table=mastertable&action=insert' and save the data but I would like to save some extra data in the same run to a detail table.
Using the beforeadd event it is kind of working, however it looks like the $values[] array accepts only the actual fields in the 'mastertable'. Is there a way to send extra data in the POST request?

(i.e. JSON or a custom: $values["<CUSTOMFIELDNAME>"])

Ideally for our case the endpoint should accept a JSON body, which can be used to fill our tables.

Thanx