Records Not Showing In Database

Kawya4 years ago

Dear Users,

Please see if you can answer my question. I recently wanted to get some data through the APIs and found out that the data sent through the APIs contained much less data then the report I was able to generate with TRACCAR (this was data from the previous date). Then I went in and queried the database which showed the same amount of data as the API provided me. This was a Route report I tried to generate. My question is, how come TRACCAR Website shows more position data then what is currently in the database.

Anton Tananaev4 years ago

Traccar website uses the same API, so it can't be different. You must be using different parameters in the request.

Kawya4 years ago

I'm positive that Im using the correct parameters,

For the API I'm using (/api/reports/route?) and the parameters I'm using are (sessionId, deviceId, from, to) and this is the result I'm getting, Result

Data from database query,
Data from database

and this is the data I'm getting from the Traccar website,
Data from Traccar website

None of the data in the SS above, are shown through the APIs

Anton Tananaev4 years ago

You haven't provided any screenshot of the parameters you are using. Please provide screenshots for both options.

Kawya4 years ago

Screenshot of the API result,
result Image

php request code,

header('Content-Type: application/json');

include('traccarApi.php');


$a = gps::login("SmartConnect", "Abc@1234");

$traccarCookie = gps::$cookie;


$b = gps::reportRoute($traccarCookie, "72", '2021-11-15T10:00:01Z', '2021-11-15T12:40:59Z');
$response = $b->response;


$decoded =  json_decode($response);

print_r($decoded);

php function,

public static function reportRoute($sessionId,$deviceId,$from,$to){
	
	$data='deviceId='.$deviceId.'&from='.$from.'&to='.$to;
	
	return self::curl('/api/reports/route?'.$data,'GET',$sessionId,'',array());
}

Data through web
data from web

Anton Tananaev4 years ago

And you are in UTC timezone? What does the actual request look like? URLs.

Kawya4 years ago

I think this is what you are asking for right?
http://52.203.222.155:8082/api/reports/route?deviceId=72&from=2021-11-15T10:00:01Z&to=2021-11-15T12:40:59Z

Anton Tananaev4 years ago

That looks like what you send from PHP. What about the browser? Please provide a screenshot.

Kawya4 years ago

Yes it's PHP, I'm using chrome, do you need a screenshot of the browser?

Anton Tananaev4 years ago

I need a screenshot of the API request from the browser. You should be able to find it in the network console (developer tools).

Kawya4 years ago

Directly requesting the URL
1

2

Requesting the URL through CURL PHP
3

4

Also this is an SS of the database
5

This APIs shows exactly what is in the database but the traccar web application show more data than that. Also I know for a fact that the vehicle was running till at least 05:00 pm. Really a mystery!

Anton Tananaev4 years ago

And where's the one I keep asking for - screenshot from Traccar?

Kawya4 years ago

Sorry, screenshot from traccar,
1

Anton Tananaev4 years ago

Is this a joke? I give up.

Kawya4 years ago

I'm sorry but I didn't understand what you are asking for. I'm not a very experienced technical person. Can you please just explain me what you need in order to help me. I'd be so much grateful for your help.