Skip to content

Gps information

Add gps

Description:

Used to add a new gps interface

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/add/gps

Request body:

Note: After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

The request body should be sent as form-data and it should contain the device information as illustrated in the section below:

Field name Description Type
gps_name Name of the gps str
gps_type The type of gps str
gps_token [Optional] Token that will be used to update the gps. If not specified, a random token will be generated str
update_period How often the gps will be updated. This time is used to calculate the gps status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

JSON format

{
    "gps_name":"Test gps",
    "gps_type":"NC",
    "gps_token":"f5d6dsewwds",
    "update_period":120
}

Request example:

None

Response

{
    "success": {
        "gps_id": 191683571546635,
        "gps_token": "df45g56df6"
    }
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Gps count

Description:

Used to get number of Gps available

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/count

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

None

Response

{
    "success": {
        "gps": 1
    }
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

List gps

Description:

Used to list all the Gps for the user

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/list

Request body:

Note: After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

None

Request example:

None

Response

{
    "success": [
        {
            "gps_id": 471684263186135,
            "gps_type": "Diff",
            "gps_name": "Home-GPS",
            "gps_status": "Offline",
            "gps_latitude": 0.0,
            "gps_longitude": 0.0,
            "gps_height": 0.0,
            "coordinate_system": "UTM",
            "gps_token": "df45g56df6",
            "update_time": 1684270386,
            "last_modified": 1684270386,
            "update_period": 20,
            "notification_enabled": true,
            "alarms": [
                {
                    "alarm_id": 1684263302602,
                    "device_id": 471684263186135,
                    "alarm_name": "Batmon voltage",
                    "alarm_enabled": true,
                    "alarm_threshold_value": 10.0,
                    "alarm_condition": ">=",
                    "alarm_trigger_time": null,
                    "alarm_repeat_delay": 300,
                    "alarm_akn": null,
                    "update_time": 1684263302,
                    "alarm_triggered": false,
                    "condition_parameter": "latitude"
                }
            ],
            "whatsapp_enabled": null,
            "sms_enabled": null,
            "gps_details": "{}",
            "longitude_units": "",
            "latitude_units": "",
            "height_units": ""
        }
    ]
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Field name Description Type
gps_name Name of the gps str
gps_type The type of gps str
gps_token Token that will be used to update the gps. If not specified, a random token will be generated str
gps_details gps details which will be stored as a json object json
gps_status Device status json
gps_latitude Gps latitude json
gps_longitude Gps longitude json
gps_height Gps height json
last_modified Indicates the latest update time in epoch json
notification_enabled Indicates if the notifications have been enabled for the interface json
whatsapp_enabled Indicates if whatsapp notifications have been enabled for the interface json
sms_enabled Indicates if sms notifications have been enabled for the interface json
latitude_units Voltage units json
longitude_units Current units json
height_units Power units json
update_period How often the gps will be updated. This time is used to calculate the gps status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Gps Status

Description:

Used to get gps status

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/status

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/status?gps_id=65698658484984584&gps_token=fds654gf654gdf56gdf654gdf

Json body example

{
    "gps_id": 65698658484984584,
    "gps_token": "fds654gf654gdf56gdf654gdf"
}

Response

{
    "success": {
        "gps_id": 471684263186135,
        "gps_name": "Home-GPS",
        "gps_type": "Diff",
        "gps_status": "Offline",
        "gps_latitude": 0.0,
        "gps_longitude": 0.0,
        "gps_height": 0.0,
        "gps_details": "{}",
        "last_modified": 1684270386,
        "update_period": 20,
        "notification_enabled": true,
        "whatsapp_enabled": null,
        "sms_enabled": null,
        "longitude_units": "",
        "latitude_units": "",
        "height_units": "",
        "alarms": [
            {
                "alarm_id": 1684263302602,
                "device_id": 471684263186135,
                "alarm_name": "Batmon voltage",
                "alarm_enabled": true,
                "alarm_threshold_value": 10.0,
                "alarm_condition": ">=",
                "alarm_trigger_time": null,
                "alarm_repeat_delay": 300,
                "alarm_akn": null,
                "update_time": 1684263302,
                "alarm_triggered": false,
                "condition_parameter": "latitude"
            }
        ]
    }
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Field name Description Type
gps_name Name of the gps str
gps_type The type of gps str
gps_token Token that will be used to update the gps. If not specified, a random token will be generated str
gps_details gps details which will be stored as a json object json
gps_status Device status json
gps_latitude Gps latitude json
gps_longitude Gps longitude json
gps_height Gps height json
last_modified Indicates the latest update time in epoch json
notification_enabled Indicates if the notifications have been enabled for the interface json
whatsapp_enabled Indicates if whatsapp notifications have been enabled for the interface json
sms_enabled Indicates if sms notifications have been enabled for the interface json
latitude_units Voltage units json
longitude_units Current units json
height_units Power units json
update_period How often the gps will be updated. This time is used to calculate the gps status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Gps update

Description:

Used to update gps status

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/update/gps

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/update/gps?gps_id=191679387165463&gps_token=201679387120404&gps_latitude=18.25648&gps_longitude=36.45&gps_height=168

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
    "gps_details": "{'key': 25}",
    "gps_latitude": 18.25648,
    "gps_longitude": 36.4545454,
    "gps_height": 168
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Gps history

Description:

Used to get gps history data

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/history

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Field name Description Type
min_epoch_tm_sec Minimum time for history record str
max_epoch_tm_sec [Optional] Maximum time for history data. This is set to current epoch time if not specified str
gps_id [Optional] gps ID. All gps history will be returned if not specified str

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/history?min_epoch_tm_sec=1641502593

Json body example

{
    "min_epoch_tm_sec": 1641502593,
    "max_epoch_tm_sec": 1999999999,
    "gps_id": 65897465466
}

Response

{
    "success": [
        {
            "gps_id": 471684263186135,
            "gps_name": "Home-GPS",
            "gps_type": "Diff",
            "coordinate_system": "UTM",
            "min_time": 1684263848,
            "max_time": 1684263848,
            "data": [
                {
                    "gps_status": "Online",
                    "gps_latitude": 18.25648,
                    "gps_longitude": 36.454544,
                    "gps_height": 168.0,
                    "gps_details": "{}",
                    "last_modified": "2023-05-16T21:04:08"
                }
            ]
        }
    ]
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Field name Description Type
gps_id gps ID str
gps_name Name of the gps str
gps_type The type of gps str
min_time Minimum history time available str
max_time Maximum history time int
data Array containing gps history data. json

Gps edit

Description:

Used to edit gps information

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/edit/gps

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Field name Description Type
gps_name Name of the gps str
gps_type The type of gps str
gps_token [Optional] Token that will be used to update the gps. If not specified, a random token will be generated str
latitude_units Voltage units json
longitude_units Current units json
height_units Power units json
update_period How often the gps will be updated. This time is used to calculate the gps status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Note:

Only the gps owner can edit the interface information.

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/edit/gps?gps_id=545467565849421245489&gps_token=5fgd94dgfd6fsd8d986gd6dg&gps_name=gps&update_period=300

Json body example

{
    "gps_id": "{{gps_id}}",
    "gps_token": "{{gps_token}}",
    "gps_name": "gps",
    "update_period": 300,
    "latitude_units": "rad",
    "longitude_units": "rad",
    "height_units": "m"
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Delete gps

Description:

Used to delete gps

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/delete/gps

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/delete/gps?gps_state=true&gps_token=df45ddddsdaewg56df6&gps_id=301659085216623

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Enable alerts

Description:

Used to enable interface alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/enable/alerts

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/enable/alerts?gps_token=df45ddddsdaewg56df6&gps_id=301659085216623

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Disable alerts

Description:

Used to disable interface alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/disable/alerts

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/disable/alerts?gps_token=df45ddddsdaewg56df6&gps_id=301659085216623

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Enable whatsapp

Description:

Used to enable interface whatsapp alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/enable/whatsapp

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/enable/alerts?gps_token=df45ddddsdaewg56df6&gps_id=301659085216623

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Disable whatsapp alerts

Description:

Used to disable interface whatsapp alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/disable/whatsapp

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/enable/alerts?gps_token=df45ddddsdaewg56df6&gps_id=301659085216623

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Enable sms alerts

Description:

Used to enable interface sms alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/enable/sms

Request body:

None

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/enable/alerts?gps_token=df45ddddsdaewg56df6&gps_id=301659085216623

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
}

Disable sms alerts

Description:

Used to disable interface sms alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/gps/disable/sms

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/gps/enable/alerts?gps_token=df45ddddsdaewg56df6&gps_id=301659085216623

Json body example

{
    "gps_id":301659085216623,
    "gps_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the gps interface has been added successfully