Giter Club home page Giter Club logo

traccar-api-php's Introduction

traccar-api-php (Traccar API usage with PHP)

This is a PHP class developed to interface with Traccar's API If you have a Traccar Instance and would like to have Native PHP based access to the API's you can use this project. This project will always remain free.

Traccar Server & API Version : 4.3 Supported (not tested for Traccar v5.0 +)

Transfer of ownership/History:

This project was setup in March of 2018 and operated by user @jaimzj The project is now owned and managed under the github account @zeust We are working towards refactoring the whole code and to add more support and features in the near future.

Note: For all support and queries regarding this code, raise requests here on GitHub itself.

About Traccar

Features Implemented

Server

  • server (server configurations)

Session

  • loginAdmin (login as admin)
  • login (login as any user)
  • logout (logout / destroy a user session)
  • session (check a users session or users account details)

User

  • users (list all user accounts under the currently logged in user)
  • userAdd (add / register a user account)
  • userUpdate (update a user account)
  • userDelete (delete a user account)

Device

  • devices (list all devices under the currently logged in user)
  • deviceAdd (add a device)
  • deviceUpdate (update a device)
  • deviceDelete (delete a device)

Geofence

  • geofences (list all geofences under the currently logged in user)
  • gefeonceAdd (create a geofence)
  • geofenceUpdate (update a geofence)
  • geofenceDelete (delete a geofence)

Notification

  • notificationsTypes (list all notifications types available)
  • notifications (list all users enabled notifications)
  • notificationAdd (create notification for user)
  • notificationUpdate (update notification)
  • notificationDelete (delete notification)

Permission

  • assignUserDevice (assing a device to a user account)
  • removeUserDevice (remove a device from a user account)
  • assignDeviceGeofence (assign a geofence to a device)
  • removeDeviceGeofence (remove a geofence assignment from device)
  • assignDeviceNotification (assign a notification to device)
  • removeDeviceNotification (remove a notification from device)

Position

  • positions (display recent positions of all devices under the logged in user)
  • position (display a single position based in positionId)

Report

  • reportSummary (summary report)
  • reportTrips (trips report)
  • reportStops (stops report)
  • reportRoute (route report)
  • reportEvents (events report)
  • reportChart (same as route report, but can be modified for specifics in future)
  • reportEventsType (specific event type report)

Command

  • commandsTypes (list of all available commands for the device)
  • commandSend (send command to a device)

If you would like to contribute towards the improvement of this proejct, please do contact me or post a request under issues.

Donations

If you are considering donating to this project, I would like to thank you for the support.

Click DONATE HERE to donate.

or scan

traccar-api-php's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

traccar-api-php's Issues

Updates November 2018

There will be a major update to the code that will be released in parts in the coming days.

Feature requests or requests to implement additional functionalities are welcome and will surely be considered. (Please post as a response to this post)

Contributions are welcome as well.

what to send as $cookie parameter for any function

Hello, I found your api very useful for traccar. But I am stuck at some points. As i have seen most of the function has a parameter $cookie. what value should we send as $cookie parameter for addDevice() function?
can u pls give an example for addDevice($cookie, $name, $uniqueId, $phone, $model, $category, $attributes)
Does the cookie mean username or password or token ?

thanks in advance

link/unlink objects

hello,
what is the function that allows us to link/unlink objects { deviceId:8, geofenceId: 16 }
NB:api/permissions not working .

UI

Can you please share the map based tracking UI even if it needs to be reworked?

Admin Access Required upon edit user

hello, I am trying to edit a user via traccar-api-php api but always getting response "Admin Access required". Can u please guide me on how to solve it.

Geofences

I want to ask what are the plans for the geofences, when they will be available, do you have an online demo available to see the operation?

Best regards

Events API

I Need your help!
How can i implement Events on php of traccar and how i test it.
Please give me some of advice.
Thanks

Geo-Fence

can you please update your files by adding the Geo-Fence ,Notifications & Events using php. thx

How to setup a Websocket connection with cookie authentication

Hi,

I am trying to setup a Web socket connection to get live updates after authenticating via the API above (with a session cookie) but I cannot get it to work.

There is example how to create the Web socket connection with token authentication here, however I am not sure how to do it with a cookie created with this API.

Can anyone who has more experience on that advice please?

Fetching devices

Hello i logged in using the function login and parsed in my credentials and returns an array with user information. then i fetched the token from the returned array and parsed it to positions to get all device positions but i am getting a 401 error. May anyone assist on this. If i am not mistaken the "$sessionId" is the "user token"???

api-use example

Hello,

I am trying to get the traccar-api-php to work as an example as i am new to all of this. Have downloaded all files in the folder.

Modified Host in traccarApi.php.

When i call api-use-example, i get

Warning: Undefined variable $data in C:\xampp\htdocs\TraccarApi\traccar-api-php-master (1)\traccar-api-php-master\traccarApi.php on line 17



Warning: Undefined variable $sessionId in C:\xampp\htdocs\TraccarApi\traccar-api-php-master (1)\traccar-api-php-master\traccarApi.php on line 17

400

Can you please help?

code

hello

i can get workign code for learnign and experimental ?

how could i contact to you

hi, I would like to see your works but your webpage is down, I would like a quote for to do a teltonika dashboard from traccar.
thanks.

sessionId in gps::devices method

I logged in using my credentials and I get the standard array in return with name, token and other attributes. Now i want to get the devices using gps::devices($sessionId,$id) . Now what is sessionId in this method? Do i need to pass token in sessionId or something else?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.