NAV
bash javascript php python

Info

Welcome to the generated API reference. Get Postman Collection

Overview

Welcome to the Bitgear Manhole Monitoring Application Server public documentation. In this site you will find all the information about the available API calls.

Please consider this documentation hub as a BETA version. Our team is actively working to add accurate and completed documentation, as well as expand the list of available methods.

V1.3

Getting Help

If you encounter any problems consuming the API or have suggestions please feel free to contact us at : support [at] bitgear [dot] rs

Response codes

200 OK

The request has succeeded.

201 Created

The request has been fulfilled, resulting in the creation of a new resource.

204 No Content

The server successfully processed the request and is not returning any content.

400 Bad Request

The server cannot or will not process the request due to an apparent client error (e.g., malformed request syntax, size too large, invalid request message framing, or deceptive request routing).

401 Unauthorized

The request has not been applied because it lacks valid authentication credentials for the target resource.

403 Forbidden

The user is not allowed to perform the requested action. This may be due to:

Reaching the resource limits or your account

404 Not Found

The requested resource does not exist.

Verify that the resource exists by accessing the parent resource.

405 Method Not Allowed

The requested method is not supported by the resource.

Check the API documentation.

409 Conflict

A Conflict error is returned when trying to create a resource with an identifier already assigned to another resource.

Assign another identifier to the resource being created.

429 TOO MANY REQUESTS

The user has sent too many requests in a given amount of time ("rate limiting").

To prevent abuse of the Bitgear API, we limit requests to a maximum of 60 calls within 1 minute time window (subject to change). Rate limiting is primarily considered on a per-connection basis (per access token). If you exceed the current rate limit, you will receive a 429 'Too many requests' response from our API. You will continue to receive a 429 response until you're out of the current time window.

500 Internal Server Error

The server encountered unexpected conditions while processing the request and could not successfully process it.

Date, Time and Time zone representation

All times are displayed in unix timestamp format and in UTC time standard.

Authentication

Login

Before you can make any request of the API, you must first authenticate. Once you've authenticated, you will be given an access token that may be used for all subsequent requests. Failure to include the access token or using an expired token will result in a 401 response.

Use the HTTP Authorization header Bearer when making a request.

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/login" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{"username":"test.user@example.com","password":"password"}'
const url = new URL(
    "https://example.bitgear.rs/ws/login"
);

let headers = {
    "Accept": "application/json",
    "Content-Type": "application/json",
};

let body = {
    "username": "test.user@example.com",
    "password": "password"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/login',
    [
        'headers' => [
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ],
        'json' => [
            'username' => 'test.user@example.com',
            'password' => 'password',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/login'
payload = {
    "username": "test.user@example.com",
    "password": "password"
}
headers = {
  'Accept': 'application/json',
  'Content-Type': 'application/json'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "api_token": "vv1oGfX39dqDpKDoWTfNBnApQTSrnv6NVJ6pONwnn52yx0w9K1j882gXVcMl",
    "zones": [
        {
            "zone_id": 9,
            "name": "Test zone"
        }
    ]
}

HTTP Request

POST ws/login

Body Parameters

Parameter Type Status Description
username string required Username
password string required Password

Authorizations

List of authorizations


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/authorization-list" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/authorization-list"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/authorization-list',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/authorization-list'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "authorization_id": 1,
            "approved_at": 1539007431,
            "rejected_at": null,
            "cancelled_at": 1539007597,
            "requested_at": 1539007431,
            "request_comment": "test",
            "name": "Dozvola_ulaska_1_08.10.18",
            "user_requested": "Joana Simonis",
            "user_apporoved": "Adaline Altenwerth",
            "user_rejected": null,
            "user_cancelled": null,
            "work_order": "ref",
            "in_progress": false,
            "manholes": [],
            "terminated": true,
            "zones": [],
            "date": {
                "from": 1539007380,
                "to": 1539699300
            }
        },
        {
            "authorization_id": 2,
            "approved_at": 1539065521,
            "rejected_at": null,
            "cancelled_at": null,
            "requested_at": 1539065521,
            "request_comment": "maintenance",
            "name": "Dozvola_ulaska_2_09.10.18",
            "user_requested": "Maximillian Lemke Sr.",
            "user_apporoved": "Maximillian Lemke Sr.",
            "user_rejected": null,
            "user_cancelled": null,
            "work_order": "135\/1-2017",
            "in_progress": false,
            "manholes": [
                {
                    "manhole_id": 54,
                    "name": "Gare du Nord"
                },
                {
                    "manhole_id": 70,
                    "name": "Gare Montparnasse"
                },
                {
                    "manhole_id": 3463,
                    "name": "Gare Saint-Lazare"
                }
            ],
            "terminated": true,
            "zones": [
                1
            ],
            "date": {
                "from": 1539068400,
                "to": 1539093600
            }
        },
        {
            "authorization_id": 4,
            "approved_at": 1539066024,
            "rejected_at": null,
            "cancelled_at": null,
            "requested_at": 1539066024,
            "request_comment": null,
            "name": "Dozvola_ulaska_4_09.10.18",
            "user_requested": "Dr. Dennis Powlowski DDS",
            "user_apporoved": "Dr. Dennis Powlowski DDS",
            "user_rejected": null,
            "user_cancelled": null,
            "work_order": null,
            "in_progress": false,
            "manholes": [
                {
                    "manhole_id": 1,
                    "name": "Gare du Nord"
                },
                {
                    "manhole_id": 2,
                    "name": "Gare Montparnasse"
                }
            ],
            "terminated": true,
            "zones": [
                1
            ],
            "date": {
                "from": 1539066120,
                "to": 1539094980
            }
        },
        {
            "authorization_id": 5,
            "approved_at": 1539067819,
            "rejected_at": null,
            "cancelled_at": null,
            "requested_at": 1539067819,
            "request_comment": null,
            "name": "Dozvola_ulaska_5_09.10.18",
            "user_requested": "Mohammed Pfannerstill III",
            "user_apporoved": "Wallace Fahey",
            "user_rejected": null,
            "user_cancelled": null,
            "work_order": null,
            "in_progress": false,
            "manholes": [
                {
                    "manhole_id": 8,
                    "name": "Gare Saint-Lazare"
                },
                {
                    "manhole_id": 10,
                    "name": "Gare Montparnasse"
                },
                {
                    "manhole_id": 80,
                    "name": "Gare du Nord"
                }
            ],
            "terminated": true,
            "zones": [
                3
            ],
            "date": {
                "from": 1539068400,
                "to": 1539093600
            }
        },
        {
            "authorization_id": 7,
            "approved_at": 1539070478,
            "rejected_at": null,
            "cancelled_at": null,
            "requested_at": 1539070478,
            "request_comment": null,
            "name": "Dozvola_ulaska_7_09.10.18",
            "user_requested": "Wallace Fahey",
            "user_apporoved": "Mohammed Pfannerstill III",
            "user_rejected": null,
            "user_cancelled": null,
            "work_order": null,
            "in_progress": false,
            "manholes": [
                {
                    "manhole_id": 8,
                    "name": "Gare Saint-Lazare"
                },
                {
                    "manhole_id": 10,
                    "name": "Gare Montparnasse"
                },
                {
                    "manhole_id": 80,
                    "name": "Gare du Nord"
                }
            ],
            "terminated": true,
            "zones": [
                1
            ],
            "date": {
                "from": 1539070380,
                "to": 1539092040
            }
        }
    ],
    "links": {
        "first": "http:\/\/example.bitgear.rs\/ws\/authorization-list?page=1",
        "last": "http:\/\/example.bitgear.rs\/ws\/authorization-list?page=218",
        "prev": null,
        "next": "http:\/\/example.bitgear.rs\/ws\/authorization-list?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 218,
        "path": "http:\/\/example.bitgear.rs\/ws\/authorization-list",
        "per_page": 10,
        "to": 15,
        "total": 3267
    }
}

HTTP Request

GET ws/authorization-list

Filtered authorization


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/authorization-list/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/authorization-list/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/authorization-list/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/authorization-list/1'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "authorization_id": 4,
    "approved_at": 1539066024,
    "rejected_at": null,
    "cancelled_at": null,
    "requested_at": 1539066024,
    "request_comment": null,
    "name": "Dozvola_ulaska_4_09.10.18",
    "user_requested": "Trudie Hilll",
    "user_apporoved": "Taurean Batz",
    "user_rejected": null,
    "user_cancelled": null,
    "work_order": null,
    "in_progress": false,
    "manholes": [
        {
            "manhole_id": 1,
            "name": "Gare du Nord"
        },
        {
            "manhole_id": 2,
            "name": "Gare Montparnasse"
        }
    ],
    "terminated": true,
    "zones": [
        1
    ],
    "date": {
        "from": 1539066120,
        "to": 1539094980
    }
}

HTTP Request

GET ws/authorization-list/{authorization_id}

URL Parameters

Parameter Status Description
authorization_id required It represents the authorization_id id.

Create authorization request


Requires authentication

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/authorization-request" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}" \
    -d '{"date":"{\"from\": 1539066120, \"to\": 1539094980}","manhole_ids":"[13818, 13819]","request_comment":"sed","work_order":"quod"}'
const url = new URL(
    "https://example.bitgear.rs/ws/authorization-request"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

let body = {
    "date": "{\"from\": 1539066120, \"to\": 1539094980}",
    "manhole_ids": "[13818, 13819]",
    "request_comment": "sed",
    "work_order": "quod"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/authorization-request',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
        'json' => [
            'date' => '{"from": 1539066120, "to": 1539094980}',
            'manhole_ids' => '[13818, 13819]',
            'request_comment' => 'sed',
            'work_order' => 'quod',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/authorization-request'
payload = {
    "date": "{\"from\": 1539066120, \"to\": 1539094980}",
    "manhole_ids": "[13818, 13819]",
    "request_comment": "sed",
    "work_order": "quod"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "authorization_id": 4,
    "approved_at": 1539066024,
    "rejected_at": null,
    "cancelled_at": null,
    "requested_at": 1539066024,
    "request_comment": null,
    "name": "Dozvola_ulaska_4_09.10.18",
    "user_requested": "Trudie Hilll",
    "user_apporoved": "Taurean Batz",
    "user_rejected": null,
    "user_cancelled": null,
    "work_order": null,
    "in_progress": false,
    "manholes": [
        {
            "manhole_id": 1,
            "name": "Gare du Nord"
        },
        {
            "manhole_id": 2,
            "name": "Gare Montparnasse"
        }
    ],
    "terminated": true,
    "zones": [
        1
    ],
    "date": {
        "from": 1539066120,
        "to": 1539094980
    }
}

HTTP Request

POST ws/authorization-request

Body Parameters

Parameter Type Status Description
date object required Object with two params from (timestamp from when authorization starts) and to (timestamp when authorization ends)
manhole_ids array required Array of manhole ids
request_comment string optional Comment about authorization request
work_order string optional Order for working in manhole

Reject authorization request


Requires authentication

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/authorization-request/reject" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}" \
    -d '{"authorization_id":20,"reject_comment":"libero"}'
const url = new URL(
    "https://example.bitgear.rs/ws/authorization-request/reject"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

let body = {
    "authorization_id": 20,
    "reject_comment": "libero"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/authorization-request/reject',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
        'json' => [
            'authorization_id' => 20,
            'reject_comment' => 'libero',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/authorization-request/reject'
payload = {
    "authorization_id": 20,
    "reject_comment": "libero"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "authorization_id": 4,
    "approved_at": 1539066024,
    "rejected_at": null,
    "cancelled_at": null,
    "requested_at": 1539066024,
    "request_comment": null,
    "name": "Dozvola_ulaska_4_09.10.18",
    "user_requested": "Trudie Hilll",
    "user_apporoved": "Taurean Batz",
    "user_rejected": null,
    "user_cancelled": null,
    "work_order": null,
    "in_progress": false,
    "manholes": [
        {
            "manhole_id": 1,
            "name": "Gare du Nord"
        },
        {
            "manhole_id": 2,
            "name": "Gare Montparnasse"
        }
    ],
    "terminated": true,
    "zones": [
        1
    ],
    "date": {
        "from": 1539066120,
        "to": 1539094980
    }
}

HTTP Request

POST ws/authorization-request/reject

Body Parameters

Parameter Type Status Description
authorization_id integer required Id of authorization request
reject_comment string optional Comment of reason for rejecting

Cancel authorization request


Requires authentication

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/authorization-request/cancel" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}" \
    -d '{"authorization_id":14}'
const url = new URL(
    "https://example.bitgear.rs/ws/authorization-request/cancel"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

let body = {
    "authorization_id": 14
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/authorization-request/cancel',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
        'json' => [
            'authorization_id' => 14,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/authorization-request/cancel'
payload = {
    "authorization_id": 14
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "authorization_id": 4,
    "approved_at": 1539066024,
    "rejected_at": null,
    "cancelled_at": null,
    "requested_at": 1539066024,
    "request_comment": null,
    "name": "Dozvola_ulaska_4_09.10.18",
    "user_requested": "Trudie Hilll",
    "user_apporoved": "Taurean Batz",
    "user_rejected": null,
    "user_cancelled": null,
    "work_order": null,
    "in_progress": false,
    "manholes": [
        {
            "manhole_id": 1,
            "name": "Gare du Nord"
        },
        {
            "manhole_id": 2,
            "name": "Gare Montparnasse"
        }
    ],
    "terminated": true,
    "zones": [
        1
    ],
    "date": {
        "from": 1539066120,
        "to": 1539094980
    }
}

HTTP Request

POST ws/authorization-request/cancel

Body Parameters

Parameter Type Status Description
authorization_id integer required Id of authorization request

Approve authorization request


Requires authentication

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/authorization-request/approve" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}" \
    -d '{"authorization_id":20}'
const url = new URL(
    "https://example.bitgear.rs/ws/authorization-request/approve"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

let body = {
    "authorization_id": 20
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/authorization-request/approve',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
        'json' => [
            'authorization_id' => 20,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/authorization-request/approve'
payload = {
    "authorization_id": 20
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "authorization_id": 4,
    "approved_at": 1539066024,
    "rejected_at": null,
    "cancelled_at": null,
    "requested_at": 1539066024,
    "request_comment": null,
    "name": "Dozvola_ulaska_4_09.10.18",
    "user_requested": "Trudie Hilll",
    "user_apporoved": "Taurean Batz",
    "user_rejected": null,
    "user_cancelled": null,
    "work_order": null,
    "in_progress": false,
    "manholes": [
        {
            "manhole_id": 1,
            "name": "Gare du Nord"
        },
        {
            "manhole_id": 2,
            "name": "Gare Montparnasse"
        }
    ],
    "terminated": true,
    "zones": [
        1
    ],
    "date": {
        "from": 1539066120,
        "to": 1539094980
    }
}

HTTP Request

POST ws/authorization-request/approve

Body Parameters

Parameter Type Status Description
authorization_id integer required Id of authorization request

Devices

API for reading device statuses

List of devices


Requires authentication The following properties in json response are expressed in units:

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/device" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/device"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/device',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/device'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "device_id": "MMD0000000001",
            "deveui": "0000000000000001",
            "fwv": "V1.11.0",
            "heartbeat_period": 3600,
            "lost_heartbeat_counter": 70,
            "last_uplink_message_received_at": 1575987426,
            "battery": {
                "value": 3.66,
                "updated_at": 1575987426
            },
            "humidity": {
                "value": 31,
                "updated_at": 1575971179
            },
            "temperature": {
                "value": 24,
                "updated_at": 1575971179
            },
            "manhole": {
                "manhole_id": 1,
                "name": "Gare du Nord"
            },
            "masking": false,
            "sensor_selection": {
                "temp_enable": true,
                "humidity_enable": true,
                "magnetometer_enable": false,
                "accelerometer_enable": true,
                "oop_enable": true,
                "als_hi_enable": true,
                "prox_enable": true,
                "als_enable": false
            },
            "sensor_health": {
                "ambient_light": true,
                "proximity": true,
                "masking": true,
                "force": true,
                "temperature": true,
                "humidity": true
            },
            "last_message_radio_quality": {
                "rssi": -59,
                "snr": 9.8,
                "sf": 7,
                "adr": null,
                "gwid": "24E124FFFFF0390C",
                "gwcnt": 4,
                "updated_at": 1575987426
            }
        },
        {
            "device_id": "MMD0000000002",
            "deveui": "0000000000000002",
            "fwv": "V1.9.3",
            "heartbeat_period": 1200,
            "lost_heartbeat_counter": 209,
            "last_uplink_message_received_at": 1575988053,
            "battery": {
                "value": 3.66,
                "updated_at": 1520557107
            },
            "humidity": {
                "value": 30,
                "updated_at": 1520552177
            },
            "temperature": {
                "value": 23,
                "updated_at": 1520552177
            },
            "manhole": {
                "manhole_id": 2,
                "name": "Gare Montparnasse"
            },
            "masking": false,
            "sensor_selection": {
                "temp_enable": true,
                "humidity_enable": true,
                "magnetometer_enable": false,
                "accelerometer_enable": true,
                "oop_enable": true,
                "als_hi_enable": true,
                "prox_enable": true,
                "als_enable": false
            },
            "sensor_health": {
                "ambient_light": true,
                "proximity": true,
                "masking": true,
                "force": true,
                "temperature": true,
                "humidity": true
            },
            "last_message_radio_quality": {
                "rssi": -48,
                "snr": 8.8,
                "sf": 7,
                "adr": null,
                "gwid": "24E124FFFFF03F48",
                "gwcnt": 2,
                "updated_at": 1575988053
            }
        },
        {
            "device_id": "MMD0000000003",
            "deveui": "0000000000000003",
            "fwv": "V1.9.1",
            "heartbeat_period": 1200,
            "lost_heartbeat_counter": 209,
            "last_uplink_message_received_at": 1575988160,
            "battery": {
                "value": 3.53,
                "updated_at": 1544214834
            },
            "humidity": {
                "value": 38,
                "updated_at": 1544211909
            },
            "temperature": {
                "value": 21,
                "updated_at": 1544211909
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "masking": null,
            "sensor_selection": {
                "temp_enable": true,
                "humidity_enable": true,
                "magnetometer_enable": false,
                "accelerometer_enable": true,
                "oop_enable": true,
                "als_hi_enable": true,
                "prox_enable": true,
                "als_enable": false
            },
            "sensor_health": {
                "ambient_light": true,
                "proximity": true,
                "masking": true,
                "force": true,
                "temperature": true,
                "humidity": true
            },
            "last_message_radio_quality": {
                "rssi": -107,
                "snr": 3.25,
                "sf": 12,
                "adr": null,
                "gwid": "000004C1",
                "gwcnt": 1,
                "updated_at": 1575988160
            }
        }
    ],
    "links": {
        "first": "https:\/\/example.bitgear.rs\/ws\/device?page=1",
        "last": "https:\/\/example.bitgear.rs\/ws\/device?page=2",
        "prev": null,
        "next": "https:\/\/example.bitgear.rs\/ws\/device?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "path": "https:\/\/example.bitgear.rs\/ws\/device",
        "per_page": 3,
        "to": 3,
        "total": 4
    }
}

HTTP Request

GET ws/device

Filtered device


Requires authentication The following properties in json response are expressed in units:

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/device/MMD0000000000" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/device/MMD0000000000"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/device/MMD0000000000',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/device/MMD0000000000'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "device_id": "MMD0000000000",
    "deveui": "0000000000000000",
    "fwv": "V1.11.0",
    "heartbeat_period": 3600,
    "lost_heartbeat_counter": 70,
    "last_uplink_message_received_at": 1575987426,
    "battery": {
        "value": 3.66,
        "updated_at": 1575987426
    },
    "humidity": {
        "value": 31,
        "updated_at": 1575971179
    },
    "temperature": {
        "value": 24,
        "updated_at": 1575971179
    },
    "manhole": {
        "manhole_id": 1,
        "name": "Gare du Nord"
    },
    "masking": false,
    "sensor_selection": {
        "temp_enable": true,
        "humidity_enable": true,
        "magnetometer_enable": false,
        "accelerometer_enable": true,
        "oop_enable": true,
        "als_hi_enable": true,
        "prox_enable": true,
        "als_enable": false
    },
    "sensor_health": {
        "ambient_light": true,
        "proximity": true,
        "masking": true,
        "force": true,
        "temperature": true,
        "humidity": true
    },
    "last_message_radio_quality": {
        "rssi": -59,
        "snr": 9.8,
        "sf": 7,
        "adr": null,
        "gwid": "24E124FFFFF0390C",
        "gwcnt": 4,
        "updated_at": 1575987426
    }
}

HTTP Request

GET ws/device/{device_id}

URL Parameters

Parameter Status Description
device_id required It represents device id

Filtered events by params


Requires authentication

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/device" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}" \
    -d '{"zone_ids":"[1, 2]","manhole_ids":"[1, 2]","heartbeat_period":3600,"fwv":"\"V1.11.0\"","battery":3.66,"masking":false,"adr":true}'
const url = new URL(
    "https://example.bitgear.rs/ws/device"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

let body = {
    "zone_ids": "[1, 2]",
    "manhole_ids": "[1, 2]",
    "heartbeat_period": 3600,
    "fwv": "\"V1.11.0\"",
    "battery": 3.66,
    "masking": false,
    "adr": true
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/device',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
        'json' => [
            'zone_ids' => '[1, 2]',
            'manhole_ids' => '[1, 2]',
            'heartbeat_period' => 3600,
            'fwv' => '"V1.11.0"',
            'battery' => 3.66,
            'masking' => false,
            'adr' => true,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/device'
payload = {
    "zone_ids": "[1, 2]",
    "manhole_ids": "[1, 2]",
    "heartbeat_period": 3600,
    "fwv": "\"V1.11.0\"",
    "battery": 3.66,
    "masking": false,
    "adr": true
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "data": [
        {
            "device_id": "MMD0000000001",
            "deveui": "0000000000000001",
            "fwv": "V1.11.0",
            "heartbeat_period": 3600,
            "lost_heartbeat_counter": 70,
            "last_uplink_message_received_at": 1575987426,
            "battery": {
                "value": 3.66,
                "updated_at": 1575987426
            },
            "humidity": {
                "value": 31,
                "updated_at": 1575971179
            },
            "temperature": {
                "value": 24,
                "updated_at": 1575971179
            },
            "manhole": {
                "manhole_id": 1,
                "name": "Gare du Nord"
            },
            "masking": false,
            "sensor_selection": {
                "temp_enable": true,
                "humidity_enable": true,
                "magnetometer_enable": false,
                "accelerometer_enable": true,
                "oop_enable": true,
                "als_hi_enable": true,
                "prox_enable": true,
                "als_enable": false
            },
            "sensor_health": {
                "ambient_light": true,
                "proximity": true,
                "masking": true,
                "force": true,
                "temperature": true,
                "humidity": true
            },
            "last_message_radio_quality": {
                "rssi": -59,
                "snr": 9.8,
                "sf": 7,
                "adr": null,
                "gwid": "24E124FFFFF0390C",
                "gwcnt": 4,
                "updated_at": 1575987426
            }
        },
        {
            "device_id": "MMD0000000002",
            "deveui": "0000000000000002",
            "fwv": "V1.9.3",
            "heartbeat_period": 1200,
            "lost_heartbeat_counter": 209,
            "last_uplink_message_received_at": 1575988053,
            "battery": {
                "value": 3.66,
                "updated_at": 1520557107
            },
            "humidity": {
                "value": 30,
                "updated_at": 1520552177
            },
            "temperature": {
                "value": 23,
                "updated_at": 1520552177
            },
            "manhole": {
                "manhole_id": 2,
                "name": "Gare Montparnasse"
            },
            "masking": false,
            "sensor_selection": {
                "temp_enable": true,
                "humidity_enable": true,
                "magnetometer_enable": false,
                "accelerometer_enable": true,
                "oop_enable": true,
                "als_hi_enable": true,
                "prox_enable": true,
                "als_enable": false
            },
            "sensor_health": {
                "ambient_light": true,
                "proximity": true,
                "masking": true,
                "force": true,
                "temperature": true,
                "humidity": true
            },
            "last_message_radio_quality": {
                "rssi": -48,
                "snr": 8.8,
                "sf": 7,
                "adr": null,
                "gwid": "24E124FFFFF03F48",
                "gwcnt": 2,
                "updated_at": 1575988053
            }
        },
        {
            "device_id": "MMD0000000003",
            "deveui": "0000000000000003",
            "fwv": "V1.9.1",
            "heartbeat_period": 1200,
            "lost_heartbeat_counter": 209,
            "last_uplink_message_received_at": 1575988160,
            "battery": {
                "value": 3.53,
                "updated_at": 1544214834
            },
            "humidity": {
                "value": 38,
                "updated_at": 1544211909
            },
            "temperature": {
                "value": 21,
                "updated_at": 1544211909
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "masking": null,
            "sensor_selection": {
                "temp_enable": true,
                "humidity_enable": true,
                "magnetometer_enable": false,
                "accelerometer_enable": true,
                "oop_enable": true,
                "als_hi_enable": true,
                "prox_enable": true,
                "als_enable": false
            },
            "sensor_health": {
                "ambient_light": true,
                "proximity": true,
                "masking": true,
                "force": true,
                "temperature": true,
                "humidity": true
            },
            "last_message_radio_quality": {
                "rssi": -107,
                "snr": 3.25,
                "sf": 12,
                "adr": null,
                "gwid": "000004C1",
                "gwcnt": 1,
                "updated_at": 1575988160
            }
        }
    ],
    "links": {
        "first": "https:\/\/example.bitgear.rs\/ws\/device?page=1",
        "last": "https:\/\/example.bitgear.rs\/ws\/device?page=2",
        "prev": null,
        "next": "https:\/\/example.bitgear.rs\/ws\/device?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2,
        "path": "https:\/\/example.bitgear.rs\/ws\/device",
        "per_page": 3,
        "to": 3,
        "total": 4
    }
}

HTTP Request

POST ws/device

Body Parameters

Parameter Type Status Description
zone_ids array optional It represents array of zone id
manhole_ids array optional It represents array of manhole id
heartbeat_period integer optional It represents heartbeat period of device
fwv string optional It represents firmware version of device
battery float optional It represents maximum battery value of device
masking boolean optional It represents masking flag
adr boolean optional It represents adr on/off

Event history

List of events


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/event-history" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/event-history"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/event-history',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/event-history'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "event_id": 396031,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1405013766",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 1,
                "name": "Gare du Nord"
            },
            "created_at": 1575999482
        },
        {
            "event_id": 396004,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1405013746",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 65,
                "name": "Gare de Pont-Cardinet"
            },
            "created_at": 1575993002
        },
        {
            "event_id": 396002,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575993001
        },
        {
            "event_id": 395997,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1203008768",
                "fwv": "V1.9.3"
            },
            "manhole": {
                "manhole_id": 2,
                "name": "Gare Montparnasse"
            },
            "created_at": 1575992882
        },
        {
            "event_id": 395993,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1405013766",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 1,
                "name": "Gare du Nord"
            },
            "created_at": 1575992282
        },
        {
            "event_id": 395971,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1405013746",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 65,
                "name": "Gare de Pont-Cardinet"
            },
            "created_at": 1575990603
        },
        {
            "event_id": 395970,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575990602
        },
        {
            "event_id": 395965,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1203008768",
                "fwv": "V1.9.3"
            },
            "manhole": {
                "manhole_id": 2,
                "name": "Gare Montparnasse"
            },
            "created_at": 1575990481
        },
        {
            "event_id": 395603,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973171
        },
        {
            "event_id": 395601,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973057
        },
        {
            "event_id": 395600,
            "event_name": "Lid opening detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973057
        },
        {
            "event_id": 395599,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973023
        },
        {
            "event_id": 395598,
            "event_name": "Lid opening detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973023
        },
        {
            "event_id": 395596,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575972908
        },
        {
            "event_id": 395595,
            "event_name": "Lid opening detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575972908
        }
    ],
    "links": {
        "first": "https:\/\/example.bitgear.rs\/ws\/event-history?page=1",
        "last": "https:\/\/example.bitgear.rs\/ws\/event-history?page=2963",
        "prev": null,
        "next": "https:\/\/example.bitgear.rs\/ws\/event-history?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2963,
        "path": "https:\/\/example.bitgear.rs\/ws\/event-history",
        "per_page": 15,
        "to": 15,
        "total": 44435
    }
}

HTTP Request

GET ws/event-history

Filtered event


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/event-history/396037" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/event-history/396037"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/event-history/396037',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/event-history/396037'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "event_id": 396037,
    "event_name": "No 3 heartbeat messages",
    "event_type": 12,
    "device": {
        "device_id": "MMD0000000001",
        "fwv": "V1.11.0"
    },
    "manhole": {
        "manhole_id": 4,
        "name": "Gare de Lyon"
    },
    "created_at": 1576017601
}

HTTP Request

GET ws/event-history/{event_id}

URL Parameters

Parameter Status Description
event_id required It represents the event history id.

Filtered events by params


Requires authentication

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/event-history" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}" \
    -d '{"manhole_ids":"[1, 2]","device_ids":"[1, 2, 3]","event_types":"[14]","date":"['2019-04-24 08:20:00', '2019-04-24 08:36:00']"}'
const url = new URL(
    "https://example.bitgear.rs/ws/event-history"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

let body = {
    "manhole_ids": "[1, 2]",
    "device_ids": "[1, 2, 3]",
    "event_types": "[14]",
    "date": "['2019-04-24 08:20:00', '2019-04-24 08:36:00']"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/event-history',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
        'json' => [
            'manhole_ids' => '[1, 2]',
            'device_ids' => '[1, 2, 3]',
            'event_types' => '[14]',
            'date' => '[\'2019-04-24 08:20:00\', \'2019-04-24 08:36:00\']',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/event-history'
payload = {
    "manhole_ids": "[1, 2]",
    "device_ids": "[1, 2, 3]",
    "event_types": "[14]",
    "date": "['2019-04-24 08:20:00', '2019-04-24 08:36:00']"
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "data": [
        {
            "event_id": 396031,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1405013766",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 1,
                "name": "Gare du Nord"
            },
            "created_at": 1575999482
        },
        {
            "event_id": 396004,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1405013746",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 65,
                "name": "Gare de Pont-Cardinet"
            },
            "created_at": 1575993002
        },
        {
            "event_id": 396002,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575993001
        },
        {
            "event_id": 395997,
            "event_name": "No 3 heartbeat messages",
            "event_type": 12,
            "device": {
                "device_id": "MMD1203008768",
                "fwv": "V1.9.3"
            },
            "manhole": {
                "manhole_id": 2,
                "name": "Gare Montparnasse"
            },
            "created_at": 1575992882
        },
        {
            "event_id": 395993,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1405013766",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 1,
                "name": "Gare du Nord"
            },
            "created_at": 1575992282
        },
        {
            "event_id": 395971,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1405013746",
                "fwv": "V1.11.0"
            },
            "manhole": {
                "manhole_id": 65,
                "name": "Gare de Pont-Cardinet"
            },
            "created_at": 1575990603
        },
        {
            "event_id": 395970,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575990602
        },
        {
            "event_id": 395965,
            "event_name": "No heartbeat message",
            "event_type": 11,
            "device": {
                "device_id": "MMD1203008768",
                "fwv": "V1.9.3"
            },
            "manhole": {
                "manhole_id": 2,
                "name": "Gare Montparnasse"
            },
            "created_at": 1575990481
        },
        {
            "event_id": 395603,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973171
        },
        {
            "event_id": 395601,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973057
        },
        {
            "event_id": 395600,
            "event_name": "Lid opening detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973057
        },
        {
            "event_id": 395599,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973023
        },
        {
            "event_id": 395598,
            "event_name": "Lid opening detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575973023
        },
        {
            "event_id": 395596,
            "event_name": "Lid closing detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575972908
        },
        {
            "event_id": 395595,
            "event_name": "Lid opening detected",
            "event_type": 39,
            "device": {
                "device_id": "MMD1102002766",
                "fwv": "V1.9.1"
            },
            "manhole": {
                "manhole_id": 3,
                "name": "Gare Saint-Lazare"
            },
            "created_at": 1575972908
        }
    ],
    "links": {
        "first": "https:\/\/example.bitgear.rs\/ws\/event-history?page=1",
        "last": "https:\/\/example.bitgear.rs\/ws\/event-history?page=2963",
        "prev": null,
        "next": "https:\/\/example.bitgear.rs\/ws\/event-history?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 2963,
        "path": "https:\/\/example.bitgear.rs\/ws\/event-history",
        "per_page": 15,
        "to": 15,
        "total": 44435
    }
}

HTTP Request

POST ws/event-history

Body Parameters

Parameter Type Status Description
manhole_ids array optional It represents array of manhole id
device_ids array optional It represents array of device id
event_types array optional It represents array of event type
date array optional It represents start and end date

Manholes

List of manholes


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/manhole" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/manhole"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/manhole',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/manhole'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "manhole_id": 1,
            "name": "Gare du Nord",
            "address": "Rue de Maubeuge 112, 10th arrondissement, Paris",
            "latitude": 48.8809,
            "longitude": 2.3553,
            "description": "The Gare du Nord (North Station), officially Paris-Nord, is one of the six large terminus stations of the SNCF mainline network for Paris, France.",
            "device_capacity": 1,
            "used_capacity": 1,
            "zone": {
                "zone_id": 1,
                "name": "Zone 1"
            },
            "devices": [
                {
                    "device_id": "MMD0000000001",
                    "fwv": "V1.11.0"
                }
            ],
            "lid_open": false,
            "presence": false,
            "last_event": {
                "event_id": 396031,
                "name": "No 3 heartbeat messages",
                "created_at": 1575999482
            }
        },
        {
            "manhole_id": 2,
            "name": "Gare Montparnasse",
            "address": "Place Raoul-Dautry 0, 14th arrondissement, Paris",
            "latitude": 48.84,
            "longitude": 2.318611,
            "description": "The Gare Montparnasse (Montparnasse Station), officially Paris-Montparnasse, is one of the six large Paris railway termini.",
            "device_capacity": 1,
            "used_capacity": 1,
            "zone": {
                "zone_id": 1,
                "name": "Zone 1"
            },
            "devices": [
                {
                    "device_id": "MMD0000000002",
                    "fwv": "V1.9.3"
                }
            ],
            "lid_open": false,
            "presence": false,
            "last_event": {
                "event_id": 395997,
                "name": "No 3 heartbeat messages",
                "created_at": 1575992882
            }
        },
        {
            "manhole_id": 3,
            "name": "Gare Saint-Lazare",
            "address": "Rue Saint-Lazare 0, 8th arrondissement, Paris",
            "latitude": 48.87614,
            "longitude": 2.325363,
            "description": "The Gare Saint-Lazare (St Lazarus Station), officially Paris-Saint-Lazare, is one of the six large terminus railway stations of Paris.",
            "device_capacity": 1,
            "used_capacity": 1,
            "zone": {
                "zone_id": 1,
                "name": "Zone 1"
            },
            "devices": [
                {
                    "device_id": "MMD0000000003",
                    "fwv": "V1.9.1"
                }
            ],
            "lid_open": false,
            "presence": false,
            "last_event": {
                "event_id": 396002,
                "name": "No 3 heartbeat messages",
                "created_at": 1575993001
            }
        }
    ],
    "links": {
        "first": "https:\/\/example.bitgear.rs\/ws\/manhole?page=1",
        "last": "https:\/\/example.bitgear.rs\/ws\/manhole?page=3",
        "prev": null,
        "next": "https:\/\/example.bitgear.rs\/ws\/manhole?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 3,
        "path": "https:\/\/example.bitgear.rs\/ws\/manhole",
        "per_page": 3,
        "to": 3,
        "total": 8
    }
}

HTTP Request

GET ws/manhole

Filtered manhole


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/manhole/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/manhole/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/manhole/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/manhole/1'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "manhole_id": 1,
    "name": "Gare du Nord",
    "address": "Rue de Maubeuge 112, 10th arrondissement, Paris",
    "latitude": 48.8809,
    "longitude": 2.3553,
    "description": "The Gare du Nord (North Station), officially Paris-Nord, is one of the six large terminus stations of the SNCF mainline network for Paris, France.",
    "device_capacity": 1,
    "used_capacity": 1,
    "zone": {
        "zone_id": 1,
        "name": "Zone 1"
    },
    "devices": [
        {
            "device_id": "MMD0000000000",
            "fwv": "V1.11.0"
        }
    ],
    "lid_open": null,
    "presence": null,
    "last_event": {
        "event_id": 396031,
        "name": "No 3 heartbeat messages",
        "created_at": 1575999482
    }
}

HTTP Request

GET ws/manhole/{manhole_id}

URL Parameters

Parameter Status Description
manhole_id required It represents the manhole id.

Filtered manholes by params


Requires authentication

Example request:

curl -X POST \
    "https://example.bitgear.rs/ws/manhole" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}" \
    -d '{"zone_ids":"[1, 2]","with_device":true,"lid_open":true,"presence":false}'
const url = new URL(
    "https://example.bitgear.rs/ws/manhole"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

let body = {
    "zone_ids": "[1, 2]",
    "with_device": true,
    "lid_open": true,
    "presence": false
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->post(
    'https://example.bitgear.rs/ws/manhole',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
        'json' => [
            'zone_ids' => '[1, 2]',
            'with_device' => true,
            'lid_open' => true,
            'presence' => false,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/manhole'
payload = {
    "zone_ids": "[1, 2]",
    "with_device": true,
    "lid_open": true,
    "presence": false
}
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()

Example response (200):

{
    "data": [
        {
            "manhole_id": 1,
            "name": "Gare du Nord",
            "address": "Rue de Maubeuge 112, 10th arrondissement, Paris",
            "latitude": 48.8809,
            "longitude": 2.3553,
            "description": "The Gare du Nord (North Station), officially Paris-Nord, is one of the six large terminus stations of the SNCF mainline network for Paris, France.",
            "device_capacity": 1,
            "used_capacity": 1,
            "zone": {
                "zone_id": 1,
                "name": "Zone 1"
            },
            "devices": [
                {
                    "device_id": "MMD0000000001",
                    "fwv": "V1.11.0"
                }
            ],
            "lid_open": false,
            "presence": false,
            "last_event": {
                "event_id": 396031,
                "name": "No 3 heartbeat messages",
                "created_at": 1575999482
            }
        },
        {
            "manhole_id": 2,
            "name": "Gare Montparnasse",
            "address": "Place Raoul-Dautry 0, 14th arrondissement, Paris",
            "latitude": 48.84,
            "longitude": 2.318611,
            "description": "The Gare Montparnasse (Montparnasse Station), officially Paris-Montparnasse, is one of the six large Paris railway termini.",
            "device_capacity": 1,
            "used_capacity": 1,
            "zone": {
                "zone_id": 1,
                "name": "Zone 1"
            },
            "devices": [
                {
                    "device_id": "MMD0000000002",
                    "fwv": "V1.9.3"
                }
            ],
            "lid_open": false,
            "presence": false,
            "last_event": {
                "event_id": 395997,
                "name": "No 3 heartbeat messages",
                "created_at": 1575992882
            }
        },
        {
            "manhole_id": 3,
            "name": "Gare Saint-Lazare",
            "address": "Rue Saint-Lazare 0, 8th arrondissement, Paris",
            "latitude": 48.87614,
            "longitude": 2.325363,
            "description": "The Gare Saint-Lazare (St Lazarus Station), officially Paris-Saint-Lazare, is one of the six large terminus railway stations of Paris.",
            "device_capacity": 1,
            "used_capacity": 1,
            "zone": {
                "zone_id": 1,
                "name": "Zone 1"
            },
            "devices": [
                {
                    "device_id": "MMD0000000003",
                    "fwv": "V1.9.1"
                }
            ],
            "lid_open": false,
            "presence": false,
            "last_event": {
                "event_id": 396002,
                "name": "No 3 heartbeat messages",
                "created_at": 1575993001
            }
        }
    ],
    "links": {
        "first": "https:\/\/example.bitgear.rs\/ws\/manhole?page=1",
        "last": "https:\/\/example.bitgear.rs\/ws\/manhole?page=3",
        "prev": null,
        "next": "https:\/\/example.bitgear.rs\/ws\/manhole?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 3,
        "path": "https:\/\/example.bitgear.rs\/ws\/manhole",
        "per_page": 3,
        "to": 3,
        "total": 8
    }
}

HTTP Request

POST ws/manhole

Body Parameters

Parameter Type Status Description
zone_ids array optional It represents array of zone id
with_device boolean optional true - search only manholes with devices; false - search only manholes without devices
lid_open boolean optional It represents lid_open flag
presence boolean optional It represents presence flag

Zones

List of zones


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/zone" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/zone"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/zone',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/zone'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "data": [
        {
            "zone_id": 1,
            "name": "Zone 1",
            "nw_lat": 48.887623,
            "nw_lng": 2.289216,
            "se_lat": 48.84,
            "se_lng": 2.3553,
            "manhole_cnt": 8
        },
        {
            "zone_id": 15,
            "name": "Zone 15",
            "nw_lat": 44.822417,
            "nw_lng": 20.415694,
            "se_lat": 44.821,
            "se_lng": 20.417,
            "manhole_cnt": 3
        }
    ],
    "links": {
        "first": "https:\/\/example.bitgear.rs\/ws\/zone?page=1",
        "last": null,
        "prev": null,
        "next": "https:\/\/example.bitgear.rs\/ws\/zone?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https:\/\/example.bitgear.rs\/ws\/zone",
        "per_page": 15,
        "to": 3
    }
}

HTTP Request

GET ws/zone

Filtered zone


Requires authentication

Example request:

curl -X GET \
    -G "https://example.bitgear.rs/ws/zone/1" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {$api_token}"
const url = new URL(
    "https://example.bitgear.rs/ws/zone/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {$api_token}",
};

fetch(url, {
    method: "GET",
    headers: headers,
})
    .then(response => response.json())
    .then(json => console.log(json));

$client = new \GuzzleHttp\Client();
$response = $client->get(
    'https://example.bitgear.rs/ws/zone/1',
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => 'Bearer {$api_token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json

url = 'https://example.bitgear.rs/ws/zone/1'
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'Authorization': 'Bearer {$api_token}'
}
response = requests.request('GET', url, headers=headers)
response.json()

Example response (200):

{
    "zone_id": 1,
    "name": "Zone 1",
    "nw_lat": 48.887623,
    "nw_lng": 2.289216,
    "se_lat": 48.84,
    "se_lng": 2.3553,
    "manhole_cnt": 8
}

HTTP Request

GET ws/zone/{zone_id}

URL Parameters

Parameter Status Description
zone_id required It represents the zone id.

Resources

Copyright © 2019 Bitgear Wireless Design Services. All rights reserved.