API methods for working with GLONASSSoft

Last modified by Андрей Калиновский on 2023/04/24 16:42

Page content:

Current restrictions

− There must be a pause of 1 second between requests (exceeding is rejected by the system with a notification that the request rate is exceeded).

To work with all API methods, you need to add to the headerX-Auth(authorization token obtained by the methodauth/login).

Example: X-Auth: 34f4919a-099b-4b7d-8aa1-f478ec2062de.

−  When editing, it is necessary to transfer all user parameters in the request body! Those parameters, the values ​​of which will not be transferred, will be erased!

Section: Authorization

Authorization

POST /api/v3/auth/login

The method allows you to get an authorization token, which must be added to the header to work with all API methods. The username and password are passed in the method parameters.

Request method: POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/auth/login

In case of successful execution of the method, the field "AuthId" contains the authorization token "X-Auth".

Parameters in the request body (JSON):

{
    "login": "testuser",
    "password": "testuser"
}

Answer:

{

    "AuthId": " 93c6jg79-b88b-4a35-a2d0-70dg9jc2898b " , // authorization token          
    "User": "testuser" , // username

}

Note:  The lifetime of the authorization token is set in the user settings, there is a session duration parameter. With each request, the token is rolled over.

Authorization check

GET /api/v3/auth/check

The method allows you to check the authorization status. The method allows you to check if the authorization token is active or not.

Request method: GET

Request URL:  https://hosting.glonasssoft.ru/api/v3/auth/check

In Request Headers: X-Auth: Authorization Token

Answer: If the session is active HTTP response is "200". If the session is terminated HTTP response "401".

Section: Clients

Getting information about a client

GET api/v3/agents/{id}

The method allows you to get the parameters of the selected client : name, full name, type, status and identifier of the parent client, etc. The method returns information about clients based on the settings of the authorized user specified in the request:

− information about the client is provided if you have the “View clients” right;

Request method: GET

Request URL:  https://hosting.glonasssoft.ru/api/v3/agents/{id}

The request must contain the " agentId " parameter data

Answer:
A
{
    "agentId": "", // client ID    

    "parentId": "",  // parent client ID
    "parentName": "string", //  parent client
name     "name": "string",  // name of the client  
    "fullName": "string",  // full name of the client
    "agentInfoType": 0,  // client type (0 - Client, 1 - Partner, 2 - Group, 3 - Administrative group, 4 - Test client, 5 - Agreement)
    "isForeign": true/false, // Foreign counterparty
    "district": "string", // district
    "region": "string", // region
    "city": "string", // city
    "inn": "string", // client's TIN
    "kpp": "string", // client KPP
    "address": "string", // legal address
    "addressFact": "string", // actual address
    "email": "string", // mail
    "director" : "string", // Head's full name
    "bankName": "string", // Bank
    "bankBIK": "string", // BIC
    "bankRS": "string", // Account number
    "bankKS": "string" // Corr. account
  }

Retrieving child client settings

POST  / api/v3/agents/find

The method allows you to get the parameters of all child clients: name, full name, type, status and identifier of the parent client, etc. The method returns information about clients based on the settings of the authorized user specified in the request:

− information about clients is provided if you have the “View clients” right;

− returns information about the client to which the authorized user belongs and its child clients;

− information about a "Partner" type client and its sub-clients is returned if the "Access to partner clients".

Request method: POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/agents/find

Request parameter:

{
  "parentId": "string"
}

Answer:

{
    "agentId": "",  // client ID    
    "parentId": "",  // parent client ID
    "parentName": "string", //  parent client
name     "name": "string",  // name client  
    "fullName": "string",  // full name of the client
    "agentInfoType": 0,  // client type (0 - Client, 1 - Partner, 2 - Group, 3 - Administrative group, 4 - Test client, 5 - Contract )
    "status": "",// client status (0- New, 1 - Potential, 2 - In development, 3 - Testing, 4 - In progress, 5 - Implementation, 6 - Working, 7 - Working, 8 - Lost ,9 - Refusal)
}

Adding a client

POST /api/v3/agents 

The method allows you to add the client specified in the request.

Request method: POST

Request URL: https://hosting.glonasssoft.ru/api/v3/agents

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON):

{
   "parentId": "00000000-0000-0000-0000-000000000000", // parent client ID 
  "name": "string", // name
  "fullName": "string", // full name
  "agentInfoType": 0,  // client type (0- Client, 1 - Partner, 2 - Group, 3 - Administrative group, 4 - Test client, 5 - Contract) "isForeign
  ": true, // foreign counterparty
  "district": "string" , // county
  "region": "string", // region
  "city": "string", // city
  "inn": "string", // TIN
  "kpp": "string", // checkpoint
  "address ": "string",// legal address
  "addressFact": "string", // actual address
  "email": "string", // email
  "director": "string", // full name of the head
  "bankName": "string", // bank
  "bankBIK": "string", // BIC
  "bankRS": "string", // account number
  "bankKS": "string" // corr. account
}

Answer:

{
  "agentId": "00000000-0000-0000-0000-000000000000", // client ID
  "parentId": "00000000-0000-0000-0000-000000000000", // parent client ID 
  "name": "string" , // name
  "fullName": "string", // full name
  "agentInfoType": 0,  // client type (0 - Client, 1 - Partner, 2 - Group, 3 - Administrative group, 4 - Test client, 5 - Agreement)
  "isForeign": true, // foreign counterparty
  "district": "string", // county
  "region": "string", // region
  "city": "string", // city
  "inn": "string",// TIN
  "kpp": "string", // KPP
  "address": "string", // legal address
  "addressFact": "string", // actual address
  "email": "string", // email
  "director": "string", // full name of the head
  "bankName": "string", // bank
  "bankBIK": "string", // BIC
  "bankRS": " string", // account number
  "bankKS": "string" // corr. account
}

Editing a Client

PUT /api/v3/agents

The method allows editing the client specified in the request.

Request method: PUT

Request URL: https://hosting.glonasssoft.ru/api/v3/agents

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON):

{
  "agentId": "00000000-0000-0000-0000-000000000000", // client ID
  "parentId": "00000000-0000-0000-0000-000000000000", // parent client ID 
  "name": "string" , // name
  "fullName": "string", // full name
  "agentInfoType": 0,  // client type (0 - Client, 1 - Partner, 2 - Group, 3 - Administrative group, 4 - Test client, 5 - Agreement)
  "isForeign": true, // foreign counterparty
  "district": "string", // county
  "region": "string", // region
  "city": "string", // city
  "inn": "string",// TIN
  "kpp": "string", // KPP
  "address": "string", // legal address
  "addressFact": "string", // actual address
  "email": "string", // email
  "director": "string", // full name of the head
  "bankName": "string", // bank
  "bankBIK": "string", // BIC
  "bankRS": " string", // account number
  "bankKS": "string" // corr. account
}

Answer:

{
  "agentId": "00000000-0000-0000-0000-000000000000", // client ID
  "parentId": "00000000-0000-0000-0000-000000000000", // parent client ID 
  "name": "string" , // name
  "fullName": "string", // full name
  "isForeign": true, // foreign counterparty
  "district": "string", // district
  "region": "string", // region
  "city ": "string", // city
  "inn": "string", // TIN
  "kpp": "string", // checkpoint
  "address": "string", // legal address
  "addressFact": "string", // actual address
  "email": "string", // email
  "director": "string", // full name of the head
  "bankName": "string", // bank
  "bankBIK": "string", // BIC
  "bankRS": "string", // account number
  "bankKS": "string" // corr. account
}

Deleting a client

DELETE /api/v3/agents/{clientId}

The method allows you to remove the client specified in the query string.

Request method: DELETE

Request URL: https://hosting.glonasssoft.ru/api/v3/agents/{clientId }

Request parameter: {clientId} - User Guid

In Request Headers: X-Auth: Authorization Token

Answer: If the request is successful, an HTTP response "200" will be returned.

Section: Users

Adding a user

POST /api/v3/users

The method allows you to add a user. The method allows you to add the user specified in the request.

Request method: POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/users

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON):


    "lastName": "", // last name    
    "firstName": "", // first name    
    "position": "", // position    
    "phone": "", // phone    
    "organization": "", // organization    
    "login": "", // login (required)
    "password": "", // password (required)
    "email": "", // email (required)
    "description": "string", // Description
    "isReadOnly": true, // Read-only right, true - enabled, false - disabled
    "isDisabledMobile": true, // Prohibit using the mobile application, true - enabled,false - disabled
    "isEnabled": true, // Enabled, true - enabled, false - disabled
    "parentId": "", // Parent agent Guid   
    "leaderId": "", // Leader Guid (null - not set)
    "sessionDuration": 0, // session duration, in minutes (null - default, 30 minutes)
    "doubleAuth":
    {
       "kind": 0, // 2-Step Verification status, email - enabled, None - disabled
       "target": "string" // 2-Step Verification email address
    },
    "groups":
    [
       "string" // user groups, listing system role names
    ],
    "customGroups ":
    [
       "3fa85f64-5717-4562-b3fc-2c963f66afa6" // user groups,listing the name of client roles
    ],
    "language": 0 // User interface language 1 - Russian, 2 - English, 3 - Azerbaijani
}

{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "lastName": "string",
  "firstName": "string",
  "position": "string",
  "phone": "string",
  " organization": "string",
  "login": "string",
  "password": "string",
  "email": "string",

Answer:

{     

    "id": "" , // User ID      
    "lastName": "" , // Last name ,      
    "firstName": "" , // First name      
    "position": "" , // Position      
    "phone": "" , / / Phone      
    "organization": "" , // Organization      
    "login": "" , // Login      
    "password": "" , // Password      
    "email": "" , // Email      
    "description": "" , / / Description      
    "isEnabled": "" , // Enable flag      
    "parentId": "" ,     // Parent agent Guid
    "sessionDuration": "" , // Session duration, in minutes      
    "doubleAuth": "" , // two-factor authentication parameters         
    "kind": "" , // authentication type          
    "target": "" , // in case of email authentication - email address      
    "groups":  
["", ""]  , // user roles, names of user groups are listed

}

Getting a list of users

POST /api/v3/users/find

The method allows you to get the main user parameters: login, name, email address, phone number, status, parent client ID, and so on.

The method returns information about the users of the authorized user's parent client and the users of its child clients. Information about users is provided subject to the right "View Users» .

Request method: POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/users/find

Object filtering conditions are specified in the request body.

Parameters in the request body (JSON):

{

  "parentId": "375a1f06-c384-43f8-8562-1c3d79a32303", // GUID of the agent to get data for, null - for the current agent
  "userId": "11111111-c384-43f8-8562-1c3d79a32303", // ID of user filtered by, null - doesn't matter
  "login": "qqqqqq", // Login of user filtered by, null - doesn't matter
  "email": "eee", // Email of user filtered by, null - doesn't matter

}

Answer:

{            

    "id": "" , // user ID          
    "lastName": "" , // last name          
    "firstName": "" , // first name          
    "position": "" , // position          
    "phone": "" , // phone number          
    "parentId": "" , // parent client ID          
    "parentName": "" , // parent client name          
    "organization": "" , // organization          
    "login": "" , // login         
    "email" : "" , // Email
    "sessionDuration":"",// session duration in minutes
    "status": "1", // user status          
    "astLogged": "", // date/time of last authorization

}

Getting information about a user

GET /api/v3/users/{GUID}

The method returns detailed information about the user of the parent client of the authorized user or the user of its child clients. User information is provided subject to the right "View Users» .

Request method: GET

Request URL:  https://hosting.glonasssoft.ru/api/v3/users/{GUID }

In Request Headers: X-Auth: Authorization Token

Answer:

{
    "id": "", // User GUID
    "lastName": "", // Last name 
    "firstName": "", // First name
    "position": "", // Position
    "phone": "", / / Phone number
    "parentId": "", // GUID of the client that owns the user
    "parentName": "", Name of the client that owns the user
    "organization": "", // Organization
    "login": "", // User login
    "email": "", // Email address
    "language": , // User interface language 1 - Russian, 2 - English,3 - Azerbaijani
    "isReadOnly": , // Read-only permission, true - enabled, false - disabled
    "description": "", // Description
    "isEnabled": , // Enabled, true - enabled, false - disabled
    "doubleAuth":
    {
        "kind": "None", // Two-step verification status, email - enabled, None - disabled
        "target": "string" / / 2-Step Verification email address
    },
    "isDisabledMobile": false, // Disable the use of the mobile app, true - enabled, false - disabled
    "sessionDuration": 30, // Session duration in minutes
    "status": 0, // User status , 0 - new, 1 - confirmed, 2 - active, 3 - update, 4 - blocked
    "lastLogged": "2022-08-22T06:57:51.002129Z",// Date and time of the last login of the user
    "groups": [], // List of user roles
    "customGroups": [], // List of user client roles
    "authDevices": [ ], // List of authorized devices
    "mobileDoubleAuthDevices": [], // List of authorized mobile devices
    "pushNotificationsDevices": [] // List of mobile devices that subscribed to mobile notifications
}

User editing

PUT /api/v3/users

The method allows you to edit the user. The method allows editing the user specified in the request.

Request method: PUT

Request URL:  https://hosting.glonasssoft.ru/api/v3/users

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON):

{   

    "id": "" , // user ID 
    "lastName": "" , // last name    
    "firstName": "" , // first name    
    "position": "" , // position    
    "phone": "" , // phone number    
    "organization": "" , // organization    
    "login": "" , // login    
(If null - do not change) 
    "password": "" , // password (If null - do not change)
    "language" : , // User interface language 1 - Russian, 2 - English, 3 - Azerbaijani
    "isReadOnly": , // Read-only permission, true - enabled, false - disabled    
    "email": ""   , // email 
(If null - do not change) 
    "description": "" , // description    
    "isEnabled": "" , // enable flag   
    "parentId": "" , // Parent agent Guid    
    "leaderId": "" , // Leader Guid (null - not set)    
    "sessionDuration": "" , // session duration, in minutes (null - default, 30 minutes)    
    "doubleAuth":
    {
        "kind": "None", // 2-Step Verification status, email - enabled, None - disabled
        "target": "string" // 2-Step Verification email address
    },
    "isDisabledMobile": false, // Prohibit the use of the mobile application, true - enabled, false - disabled
    "groups": "" , // user groups,"user" user group name

}

Answer:

{     

    "id": "" , // user ID          
    "lastName": "" , // last name          
    "firstName": "" , // first name          
    "position": "" , // position          
    "phone": "" , // phone number      
    "organization": "" , // organization      
    "login": "" , // login      
    "password": "" , // password 
    "email": "" , // email      
    "description": "" , // description       
    "isEnabled": "" , // enable sign        
    "parentId": "" ,     // Parent agent Guid
    "sessionDuration": "" , // session duration, in minutes 
    "doubleAuth":
    {
        "kind": "None", // 2-Step Verification status, email - enabled, None - disabled
        "target": "string" // 2-Step Verification email address
    },
    "isDisabledMobile": false, // Disable mobile application, true - enabled, false - disabled
    "target": "" , // in case of email authentication - email address      
    "groups": "" , // user groups, "user" user group name

}

Changing user status

 PUT /api/v3/users/status/{id}

The method allows you to change the status of the user specified in the request.

Request method: PUT

Request URL:  https://hosting.glonasssoft.ru/api/v3/users/status/ {id}

Request parameter: {id} - User's GUID

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON):

{

    "status": "" , // user status (0 - new, 1 - confirmed, 2 - active, 3 - check, 4 - blocked) "description": "" , // description "
    data
    ": "" , / / data related to status change

}

Response: If the request is successful, an HTTP response "200" will be returned.

Blocking users

POST /api/v3/users/disable

The method allows you to perform mass blocking of users .

Request method:  POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/users/disable

In the body of the request, list the array of user ids (JSON):

 [ 
    "8ed730d3-c61c-4c3a-ae4f-f41d9e710abc",
    "415f9ea3-8bc0-4e87-8d78-0852b0c0a4f1"
  ]

Response: If the request is successful, an HTTP response "200" will be returned.

Unblocking users

POST /api/v3/users/enable

The method allows you to perform mass unblocking of users .

Request method:  POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/users/enable

In the body of the request, list the array of user ids (JSON):

 [ 
    "8ed730d3-c61c-4c3a-ae4f-f41d9e710abc",
    "415f9ea3-8bc0-4e87-8d78-0852b0c0a4f1"
  ]

Response: If the request is successful, an HTTP response "200" will be returned.

For the two methods described above, if it was not possible to enable or disable some users from the passed list, a response is returned - 206 Partial Content

In response body:
{
    "errorMessages": [
        "Agent 0f8c2a8b-4b71-48d0-b780-341053089874 cannot access to object Agents d493fd88-60c8-465d-afad-912f5ac9d719."
    ],
    "users": [
        "415f9ea3-8bc0-4e87-8d78-0852b0c0a4f1"
    ]
}


"errorMessages" - an array of errors that caused the user action to fail.
"users" - an array of user ids that could not be enabled or disabled.

Deleting a user

DELETE /api/v3/users/{id}

The method allows you to delete a user. The method allows you to delete the user specified in the query string.

Request method: DELETE

Request URL:  https://hosting.glonasssoft.ru/api/v3/users/{id }

Request parameter: {id} - User's GUID

In Request Headers: X-Auth: Authorization Token

Answer: If the request is successful, an HTTP response "200" will be returned.

Section: Vehicles

Getting information about an object

GET /api/v3/vehicles/{vehicleId}

The method allows you to get all the information from the object card: ID, object name, imei, device type, SIM1, SIM2, client ID, client name, model ID, object model name, department ID, drivers, maintenance, current mileage, engine hours, consumption rates , a complete history of statuses with all comments, a list of sensors (type, name, input type, input number, alias, sensor type, calibration type, calibration, the state of the checkboxes "displayed in the tooltip" and "display the last valid value".

The method returns information about the object, taking into account the settings of the authorized user specified in the request:

− information is returned about the authorized user's parent client object and the object of its child clients;

− information about maintenance is provided taking into account the rights to Viewing Maintenance Jobs» .

Request method: GET

Request URL:  https://hosting.glonasssoft.ru/api/v3/vehicles/ v ehicleID>

Request parameter: <vehicleid> - object identifier (optional)

In Request Headers: X-Auth: Authorization Token

Answer:

{
    "vehicleId": "", // object ID
    "name": "", // object name
    "imei": "", // object IMEI
    "deviceTypeId": , // device type ID
    "deviceTypeName": "" , // Device type name
    "sim1": "", // SIM1 number
    "parentId": "", SIM2 number
    "parentName": "", Parent client name
    "modelId": "", object model ID
    "modelName" : "", Object model name
    "createdAt": "", Object creation date
    "mileageCalcMethod": "",Selected mileage calculation method
    "counters": { // Rates
        "mileageEnabled": "", // Counter activity flag "Mileage" (true - enabled, false - disabled)
        "motohoursEnabled": "", // "Motor hours" counter activity flag (true - enabled, false - disabled)
        "mileage": "", // Mileage according to the norms in meters
        "motohours": "" // Moto hours according to the norms, in seconds
        "mileageTime": "2023-03-14T11:18:52.696Z", // odometer edit/update timestamp
        "motohoursTime": "2023-03-14T11:18:52.696Z" // edit timestamp/ updating the hour meter
    },
    "inspectionTasks": [ // Tasks for tech. maintenance
        {
            "id": "", // job ID
            "enabled": "",

            "description": "", // Task description
            "mileageCondition": "", // Mileage condition (in meters, null - the condition does not work)
            "lastMileage": "", // Mileage (in meters) at the moment of the last MOT (null - doesn't matter)
            "motohoursCondition": "", // Motohours condition (in seconds, null - the condition doesn't work)
            "lastMotohours": "", // Motohours (in seconds) at the moment of the last MOT (null - doesn't matter )
            "periodicCondition": "", // Time periodicity condition (null - the condition does not work)
            "kind": "", // Time periodicity type (days - Days, months - Months, years - Years,null - condition does not work)
            "lastInspectionDate": "" // Date of the last MOT (null - not specified)
            "maxQuantity": "" // How many times to execute the task (null - once)
        }
    ]
}

The "status" parameter contains the id of the object's status in the system, the correspondence to the id and the textual name of the status are given below:

0 - "Block" 1 - "Active", 2 - "Canceled", 3 - "Equipped", 4 - "Diagnosis", 5 - "Service", 6 - "Dismantling", 7 - "Installation", 8 - " Reorder", 9 - "Serviced", 10 - "Decommissioned", 11 - "Faulty", 12 - "Checked", 13 - "Not operated".

Adding an object

POST /api/v3/vehicles

The method allows you to add the object specified in the request.

Request method: POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/vehicles

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON): Required parameters object name and model  In the request body - JSON object

{

    "parentId": "" , // client ID
    "name": "" , // vehicle name
    "imei": "" , // IMEI
    "deviceTypeId": "" , // device type ID
    "modelId": "" , // Model ID
    "unitId": "" , // Unit ID
    "sim1": "" , // SIM 1 number
    "sim2": "" , // SIM2 number
    "consumptionPer100Km": "" , // Fuel consumption per 100 km (if filled, then consumptionPerHour cannot be filled)
    "consumptionPerHour": "" , // Fuel consumption per hour (if filled, then consumptionPer100Km cannot be filled)
    "consumptionIdle": "" , // Fuel consumption at idle
    "consumptionPer100KmSeasonal": 0, // Seasonal fuel consumption per 100 km
    "consumptionPerHourSeasonal": 0, // Seasonal fuel consumption per engine hour
     "consumptionIdleSeasonal": 0, // Seasonal fuel consumption at idle 
     "consumptionPer100KmSeasonalBegin": "" , // Starting day/month of the seasonal consumption rate per 100 km
     "consumptionPer100KmSeasonalEnd" : "" , // Day/month of the end of the seasonal consumption rate per 100 km
     "consumptionPerHourSeasonalBegin": "" , // Day/month of the beginning of the seasonal consumption rate per engine hour
     "consumptionPerHourSeasonalEnd": "" , // Day/month of the end of work seasonal consumption rate per hour
     "consumptionIdleSeasonalBegin": "" ,// Day/month of the beginning of the seasonal consumption rate for x/x
      " consumptionIdleSeasonalEnd      " : "" , //
     Day /month of the end of      the      seasonal consumption rate for x/x "mileage"      "motohours": "" , // motohours      "motohoursEnabled": true // "motohours" counter activity flag       },     "cmsv6Parameters": { // CMSv6 parameters       "enabled": true, // enable flag       "id" : "" , // id       "host": "" , // IP address or domain name from CMSV6 website URL       "login": "" , // account name       "password": "" // account password       },













    "inspectionTasks": // maintenance tasks
      {
      "enabled": "" , // Enable flag
      "name": "" , // Task name
      "description": "" , // Task description
      "mileageCondition": "" , // Mileage condition (in meters, null - the condition does not work)
      "lastMileage": "" , // Mileage (in meters) at the time of the last maintenance (null - doesn't matter)
      "motohoursCondition": "" , // Condition for engine hours (in seconds, null - condition does not work)
      "lastMotohours": "" , // Motor hours (in seconds) at the moment of the last maintenance (null - doesn't matter)
      "periodicCondition": "" ,// Periodicity condition in time (null - the condition does not work)
      "kind": "" , // Periodicity type by time (days - Days, months - Months, years - Years, null - the condition does not work) "
      lastInspectionDate": "" , // Date of the last maintenance (null - not specified)
      "maxQuantity": "" // How many times to execute the task (null - once)
      }

 }

Answer:

{

    "vehicleId": "", //Vehicle ID 
    "parentId": "", //Guid of the vehicle owner
    "name": "", //Object name
    "imei": "", //IMEI
    "deviceTypeId": "" , //Device type ID
    "modelId": "", //Model ID
    "unitId": "", //Unit ID
    "sim1": "", //SIM1
    "sim2": "", //SIM2
    "consumptionPer100Km ": "", //Fuel consumption per 100 km
    "consumptionIdle": "", //Fuel consumption at idle
 "counters": { //Counters
    "mileageEnabled": true,
    "motohoursEnabled": true,
    "mileage": "",
    "motohours": 345.0
    },
 "cmsv6Parameters": { //CmsV6 parameters
    "id": null,
    "enabled": true, //enable flag
    "host": "", // IP address or domain name from CMSV6 website URL
    "login": "", // account name
    "password": "" / / account password
    },
  "inspectionTasks": { // Maintenance tasks
    "id": "", // Task ID
    "enabled": false, // Enable flag
    "name": "", // Task name
    "description ": "", // Task description
    "mileageCondition": "", // Mileage condition
    "lastMileage": "", // Mileage (in meters)
    "motohoursCondition": "",// Motohours condition
    "lastMotohours": "", // Motohours
    "periodicCondition": "", // Time periodicity condition
    "kind": "", // Type of periodicity in time 
    "maxQuantity": "" // How many times to execute the task (null - once)
    }

}

Validation:
- the seasonal parameter can only be set if the corresponding normal rate is set;
- seasonal start and end can be set only if the corresponding seasonal rate is set;
- when setting the seasonal norm, the corresponding start/end dates are required.

Getting Object Parameters

POST /api/v3/vehicles/find

The method allows you to get the main parameters of objects: name, IMEI, device type, object model, department, phone numbers and identifier of the client to which the object is attached (client-parent).

The method returns information about objects, taking into account the settings of the authorized user specified in the request:

- returns information about the objects of the client-parent of the authorized user and the objects of his child clients;

− returns information about objects, taking into account the specified object visibility settings;

− information is provided taking into account the availability of rights to view objects of blocked contracts (objects belonging to a blocked contract are returned if any of the rights "Visibility of objects of blocked contracts in the control panel" or "Visibility of objects of blocked contracts in monitoring» ;

− information about SIM1/SIM2 phones is provided if you have the right "View phone numbers of objects» ;

− information about the status of an object is provided if there is a right "View object status» .

Request method: POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/vehicles/find

In request headers:

− Content-Type:application/json

− X-Auth: Authorization Token

Object filtering conditions are specified in the request body.

Parameters in the request body (JSON):

{
    "vehicleId": null, // 84350, Vehicle ID (int, optional)
    "name": null, // Vehicle name (string, optional)
    "imei": null, // "710179307", // IMEI (string , optional)
    "sim": null, // "938112", // Phone number (string, optional)
    "deviceTypeId": null, // 5, device type ID (short, optional)
    "parentId": null, // Client ID (Guid, optional)
    "unitId": null, // "b33548c3-73c3-40e4-8b78-81470ae744ed", Unit ID (Guid, optional)
    "customFields": null // value of any of the custom fields of the vehicle
}

Filtering is carried out by the exact match of the values ​​of the parameters "vehicleId","deviceTypeId","parentId","unitId", and partially -"name","imei","sim". Filtering by parameter value «sim» is carried out if the authorized user has the right «View phone numbers of objects» .

Answer:

{

    "vehicleId": "" // object identifier          
    "name": "" // object name          
    "imei": "" // object IMEI          
    "deviceTypeId": "" // device type identifier          
    "deviceTypeName": "" // name device type          
    "sim1": "" // first phone number          
    "sim2": "" // second phone number          
    "parentId": "" // parent client ID          
    "parentName": "" // parent client name          
    "modelId ": ""         // object model identifier
    "modelName": "" // object model name          
    "unitId": "" // unit identifier         
    "unitName": "" // unit name          
    "status": "" // object status         
(-1 - New, 0 - Locked, 1 - Active, 2 - Canceled, 3 - Equipped, 4 - Diagnostics, 
                                                           // 5 - Service, 6 - Dismantling, 7 - Installation, 8 - Re-order, 9 - Serviced, 10 - Decommissioned, 
                                                          // 11 - Defective, 12 - Checked, 13 - Out of service)
    "createdAt": "" // creation date of  
    "customFields" objects ": [ 
            {
                "id": "", // custom field identifier
                "name": "",// custom field name
                "value": "", // custom field value
                "forClient": true, // the right to display in the client
                "forTooltip": false, // the right to display in the tooltip
                "forReport": false // the right to display in reports
            } 

}

          Options "sim1" And "sim2” are contained in the response if the authorized user has the right View phone numbers of objects» . Parameter "status” is contained in the response if the authorized user has the right View object status» .

Changing the status of an object

POST /api/v3/vehicles/changeStatus/{vehicleId}

The method allows you to change the status of an object. The method allows you to change the status of the object specified in the request.

Request method: POST

Request URL:  https://hosting.glonasssoft.ru/api/v3/vehicles/changeStatus/ {vehicleId}

Request parameter: {vehicleId} - Vehicle ID

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON):

{

  "status": "", // status value (-1 - New, 0 - Blocking, 1 - Active, 2 - Canceled, 3 - Equipped, 4 - Diagnostics, // 5 - Service, 6 - Dismantling, 7 - 
                                   Mounting , 8 - Reorder, 9 - Serviced, 10 - Decommissioned, 
                                   // 11 - Faulty, 12 - Checked, 13 - Out of service)
  "date": "", // Status change date (null if change immediately)
  "description": "", // Description
  "data": "", // Data
  "overwrite": false, // Overwrite flag
  "stage": "", // State, can be null

}

Answer:

{

  "status": "", // status value
  "date": "", // Status change date 
  "description": "", // Description
  "data": "", // Data
  "overwrite": false, / / Rewrite flag
  "stage": "", // State

  }

Editing an object

PUT /api/v3/vehicles

The method allows you to edit the object specified in the request.

Request method: PUT

Request URL:  https://hosting.glonasssoft.ru/api/v3/vehicles

In Request Headers: X-Auth: Authorization Token

Parameters in the request body (JSON):

{     

    "vehicleId": "", // Vehicle ID      
    "parentId": "", // Client ID      
    "name": "", // Vehicle name      
    "imei": "", // IMEI      
    "deviceTypeId": "", // device type ID      
    "modelId": "", // , model ID    
    "unitId": "", // units      
    "sim1": "", // SIM 1      
    "sim2": "", // SIM2     

    "consumptionPer100Km ": "" , // Fuel consumption per 100 km (if filled, then consumptionPerHour cannot be filled)
    "consumptionPerHour": "" , // Fuel consumption per engine hour (if filled,then consumptionPer100Km cannot be filled)
    "consumptionIdle": "" , // Fuel consumption at idle
    "consumptionPer100KmSeasonal": 0, // Seasonal fuel consumption per 100 km 
    "consumptionPerHourSeasonal": 0, // Seasonal fuel consumption per engine hour
     "consumptionIdleSeasonal": 0, // Seasonal fuel consumption at idle 
     "consumptionPer100KmSeasonalBegin": "" , // Day/month of the start of the seasonal consumption rate per 100 km
     "consumptionPer100KmSeasonalEnd": "" , // Day/month of the end of the seasonal consumption rate per 100 km
     "consumptionPerHourSeasonalBegin": "" , // Day/month of the start of the seasonal consumption rate per engine hour
     "consumptionPerHourSeasonalEnd": "" , // End day/month of the seasonal consumption rate per engine hour
     "consumptionIdleSeasonalBegin": "" , // Start day/month of the seasonal consumption rate on x/x
     "consumptionIdleSeasonalEnd": "" , // Day/month of the end of the seasonal consumption rate on x/x
         "counters": 
        {          
         "mileageEnabled" : true, // "mileage" counter active flag          
         "motohoursEnabled": true, // "motohours" counter active flag          
         "mileage": "", // mileage, in meters    
         "motohours": "" // motor hours, in seconds
        }      
        "cmsv6Parameters": // CMSv6 parameters   
        {       
        "id": "",         // identifier
        "enabled": true, // enable flag         
        "host": "", // IP address or domain name from CMSV6 website URL          
        "login": "", // account name          
        "password": "", // account password      
        }      
            "inspectionTasks": // maintenance jobs          
        {              
            "id": "", // job ID              
            "enabled": false, // Enable flag              
            "name": "", // Job name              
            "description": "", // Job description              
            " mileageCondition": "", // Mileage condition (in meters,             null - condition does not work)
            "lastMileage": "", // Mileage (in meters) at the time of the last maintenance (null - doesn't matter)              
            "motohoursCondition": "", // Condition for motor hours (in seconds, null - the condition does not work)              
            "lastMotohours": " ", // Engine hours (in seconds) at the moment of the last maintenance (null - doesn't matter)              
            "periodicCondition": "", // Time periodicity condition (null - the condition does not work)              
            "kind": "", // Type of periodicity by time              
            "maxQuantity": "", // How many times to execute the task          
            }  

}

Answer:

{     

    "vehicleId": "", // Vehicle ID      
    "parentId": "", // Client ID      
    "name": "", // Vehicle name      
    "imei": "", // IMEI      
    "deviceTypeId": "", // device type      
    "modelId": "", // model ID      
    "unitId": "", // unit ID      
    "sim1": "", // SIM 1      
    "sim2": "", // SIM2      
    "consumptionPer100Km" : "", // Fuel consumption per 100 km      
    "consumptionIdle": "", // Fuel consumption at idle      
        "counters":
        {          
        "mileageEnabled": true, // "mileage" counter activity flag          
        "motohoursEnabled": true, // "motohours" counter activity flag         
        "mileage": "", // mileage          
        "motohours": "", // engine hours      
        }      
        "cmsv6Parameters": // CMSv6 parameters   
        {
        "id": // identifier          
        "enabled": true, // enable flag          
        "host" : "", // IP address or domain name from CMSV6 website URL          
        "login": "", // account name          
        "password": "", // account password      
        }      
        "inspectionTasks": // tasks on TO            
        {
        "id": "",             // Job ID
        "enabled": false, // Enable flag             
        "name": "", // Job name              
        "description": "", // Job description              
        "mileageCondition": "", // Mileage condition              
        "lastMileage": "", // Mileage (in meters) at the moment last maintenance              
        "motohoursCondition": "", // Motohours condition              
        "lastMotohours": "", // Motohours              
        "periodicCondition": "", // Time periodicity condition              
        "kind": "", // Type of time periodicity              
        "maxQuantity": "",         // How many times to run the task
        }

}

Validation:
- the seasonal parameter can only be set if the corresponding normal rate is set;
- seasonal start and end can be set only if the corresponding seasonal rate is set;
- when setting the seasonal norm, the corresponding start/end dates are required.

Deleting an object

DELETE /api/v3/vehicles/{vehicleId}

The method allows you to delete the object specified in the query string.

Request method: DELETE

Request URL:  https://hosting.glonasssoft.ru/api/v3/vehicles/ {vehicleId}

Request parameter: {id} - Guid of the object

In Request Headers: X-Auth: Authorization Token

Answer: If the request is successful, an HTTP response "200" will be returned.

Section: Devices

Get a list of device types

 GET /api/v3/devices/types

The method allows to get a list of device types. The method returns information about device types based on the settings of the authorized user specified in the request.

Request method: GET

Request URL:  https://hosting.glonasssoft.ru/api/v3/users/api/v3/devices/types

In Request Headers: X-Auth: Authorization Token

Answer:

{

    "deviceTypeId" : "", // device type ID
    "deviceTypeName" : "" // device type name

}

Section: Sensors

Getting a list of sensor types

 GET /api/v3/sensors/types

The method allows to get a list of sensor types. The method returns information about sensor types based on the settings of the authorized user specified in the request.

Request method: GET

Request URL:  https://hosting.glonasssoft.ru/api/v3/sensors/types

In Request Headers: X-Auth: Authorization Token

Answer:

{

    "id": "", // Sensor type ID 
    "name": "", // Name
    "description": "", // Description

}

Section: Messages

Object activity data

POST /api/v3/terminalMessages/count

The method returns the number of messages sent by the terminal to the server for the specified period.

POST request method

Request URL:  https://hosting.glonasssoft.ru/api/v3/terminalMessages/count

In Request Headers: X-Auth: Authorization Token

{
  "vehicleIds": [
    id // a list of object identifiers is passed here
  ],
  "from": "2023-03-12T07:09:02.364Z", // from which date to execute the request
  "to": "2023-03-14T07 :09:02.364Z" // until what date to execute the request
}

Answer:

[
  {
    "vehicleId": 0, // object identifier
    "count": 0 // number of messages per period
  }
]

Message List Request

POST /api/v3/terminalMessages

The method returns a list of object's terminal messages for the selected period.

POST request method

Request URL:  https://hosting.glonasssoft.ru/api/v3/terminalMessages

In Request Headers: X-Auth: Authorization Token

{
  "vehicleId": 0, // object id
  "from": "2023-03-29T09:14:46.107Z", // start of request period
  "to": "2023-03-29T09:14:46.107Z" / / end of request period
}

Answer:

[
  {
    "messages": [
      {
        "deviceTime": "2023-03-29T09:14:46.125Z", // Device time
        "serverTime": "2023-03-29T09:14:46.125Z", // Server time
        "speed": 0, // Speed, km/h
        "altitude": 0, // Altitude, m
        "latitude": 0, // Latitude [-90°;90°]
        "longitude": 0, // Longitude [-180°;180°]
        "satellites": 0, // Number of satellites
        "voltage": 0, // Voltage
        "parameters": { // list of sensor parameters transmitted by the terminal
          "additionalProp1": "string",
          "additionalProp2": "string",
          "additionalProp3": "string"
        },
        "photoCount": 0 // Number of photos
      }
    ]
  }
]

Section: Notifications

Request a list of client notifications

POST /api/v3/notifications/find

The method returns notification information about the passed client and its clients down the hierarchy.

POST request method

Request URL:  https://hosting.glonasssoft.ru/api/v3/notifications/find

In Request Headers: X-Auth: Authorization Token

{
  "parentId": "" // client id
}

Answer:

[
  {
    "id": 0, // Notification ID
    "name": "string", // Notification name
    "active": true, // Status true - active, false - deactivated
    "type": 0, // Event Template 0 - Entering and leaving the geofence, 2 - Excess speed, 4 - Drain, 5 - Refueling, 6 - Panic button activation, 7 - Loss of connection with the object, 8 - Discrete sensor activation, 9 - Analog sensor value, 10 - Address, 11 - Simple, 12 - Perform TO
    "userId": "", // User who created notification
    "parentId": "", // Client ID
    "parentName": "string" // Client name
  }
]

Request notification settings

GET /api/v3/notifications/{id}

The method returns data on the rules for generating the selected notification.

GET request method

Request URL:  https://hosting.glonasssoft.ru/api/v3/notifications/{id}

Request parameter: {id} -  notification id

In Request Headers: X-Auth: Authorization Token

Answer:

{
  "id": 0, // 
notification id
  "type": 0,  // Event template 0 - Entering and leaving the geofence, 2 - Speeding, 4 - Drain, 5 - Refueling, 6 - Panic button activation, 7 - Loss of communication with the object, 8 - Discrete sensor triggering, 9 - Analog sensor value, 10 - Address, 11 - Idle, 12 - Maintenance execution
  "userId": "", / / ​​User who created the notification
  "parentId": "",  / / Client ID
  "parentName": "string",  // Client name
  "name": "string",  // Notification name
  "active": true,  // Status true - active, false - deactivated
  " vehicleIds": [ // List of object ids to parse
    0
  ],
  "geoids": [ // 
List of id geo objects for analysis
    0
  ],
  "fieldids": [ // 
List of field ids for analysis
    0
  ],
  "settings": { // List of notification parameters
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string"
  },
  "toEmail": true, // 
Flag that the "Send email notifications to system users" setting is active
  "recipientIds": [ //  List of Guid users , who need to send a message to the mail when the rule
    ""
  ],
  "enableSideEmails": true, // 
Flag that the setting "Sending messages to e-mails to third-party users" is active
  "sideEmails": [ //  List of e-mail addresses for sending notifications
    "string"
  ],
  "toTelegram": true, // 
Flag for sending messages to Telegram
  "telegrams": [ //  List of recipients of notifications in Telegram.
    {
      "id": 0, // 
Chat participant ID
      "info": "string" //  Additional information
    }
  ],
  "toMobile": true, // 
Activity flag for sending to the mobile application
  "toClient": true, 
Specifies whether notifications derived from this rule should be stored in the notification history log.
  "kind": 0, //  Defines the type of notification
  "activationMode": 0, //  Type of notification activation 0 - Now, 1 - At a specific date and time
  "activationTime": "2023-03-29T09:57:48.932Z", //  Rule activation date/time (UTC)
  "timezone": 0, //  Time zone offset
  "validity": 0, //  Validity in days (1-90)
  "autoProlongation": true //  Auto-renewal
}

Editing a notification

PUT /api/v3/notifications/

The method allows you to edit the notification.

PUT request method

Request URL: https://hosting.glonasssoft.ru/api/v3/notifications

In Request Headers: X-Auth: Authorization Token

Request body:
{
 "id": 0, // notification id
  "type": 0, // Event template 0 - Entering and leaving the geofence, 2 - Speeding, 4 - Drain, 5 - Refueling, 6 - Panic button activation , 7 - Loss of connection with the object, 8 - Discrete sensor triggering, 9 - Analog sensor value, 10 - Address, 11 - Idle, 12 - Perform maintenance "userId": "", //
  User who created the notification
  "parentId": " ", // Client ID
  "parentName": "string", // Client name
  "name": "string", // Notification name
  "active": true, // Status true - active, false - deactivated
  "vehicleIds":[ // List of id objects for analysis
    0
  ],
   "geoids": [ // List of id geo objects for analysis
    0
  ],
  "fieldids": [ // List of field ids to parse
    0
  ],
  "settings": { // List of notification parameters
    "additionalProp1": "string",
    "additionalProp2": "string",
    "additionalProp3": "string "
  },
  "toEmail": true, // Flag that the setting "Sending notifications to e-mail to system users" is active
  "recipientIds": [ // List of Guid users who need to send a message to e-mail when the rule
    ""
  ],
  "enableSideEmails": true, // Flag that the setting "Sending messages to e-mails" is active.mail to third-party users"
  "sideEmails": [ // List of email addresses for sending notifications
    "string"
  ],
  "toTelegram": true, // Flag of sending activity to Telegram
  "telegrams": [ // List of recipients of notifications in Telegram.
    {
      "id": 0, // Chat participant ID
      "info": "string" // Additional information
    }
  ],
  "toMobile": true, // Activity flag for sending to the mobile app
  "toClient": true, // Activity flag sending in the system interface
  "stored": true, // Determines whether notifications derived from this rule should be stored in the notification history log.
  "kind": 0, // Defines the type of notification
  "activationMode": 0,
  "activationTime": "2023-03-29T09:57:48.932Z", // Date and time of rule activation (UTC)
  "timezone": 0, // Time zone offset
  "validity": 0, // Validity in days (1-90)
  "autoProlongation": true // Auto-renewal
}

Answer:

success

Removing a notification

DELETE /api/v3/notifications/{id}

The method allows you to delete the selected notification.

DELETE request method

Request URL: https://hosting.glonasssoft.ru/api/v3/notifications/{id}

Passed parameter: {id} - notification id

In Request Headers: X-Auth: Authorization Token

Answer:

success

For questions regarding the operation of PUBLIC API 3.0, please  contact support@glonasssoft.ru 

Tags: Public API API
   

Меню

GLONASSSoft wiki - 2023 г