Tutorial
A valid OAuth v2 Bearer token is required. See Authentication for more details.
Managing base stations
Adding a base station
The examples in this section use the following values:
Required Information | Example |
---|---|
BS name | ACME BS 1 |
LRR UUID | 7076FF-024B0B030008 |
Serial Marketing Number | 9999-KE-9999-9999 |
Retrieving a base station model
A base station model ID is required to add a base station. You can retrieve a base station model by listing the existing base station models.
-
Execute the following REST request.
GET /thingpark/wireless/rest/partners/mine/bsProfiles HTTP/1.1
Authorization: Bearer ...
Accept: application/json
Cookie: JSESSIONID=gcn1wPKxdUPUW6yh8aPsAiwY.twa; GLOBALTWA=0 -
A
200 OK
response should be returned. Extract theID
of the selected base station model.HTTP/1.1 200 OK
Content-Type: application/json
{
"briefs": [
{
"commercialName": "Macro V1.5",
"vendor": {
"name": "Kerlink",
"commercialName": "Kerlink",
"commercialDescription": "Supplier of Internet of Things infrastructures deployments.",
"ID": "kerlink"
},
"ID": "KERL/WIR2.1",
"defaultIsmBands": [
{
"name": "EU 863-870MHz ISM Band",
"ID": "eu868"
},
{
"name": "US 902-928MHz ISM Band",
"ID": "us915"
}
]
},
...
],
"more": false
}
Adding the base station
-
Call the create base station operation. The following example uses the
ID
of the base station model retrieved in the previous task:POST /thingpark/wireless/rest/partners/mine/bss HTTP/1.1
Authorization: Bearer ...
Content-Type: application/json
Accept: application/json
Cookie: JSESSIONID=gcn1wPKxdUPUW6yh8aPsAiwY.twa; GLOBALTWA=0
{
"lrrUUID": "7076FF-024B0B030008",
"smn": "9999-KE-9999-9999",
"model": {
"ID": "KERL/IBTS.1"
},
"name": "ACME BS 1",
"bsSecurity": {
"type": "IPSEC_X509"
}
} -
A
201 Created
response should be returned.HTTP/1.1 201 Created
Location: /thingpark/wireless/rest/partners/139/bss/1222
Retrieving a RF region
The RF region of the base station must be configured. You can retrieve a RF region by listing the existing RF regions.
-
Execute the following REST request.
GET /thingpark/wireless/rest/partners/mine/rfRegions HTTP/1.1
Authorization: Bearer ...
Accept: application/json
Cookie: JSESSIONID=gcn1wPKxdUPUW6yh8aPsAiwY.twa; GLOBALTWA=0 -
A
200 OK
response should be returned. Extract theprovID
of the selected RF region.HTTP/1.1 200 OK
Content-Type: application/json
{
"briefs": [
{
"commercialName": "EU 863-870MHz (8 channels)",
"commercialDescription": "This 8-channels RF Region applies to any region where the use of the 863-870 MHz ISM radio spectrum is compliant with the ETSI EN300.220 standard.",
"commercialChangelog": "",
"provID": "EU868_8channels.172",
"version": 1,
"logo": "/thingpark/wireless/rest/resources/files/logo/rFRegion/172",
"href": "/thingpark/wireless/rest/partners/139/rfRegions/172"
},
...
],
"more": false
}
Configuring the base Station RF region
-
Call the update base station RF region operation. The following example uses the LRR UUID and the
provID
of the RF region retrieved in the previous task:POST /thingpark/wireless/rest/partners/mine/bss/u7076FF-024B0B030008/admins/updateRfRegion HTTP/1.1
Authorization: Bearer ...
Content-Type: application/json
Accept: application/json
Cookie: JSESSIONID=gcn1wPKxdUPUW6yh8aPsAiwY.twa; GLOBALTWA=0
{
"rfRegionID": "EU868_8channels.172"
} -
A
200 OK
response should be returned.HTTP/1.1 200 OK
Listing the base stations
-
Call the retrieve base stations operation.
GET /thingpark/wireless/rest/partners/mine/bss HTTP/1.1
Authorization: Bearer ...
Content-Type: application/json
Accept: application/json
Cookie: JSESSIONID=gcn1wPKxdUPUW6yh8aPsAiwY.twa; GLOBALTWA=0 -
Check your output with the response extract:
HTTP/1.1 200 OK
{
"briefs": [
{
"name": "ACME BS 1",
"model": {
"commercialName": "Macro V1.5",
"logo": "/thingpark/wireless/rest/resources/files/logo/baseStationProfile/5"
},
"lrrID": "",
"lrrUUID": "7076FF-024B0B030008",
"state": "ACTIVE",
...
"href": "/thingpark/wireless/rest/partners/139/bss/1222"
},
...
],
"more": false,
"now": 1556209037421
}
Getting base station details
The base station resource is retrieved using the base station's UUID.
GET /thingpark/wireless/rest/partners/mine/bss/u7076FF-024B0B030008 HTTP/1.1
Authorization: Bearer ...
Content-Type: application/json
Accept: application/json
Cookie: JSESSIONID=gcn1wPKxdUPUW6yh8aPsAiwY.twa; GLOBALTWA=0
Operation should return a 200 OK
response along with base station resource.
HTTP/1.1 200 OK
{
"now": 1556274131027,
"occContext": {
"version": 0,
"lastUpdate": 1546598395000,
"who": "John Doe"
},
"name": "ACME BS 1",
"lrrID": "10009534",
"lrrUUID": "7076FF-024B0B030008",
"identificationMode": "LRR_UUID",
"smn": "9999-KE-9999-9999",
"staticAddress": null,
"customerAdminData": null,
"state": "ACTIVE",
...
}
Base station uplink and downlink history
You can retrieve the last uplink and downlink frames of a base station.
Use the retrieve frames operation to get Base station's uplink and downlink history.
GET /thingpark/wireless/rest/partners/mine/bss/u7076FF-024B0B030008/frames HTTP/1.1
Authorization: Bearer ...
Content-Type: application/json
Accept: application/json
Cookie: JSESSIONID=gcn1wPKxdUPUW6yh8aPsAiwY.twa; GLOBALTWA=0
Operation should return a 200 OK
response along with base station's
uplink/downlink history. Traffic is aggregated in one hour steps.
HTTP/1.1 200 OK
{
"now": 1560257258301,
"briefs": [
{
"timestamp": 1559959200000,
"up": {
"count": 241,
"size": 5726,
"countOnTime": 241,
"sizeOnTime": 5726,
"countLate": 0,
"sizeLate": 0
},
"dw": {
"count": 3,
"size": 0,
"countSent": 3,
"sizeSent": 0,
"countFailed": 0,
"sizeFailed": 0
}
},
{
"timestamp": 1559970000000,
"up": {
"count": 239,
"size": 5664,
"countOnTime": 239,
"sizeOnTime": 5664,
"countLate": 0,
"sizeLate": 0
},
"dw": {
"count": 2,
"size": 0,
"countSent": 2,
"sizeSent": 0,
"countFailed": 0,
"sizeFailed": 0
}
},
...
]
}