How to consult related tables by positionId (reports

Eduardo Gomez7 years ago

I need to know how to bring data that relate the tables of reports with the position table, normally we consult a url in method get for example the report/stops but only bring the data from that table, having a relationship between the tables of reports and the position table

Anton Tananaev7 years ago

There are no report tables.

Eduardo Gomez7 years ago

sorry is REPORTS

Anton Tananaev7 years ago

There is no such table.

Eduardo Gomez7 years ago

I have this query by method get "reports/events?deviceId= 5" returns an answer like this

[
     {
         "id": 3761288,
         "attributes": {},
         "deviceId": 5,
         "type": "geofenceEnter",
         "serverTime": "2019-01-10T00: 59: 18,000 + 0000",
         "positionId": 8270765, <-------- this is an id of the table position quier a query that brings this relation
         "geofenceId": 6
     }
]
Anton Tananaev7 years ago

What is your question?

Eduardo Gomez7 years ago

It is simply to bring the related data between report and position in a single query

Anton Tananaev7 years ago

Use positions API endpoint.

Eduardo Gomez7 years ago

thank you very much for answering friend I will try any questions I will write here THANK YOU

Eduardo Gomez7 years ago

although seeing the situation well if I make a query to position only brings me the positions but not em brings the events :(

Anton Tananaev7 years ago

Have you included id in the request?

Eduardo Gomez7 years ago

I think I do not understand, I can pass the id of the perfect position but it would be two separate queries when I think they can be done in one instead of two, eg consult reports/events and position then <- no, if not to consult reports and bring me the information of both

Anton Tananaev7 years ago

It's not possible to get all information with a single request.

Eduardo Gomez7 years ago

thank you!