Traccar APi 3.5

209 views
Skip to first unread message

Yunus Tonse

unread,
May 26, 2016, 3:25:23 PM5/26/16
to Traccar Brasil
Dear Friends,

i am a newbie and i am trying to get apis work but no success .


jQuery.post('http://web/api/session', {email: 'admin', password: '1234@'}, function(response) {
        console.log(response);
        //In this response I am getting lat and long equal to zero
});
jQuery.get('http://web/api/positions', function(response) {
        console.log(response);
        //In this response I am getting 401 (Unauthorized)
}, 'json');

Jannier Magalhães

unread,
Jun 17, 2016, 7:18:01 PM6/17/16
to Traccar Brasil
Hello!
You need to enter in the header JIDSESSION the next requests

Exemple CURL:

curl -v -X POST --data "email=admin&password=admin" http://IP:8082/api/session
curl -v --cookie "JSESSIONID=efm6kyijmw01xc3uhvbziua1;Path=/api" http://IP:8082/api/positions
Reply all
Reply to author
Forward
0 new messages