Using demo2.traccar.org capabilities

gatorson8 years ago

What are the extent of the capabilities we can use the demo servers for? I am trying to call the api via web request but am receiving "unauthorized" results. Can I call the api from the demo server using a web request via Microsoft Sharepoint? I have tried to call the web request to demo2.traccar.org/api/session with , my login parameters but do not receive anything. Do I need to call the credentials in the GET headers instead? Is this because I am not an admin of the server?

Anton Tananaev8 years ago

All demo servers are standard instances of Traccar, so you should be able to use API.

Even if request fails, you should receive some response. Usually response contains some info about the failure.

gatorson8 years ago

I receive the following when directing my url (without credentials) to http://demo2.traccar.org/
Response status code: 200

Response content:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Traccar</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-neptune/resources/theme-neptune-all.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/ol3/3.12.1/ol.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" href="app.css">
</head>
<body>
<div id="spinner"></div>
<div id="attribution">Powered by <a href="https://www.traccar.org/">Traccar GPS Tracking System</a></div>
<script src="//cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/ext-all.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-neptune/theme-neptune.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/ol3/3.12.1/ol-debug.min.js"></script>
<script src="arrowstyle.js"></script>
<script src="locale.js"></script>
<script type="text/javascript">
Ext.Loader.loadScript('app.min.js');
</script>
</body>
</html>

Response headers:
Connection=close
Content-Length=1128
Content-Type=text/html
Date=Wed, 20 Jan 2016 14:34:31 GMT
Server=Jetty(9.2.14.v20151106)

Response cookies:

This result is just a successful call to the database. How would i structure my Get/Post call to my specific account on the demo server? Do I need to create headers with content-type application/json;odata=verbose

Anton Tananaev8 years ago

If you want to call API, please read following page:

https://www.traccar.org/traccar-api/