API Documentation Primingcloud
API Documentation Primingcloud
1. Introduction
This document is intended to give instructions on how to operate the Govecs GOLD scooter
connector solution based on top of the PrimingCloud platform.
3. API
Demo/Test environment:
https://demo.primingcloud.com/data/integration/Govecs/Scooter/
Production environment:
https://prod.osapiens.cloud/data/integration/Govecs/Scooter/
Authorization:
Authorization is required, in order to send requests to the API. This has to be done via Basic
authentication, by specifying a username in the format “on.Govecs.<yourname>” and the
password for your tenant given to you.
username/password: Specified the credentials for the tenant (=OU) in the cloud. The
username consists of a prefix on which means that the OU Name should be used to identify
the tenant. “Govecs” is the Priming Cloud Customer in the cloud. “test-Govecs” is the name
of the Govecs tenant (also named OU or Organizational unit). The password is the
password of the OU.
One of the other fields like name/IMEI/VIN/license plate specify should be used to identify a
scooter.
API endpoints:
In order to address a specific scooter, any of the following API calls will require one of the
following scooter Ids:
• vin – Vehicle identification number
• imei – IMEI number of the Teltonika box
• lic – License plate number (if set for the scooter)
• name – Internal “Thing” name
• id – Internal “Thing” Id
API endpoints:
{
"data": {
"ActiveGSMOperator": 26201,
"Angle": 341,
"AxisX": 93,
"AxisY": 0,
"AxisZ": -937,
...
"TotalDistance": 1392,
"Towing": 1,
"TripDistance": 60000,
"VehicleSpeed": 0
},
"dataUpdateSuccess": true,
"lastDataUpdate": 1608482576000,
"scooterLock": {
"isLocked": true,
"wasLocked": false
},
"success": true
}
Locks or unlocks the top case of a scooter and returns the latest scooter status.
◦ Example response of a top case being locked when it was previously open:
{
"data": {
"ActiveGSMOperator": 26201,
"Angle": 341,
"AxisX": 93,
"AxisY": -15,
...
"TotalDistance": 1392,
"Towing": 1,
"TripDistance": 60000,
"VehicleSpeed": 0
},
"dataUpdateSuccess": true,
"lastDataUpdate": 1608482443000,
"success": true,
"topcaseLock": {
"isLocked": true,
"wasLocked": false
}
}
Locks or unlocks the Seat of the vehicle (if supported by the vehicle) and returns the
latest scooter status.
◦ Example response of a seat being locked when it was previously open:
{
"data": {
"ActiveGSMOperator": 26201,
"Angle": 341,
"AxisX": 93,
"AxisY": -15,
...
"TotalDistance": 1392,
"Towing": 1,
"TripDistance": 60000,
"VehicleSpeed": 0
},
"dataUpdateSuccess": true,
"lastDataUpdate": 1608482443000,
"success": true,
“seatLock": {
"success": true,
"wasLocked": false
PrimingCloud GmbH – Govecs GOLD solution
7 | 13
Change the status of the vehicle’s drive train (if supported by the vehicle) and returns
the latest scooter status.
Parameters:
{
"drivetrain": {
"response": "Govecs Drive Train State:3",
"success": true
},
"success": true
}
Turn on/off the lights of the vehicle (if supported by the vehicle) and return the latest
scooter status.
◦ Example response of lights being turned on when it was previously turned off:
{
"lights": {
"response": "Govecs hazard activated",
"success": true
},
"success": true
}
Make the scooter horn sound (if supported by the vehicle) and return the latest scooter
status.
◦ Example response of horn being activated:
{
"horn": {
"response": "Govecs horn activated",
"success": true
},
"success": true
}
• Query status updates for all scooters within the tenant “/queryStatusUpdates”:
◦ URL parameters:
▪ limit – Allows specifying a response size limit in number of entries.
Reasonable size would be 500.
▪ lastTimestamp – Caller should specify the lastTimestamp with what it got from
the last call of queryStatusUpdates. This is used to get advance in the queue.
◦ Example response with responses from two scooters:
{
"data": [
{
"data": {
"ActiveGSMOperator": 26201,
"Angle": 342,
"AxisX": 93,
"AxisY": 0,
...
"TopcaseClosed": 0,
"TopcaseLocked": false,
"TotalDistance": 1392,
"Towing": 1,
"TripDistance": 60000,
"VehicleSpeed": 0
},
"id": 1435489215,
"imei": "359633102780124",
"name": "GOLD_NO_4",
"timestamp": 1608481997546
},
{
"data": {
"ActiveGSMOperator": 26201,
"Angle": 342,
"AxisX": 93,
"AxisY": 0,
...
"TopcaseClosed": 0,
"TopcaseLocked": false,
"TotalDistance": 1392,
"Towing": 1,
"TripDistance": 60000,
"VehicleSpeed": 0
},
"id": 1435589218,
"imei": "459933101780122",
"name": "GOLD_NO_2",
"timestamp": 1608481997547
},
],
"lastTimestamp": 1608481997547
}
The response JSON may contain further application level error information, e.g.:
{
"error": "Unexpected error: Could not find scooter: imei= / name=undefined / id=undefined / lic=",
"success": false
}
The presence of a success=false and a “error” field should be checked too. The error field
may contain information about the kind of error.
Some of the API calls may contain further success status information in the JSON body.
These Api specific response fields should be checked too:
• lock/unlock scooter
◦ success – Specifies the the lock/unlock operation was successful.
◦ scooterLock.isLocked – Specifies if the scooter is now locked.
◦ scooterLock.wasLocked - Specifies if the scooter was locked before the command
was sent.
◦ dataUpdateSuccess – Specifies if the latest state of the scooter was retrieved
from the scooter.
• lock/unlock topcase
◦ success – Specifies the the lock/unlock operation was successful.
◦ topcaseLock.isLocked – Specifies if the topcase is now locked
◦ topcaseLock.wasLocked - Specifies if the topcase was locked before the
command was sent.
◦ dataUpdateSuccess – Specifies if the latest state of the scooter was retrieved
from the scooter.
• QueryStatus
◦ dataUpdateSuccess – Specifies if the latest state of the scooter was retrieved
from the scooter.