Skip to content

Latest commit

 

History

History
executable file
·
3295 lines (2305 loc) · 82.7 KB

DefaultApi.md

File metadata and controls

executable file
·
3295 lines (2305 loc) · 82.7 KB

Traccar.DefaultApi

All URIs are relative to http://demo.traccar.org/api

Method HTTP request Description
attributesComputedGet GET /attributes/computed Fetch a list of Attributes
attributesComputedIdDelete DELETE /attributes/computed/{id} Delete an Attribute
attributesComputedIdPut PUT /attributes/computed/{id} Update an Attribute
attributesComputedPost POST /attributes/computed Create an Attribute
calendarsGet GET /calendars Fetch a list of Calendars
calendarsIdDelete DELETE /calendars/{id} Delete a Calendar
calendarsIdPut PUT /calendars/{id} Update a Calendar
calendarsPost POST /calendars Create a Calendar
commandsGet GET /commands Fetch a list of Saved Commands
commandsIdDelete DELETE /commands/{id} Delete a Saved Command
commandsIdPut PUT /commands/{id} Update a Saved Command
commandsPost POST /commands Create a Saved Command
commandsSendGet GET /commands/send Fetch a list of Saved Commands supported by Device at the moment
commandsSendPost POST /commands/send Dispatch commands to device
commandsTypesGet GET /commands/types Fetch a list of available Commands for the Device or all possible Commands if Device ommited
devicesGet GET /devices Fetch a list of Devices
devicesIdDelete DELETE /devices/{id} Delete a Device
devicesIdDistancePut PUT /devices/{id}/distance Update the distance counter of the Device
devicesIdPut PUT /devices/{id} Update a Device
devicesPost POST /devices Create a Device
driversGet GET /drivers Fetch a list of Drivers
driversIdDelete DELETE /drivers/{id} Delete a Driver
driversIdPut PUT /drivers/{id} Update a Driver
driversPost POST /drivers Create a Driver
eventsIdGet GET /events/{id}
geofencesGet GET /geofences Fetch a list of Geofences
geofencesIdDelete DELETE /geofences/{id} Delete a Geofence
geofencesIdPut PUT /geofences/{id} Update a Geofence
geofencesPost POST /geofences Create a Geofence
groupsGet GET /groups Fetch a list of Groups
groupsIdDelete DELETE /groups/{id} Delete a Group
groupsIdPut PUT /groups/{id} Update a Group
groupsPost POST /groups Create a Group
maintenancesGet GET /maintenances Fetch a list of Maintenances
maintenancesIdDelete DELETE /maintenances/{id} Delete a Maintenance
maintenancesIdPut PUT /maintenances/{id} Update a Maintenance
maintenancesPost POST /maintenances Create a Maintenance
notificationsGet GET /notifications Fetch a list of Notifications
notificationsIdDelete DELETE /notifications/{id} Delete a Notification
notificationsIdPut PUT /notifications/{id} Update a Notification
notificationsPost POST /notifications Create a Notification
notificationsTestPost POST /notifications/test Send test notification to current user via Email and SMS
notificationsTypesGet GET /notifications/types Fetch a list of available Notification types
permissionsDelete DELETE /permissions Unlink an Object from another Object
permissionsPost POST /permissions Link an Object to another Object
positionsGet GET /positions Fetches a list of Positions
reportsEventsGet GET /reports/events Fetch a list of Events within the time period for the Devices or Groups
reportsRouteGet GET /reports/route Fetch a list of Positions within the time period for the Devices or Groups
reportsStopsGet GET /reports/stops Fetch a list of ReportStops within the time period for the Devices or Groups
reportsSummaryGet GET /reports/summary Fetch a list of ReportSummary within the time period for the Devices or Groups
reportsTripsGet GET /reports/trips Fetch a list of ReportTrips within the time period for the Devices or Groups
serverGet GET /server Fetch Server information
serverPut PUT /server Update Server information
sessionDelete DELETE /session Close the Session
sessionGet GET /session Fetch Session information
sessionPost POST /session Create a new Session
statisticsGet GET /statistics Fetch server Statistics
usersGet GET /users Fetch a list of Users
usersIdDelete DELETE /users/{id} Delete a User
usersIdPut PUT /users/{id} Update a User
usersPost POST /users Create a User

attributesComputedGet

[Attribute] attributesComputedGet(opts)

Fetch a list of Attributes

Without params, it returns a list of Attributes the user has access to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56, // Number | Standard users can use this only with their own _userId_
  'deviceId': 56, // Number | Standard users can use this only with _deviceId_s, they have access to
  'groupId': 56, // Number | Standard users can use this only with _groupId_s, they have access to
  'refresh': true // Boolean | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.attributesComputedGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]
deviceId Number Standard users can use this only with _deviceId_s, they have access to [optional]
groupId Number Standard users can use this only with _groupId_s, they have access to [optional]
refresh Boolean [optional]

Return type

[Attribute]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

attributesComputedIdDelete

attributesComputedIdDelete(id)

Delete an Attribute

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.attributesComputedIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

attributesComputedIdPut

Attribute attributesComputedIdPut(id, body)

Update an Attribute

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Attribute(); // Attribute | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.attributesComputedIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Attribute

Return type

Attribute

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

attributesComputedPost

Attribute attributesComputedPost(body)

Create an Attribute

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Attribute(); // Attribute | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.attributesComputedPost(body, callback);

Parameters

Name Type Description Notes
body Attribute

Return type

Attribute

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

calendarsGet

[Calendar] calendarsGet(opts)

Fetch a list of Calendars

Without params, it returns a list of Calendars the user has access to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56 // Number | Standard users can use this only with their own _userId_
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.calendarsGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]

Return type

[Calendar]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

calendarsIdDelete

calendarsIdDelete(id)

Delete a Calendar

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.calendarsIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

calendarsIdPut

Calendar calendarsIdPut(id, body)

Update a Calendar

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Calendar(); // Calendar | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.calendarsIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Calendar

Return type

Calendar

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

calendarsPost

Calendar calendarsPost(body)

Create a Calendar

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Calendar(); // Calendar | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.calendarsPost(body, callback);

Parameters

Name Type Description Notes
body Calendar

Return type

Calendar

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

commandsGet

[Command] commandsGet(opts)

Fetch a list of Saved Commands

Without params, it returns a list of Drivers the user has access to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56, // Number | Standard users can use this only with their own _userId_
  'deviceId': 56, // Number | Standard users can use this only with _deviceId_s, they have access to
  'groupId': 56, // Number | Standard users can use this only with _groupId_s, they have access to
  'refresh': true // Boolean | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.commandsGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]
deviceId Number Standard users can use this only with _deviceId_s, they have access to [optional]
groupId Number Standard users can use this only with _groupId_s, they have access to [optional]
refresh Boolean [optional]

Return type

[Command]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

commandsIdDelete

commandsIdDelete(id)

Delete a Saved Command

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.commandsIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

commandsIdPut

Command commandsIdPut(id, body)

Update a Saved Command

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Command(); // Command | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.commandsIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Command

Return type

Command

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

commandsPost

Command commandsPost(body)

Create a Saved Command

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Command(); // Command | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.commandsPost(body, callback);

Parameters

Name Type Description Notes
body Command

Return type

Command

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

commandsSendGet

[Command] commandsSendGet(opts)

Fetch a list of Saved Commands supported by Device at the moment

Return a list of saved commands linked to Device and its groups, filtered by current Device protocol support

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'deviceId': 56 // Number | Standard users can use this only with _deviceId_s, they have access to
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.commandsSendGet(opts, callback);

Parameters

Name Type Description Notes
deviceId Number Standard users can use this only with _deviceId_s, they have access to [optional]

Return type

[Command]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

commandsSendPost

Command commandsSendPost(body)

Dispatch commands to device

Dispatch a new command or Saved Command if body.id set

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Command(); // Command | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.commandsSendPost(body, callback);

Parameters

Name Type Description Notes
body Command

Return type

Command

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

commandsTypesGet

[CommandType] commandsTypesGet(opts)

Fetch a list of available Commands for the Device or all possible Commands if Device ommited

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'deviceId': 56, // Number | 
  'textChannel': true // Boolean | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.commandsTypesGet(opts, callback);

Parameters

Name Type Description Notes
deviceId Number [optional]
textChannel Boolean [optional]

Return type

[CommandType]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

devicesGet

[Device] devicesGet(opts)

Fetch a list of Devices

Without any params, returns a list of the user's devices

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56, // Number | Standard users can use this only with their own _userId_
  'id': 56, // Number | To fetch one or more devices. Multiple params can be passed like `id=31&id=42`
  'uniqueId': "uniqueId_example" // String | To fetch one or more devices. Multiple params can be passed like `uniqueId=333331&uniqieId=44442`
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.devicesGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]
id Number To fetch one or more devices. Multiple params can be passed like `id=31&id=42` [optional]
uniqueId String To fetch one or more devices. Multiple params can be passed like `uniqueId=333331&uniqieId=44442` [optional]

Return type

[Device]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

devicesIdDelete

devicesIdDelete(id)

Delete a Device

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.devicesIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

devicesIdDistancePut

devicesIdDistancePut(id, body)

Update the distance counter of the Device

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.DeviceTotalDistance(); // DeviceTotalDistance | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.devicesIdDistancePut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body DeviceTotalDistance

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

devicesIdPut

Device devicesIdPut(id, body)

Update a Device

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Device(); // Device | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.devicesIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Device

Return type

Device

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

devicesPost

Device devicesPost(body)

Create a Device

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Device(); // Device | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.devicesPost(body, callback);

Parameters

Name Type Description Notes
body Device

Return type

Device

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

driversGet

[Driver] driversGet(opts)

Fetch a list of Drivers

Without params, it returns a list of Drivers the user has access to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56, // Number | Standard users can use this only with their own _userId_
  'deviceId': 56, // Number | Standard users can use this only with _deviceId_s, they have access to
  'groupId': 56, // Number | Standard users can use this only with _groupId_s, they have access to
  'refresh': true // Boolean | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.driversGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]
deviceId Number Standard users can use this only with _deviceId_s, they have access to [optional]
groupId Number Standard users can use this only with _groupId_s, they have access to [optional]
refresh Boolean [optional]

Return type

[Driver]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

driversIdDelete

driversIdDelete(id)

Delete a Driver

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.driversIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

driversIdPut

Driver driversIdPut(id, body)

Update a Driver

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Driver(); // Driver | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.driversIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Driver

Return type

Driver

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

driversPost

Driver driversPost(body)

Create a Driver

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Driver(); // Driver | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.driversPost(body, callback);

Parameters

Name Type Description Notes
body Driver

Return type

Driver

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

eventsIdGet

Event eventsIdGet(id)

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.eventsIdGet(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

Event

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

geofencesGet

[Geofence] geofencesGet(opts)

Fetch a list of Geofences

Without params, it returns a list of Geofences the user has access to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56, // Number | Standard users can use this only with their own _userId_
  'deviceId': 56, // Number | Standard users can use this only with _deviceId_s, they have access to
  'groupId': 56, // Number | Standard users can use this only with _groupId_s, they have access to
  'refresh': true // Boolean | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.geofencesGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]
deviceId Number Standard users can use this only with _deviceId_s, they have access to [optional]
groupId Number Standard users can use this only with _groupId_s, they have access to [optional]
refresh Boolean [optional]

Return type

[Geofence]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

geofencesIdDelete

geofencesIdDelete(id)

Delete a Geofence

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.geofencesIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

geofencesIdPut

Geofence geofencesIdPut(id, body)

Update a Geofence

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Geofence(); // Geofence | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.geofencesIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Geofence

Return type

Geofence

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

geofencesPost

Geofence geofencesPost(body)

Create a Geofence

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Geofence(); // Geofence | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.geofencesPost(body, callback);

Parameters

Name Type Description Notes
body Geofence

Return type

Geofence

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

groupsGet

[Group] groupsGet(opts)

Fetch a list of Groups

Without any params, returns a list of the Groups the user belongs to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56 // Number | Standard users can use this only with their own _userId_
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.groupsGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]

Return type

[Group]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

groupsIdDelete

groupsIdDelete(id)

Delete a Group

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.groupsIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

groupsIdPut

Group groupsIdPut(id, body)

Update a Group

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Group(); // Group | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.groupsIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Group

Return type

Group

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

groupsPost

Group groupsPost(body)

Create a Group

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Group(); // Group | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.groupsPost(body, callback);

Parameters

Name Type Description Notes
body Group

Return type

Group

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

maintenancesGet

[Maintenance] maintenancesGet(opts)

Fetch a list of Maintenances

Without params, it returns a list of Maintenances the user has access to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56, // Number | Standard users can use this only with their own _userId_
  'deviceId': 56, // Number | Standard users can use this only with _deviceId_s, they have access to
  'groupId': 56, // Number | Standard users can use this only with _groupId_s, they have access to
  'refresh': true // Boolean | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.maintenancesGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]
deviceId Number Standard users can use this only with _deviceId_s, they have access to [optional]
groupId Number Standard users can use this only with _groupId_s, they have access to [optional]
refresh Boolean [optional]

Return type

[Maintenance]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

maintenancesIdDelete

maintenancesIdDelete(id)

Delete a Maintenance

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.maintenancesIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

maintenancesIdPut

Maintenance maintenancesIdPut(id, body)

Update a Maintenance

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Maintenance(); // Maintenance | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.maintenancesIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Maintenance

Return type

Maintenance

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

maintenancesPost

Maintenance maintenancesPost(body)

Create a Maintenance

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Maintenance(); // Maintenance | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.maintenancesPost(body, callback);

Parameters

Name Type Description Notes
body Maintenance

Return type

Maintenance

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notificationsGet

[Notification] notificationsGet(opts)

Fetch a list of Notifications

Without params, it returns a list of Notifications the user has access to

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'all': true, // Boolean | Can only be used by admins or managers to fetch all entities
  'userId': 56, // Number | Standard users can use this only with their own _userId_
  'deviceId': 56, // Number | Standard users can use this only with _deviceId_s, they have access to
  'groupId': 56, // Number | Standard users can use this only with _groupId_s, they have access to
  'refresh': true // Boolean | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.notificationsGet(opts, callback);

Parameters

Name Type Description Notes
all Boolean Can only be used by admins or managers to fetch all entities [optional]
userId Number Standard users can use this only with their own userId [optional]
deviceId Number Standard users can use this only with _deviceId_s, they have access to [optional]
groupId Number Standard users can use this only with _groupId_s, they have access to [optional]
refresh Boolean [optional]

Return type

[Notification]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notificationsIdDelete

notificationsIdDelete(id)

Delete a Notification

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.notificationsIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notificationsIdPut

Notification notificationsIdPut(id, body)

Update a Notification

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.Notification(); // Notification | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.notificationsIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body Notification

Return type

Notification

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notificationsPost

Notification notificationsPost(body)

Create a Notification

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Notification(); // Notification | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.notificationsPost(body, callback);

Parameters

Name Type Description Notes
body Notification

Return type

Notification

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notificationsTestPost

notificationsTestPost()

Send test notification to current user via Email and SMS

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.notificationsTestPost(callback);

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

notificationsTypesGet

[NotificationType] notificationsTypesGet()

Fetch a list of available Notification types

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.notificationsTypesGet(callback);

Parameters

This endpoint does not need any parameter.

Return type

[NotificationType]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

permissionsDelete

permissionsDelete(body)

Unlink an Object from another Object

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Permission(); // Permission | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.permissionsDelete(body, callback);

Parameters

Name Type Description Notes
body Permission

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

permissionsPost

Permission permissionsPost(body)

Link an Object to another Object

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Permission(); // Permission | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.permissionsPost(body, callback);

Parameters

Name Type Description Notes
body Permission

Return type

Permission

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

positionsGet

[Position] positionsGet(opts)

Fetches a list of Positions

Without any params, it returns a list of last known positions for all the user's Devices. from and to fields are not required with id

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'deviceId': 56, // Number | _deviceId_ is optional, but requires the _from_ and _to_ parameters when used
  'from': new Date("2013-10-20T19:20:30+01:00"), // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
  'to': new Date("2013-10-20T19:20:30+01:00"), // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
  'id': 56 // Number | To fetch one or more positions. Multiple params can be passed like `id=31&id=42`
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.positionsGet(opts, callback);

Parameters

Name Type Description Notes
deviceId Number deviceId is optional, but requires the from and to parameters when used [optional]
from Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z` [optional]
to Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z` [optional]
id Number To fetch one or more positions. Multiple params can be passed like `id=31&id=42` [optional]

Return type

[Position]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json, text/csv, application/gpx+xml
  • Accept: application/json, text/csv, application/gpx+xml

reportsEventsGet

[Event] reportsEventsGet(from, to, opts)

Fetch a list of Events within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var from = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var to = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var opts = { 
  'deviceId': [3.4], // [Number] | 
  'groupId': [3.4], // [Number] | 
  'type': ["type_example"] // [String] | % can be used to return events of all types
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.reportsEventsGet(from, to, opts, callback);

Parameters

Name Type Description Notes
from Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
to Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
deviceId [Number] [optional]
groupId [Number] [optional]
type [String] % can be used to return events of all types [optional]

Return type

[Event]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • Accept: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

reportsRouteGet

[Position] reportsRouteGet(from, to, opts)

Fetch a list of Positions within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var from = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var to = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var opts = { 
  'deviceId': [3.4], // [Number] | 
  'groupId': [3.4] // [Number] | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.reportsRouteGet(from, to, opts, callback);

Parameters

Name Type Description Notes
from Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
to Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
deviceId [Number] [optional]
groupId [Number] [optional]

Return type

[Position]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • Accept: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

reportsStopsGet

[ReportStops] reportsStopsGet(from, to, opts)

Fetch a list of ReportStops within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var from = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var to = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var opts = { 
  'deviceId': [3.4], // [Number] | 
  'groupId': [3.4] // [Number] | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.reportsStopsGet(from, to, opts, callback);

Parameters

Name Type Description Notes
from Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
to Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
deviceId [Number] [optional]
groupId [Number] [optional]

Return type

[ReportStops]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • Accept: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

reportsSummaryGet

[ReportSummary] reportsSummaryGet(from, to, opts)

Fetch a list of ReportSummary within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var from = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var to = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var opts = { 
  'deviceId': [3.4], // [Number] | 
  'groupId': [3.4] // [Number] | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.reportsSummaryGet(from, to, opts, callback);

Parameters

Name Type Description Notes
from Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
to Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
deviceId [Number] [optional]
groupId [Number] [optional]

Return type

[ReportSummary]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • Accept: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

reportsTripsGet

[ReportTrips] reportsTripsGet(from, to, opts)

Fetch a list of ReportTrips within the time period for the Devices or Groups

At least one deviceId or one groupId must be passed

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var from = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var to = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var opts = { 
  'deviceId': [3.4], // [Number] | 
  'groupId': [3.4] // [Number] | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.reportsTripsGet(from, to, opts, callback);

Parameters

Name Type Description Notes
from Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
to Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
deviceId [Number] [optional]
groupId [Number] [optional]

Return type

[ReportTrips]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
  • Accept: application/json, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

serverGet

Server serverGet()

Fetch Server information

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.serverGet(callback);

Parameters

This endpoint does not need any parameter.

Return type

Server

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

serverPut

Server serverPut(body)

Update Server information

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.Server(); // Server | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.serverPut(body, callback);

Parameters

Name Type Description Notes
body Server

Return type

Server

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

sessionDelete

sessionDelete()

Close the Session

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.sessionDelete(callback);

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

sessionGet

User sessionGet(opts)

Fetch Session information

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'token': "token_example" // String | 
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.sessionGet(opts, callback);

Parameters

Name Type Description Notes
token String [optional]

Return type

User

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

sessionPost

User sessionPost(email, password)

Create a new Session

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var email = "email_example"; // String | 

var password = "password_example"; // String | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.sessionPost(email, password, callback);

Parameters

Name Type Description Notes
email String
password String

Return type

User

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

statisticsGet

[Statistics] statisticsGet(from, to)

Fetch server Statistics

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var from = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

var to = new Date("2013-10-20T19:20:30+01:00"); // Date | in IS0 8601 format. eg. `1963-11-22T18:30:00Z`


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.statisticsGet(from, to, callback);

Parameters

Name Type Description Notes
from Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`
to Date in IS0 8601 format. eg. `1963-11-22T18:30:00Z`

Return type

[Statistics]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

usersGet

[User] usersGet(opts)

Fetch a list of Users

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var opts = { 
  'userId': "userId_example" // String | Can only be used by admin or manager users
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.usersGet(opts, callback);

Parameters

Name Type Description Notes
userId String Can only be used by admin or manager users [optional]

Return type

[User]

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

usersIdDelete

usersIdDelete(id)

Delete a User

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
apiInstance.usersIdDelete(id, callback);

Parameters

Name Type Description Notes
id Number

Return type

null (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

usersIdPut

User usersIdPut(id, body)

Update a User

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var id = 56; // Number | 

var body = new Traccar.User(); // User | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.usersIdPut(id, body, callback);

Parameters

Name Type Description Notes
id Number
body User

Return type

User

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

usersPost

User usersPost(body)

Create a User

Example

var Traccar = require('traccar');
var defaultClient = Traccar.ApiClient.instance;

// Configure HTTP basic authorization: basicAuth
var basicAuth = defaultClient.authentications['basicAuth'];
basicAuth.username = 'YOUR USERNAME';
basicAuth.password = 'YOUR PASSWORD';

var apiInstance = new Traccar.DefaultApi();

var body = new Traccar.User(); // User | 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.usersPost(body, callback);

Parameters

Name Type Description Notes
body User

Return type

User

Authorization

basicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json