# Gateways

Manage gateways in your account using this endpoint.

# List Gateway

Lists all gateways in the account

GET /gateways/?page={page}&search={search}&sortOrder={asc|desc}&itemsPerPage=10

Example request

$ curl https://console.radiobridge.com/api/visualization/v1/gateways/?page={page}&search={search}&sortOrder={asc|desc}&itemsPerPage=10

Example response

{
  "data": [
    {
      "id": 196,
      "name": "Dpk Multitech Gateway",
      "gateway_bridge": "lora_multitech",
      "gateway_ip": null,
      "gateway_eui": null,
      "bridge": "Multitech (For lora devices)",
      "uuid": "9e7c190f-84cf-11eb-9dfd-0acf3b849a0a",
      "created_at": "Nov 11, 2019 07:18 PM"
    }
  ],
  "payload": {
    "page": "1",
    "search": "",
    "gatewayEui": "",
    "sortOrder": "asc",
    "itemsPerPage": "10"
  },
  "links": {
    "first": "http:\/\/radiobridge.test\/api\/visualization\/v1\/gateways?page=1",
    "last": "http:\/\/radiobridge.test\/api\/visualization\/v1\/gateways?page=1",
    "prev": null,
    "next": null
  },
  "meta": {
    "current_page": 1,
    "from": 1,
    "last_page": 1,
    "links": [
      {
        "url": null,
        "label": "« Previous",
        "active": false
      },
      {
        "url": "http:\/\/radiobridge.test\/api\/visualization\/v1\/gateways?page=1",
        "label": "1",
        "active": true
      },
      {
        "url": null,
        "label": "Next »",
        "active": false
      }
    ],
    "path": "http:\/\/radiobridge.test\/api\/visualization\/v1\/gateways",
    "per_page": "10",
    "to": 7,
    "total": 7
  }
}

# Gateway Config

This endpoint retrieves the required config field values from backend based on selected network.

POST /gateways/create?gatewayType=thethingsnetwork
Property Description
gatewayType (required) thethingsnetwork, loriot, chirpstack, kerlink, lora_multitech, other, aws_iot_core

Example response

{
    "gatewayType": "thethingsnetwork",
    "page_name": "TTN Gateway",
    "zones": {
        "eu1": {
            "id": "eu1",
            "region": "Europe 1",
            "ns_address": "eu1.cloud.thethings.network",
            "as_address": "eu1.cloud.thethings.network",
            "js_address": "eu1.cloud.thethings.network",
            "is_address": "eu1.cloud.thethings.network",
            "app_id": "radiobridge-app-eu1"
        },
        "nam1": {
            "id": "nam1",
            "region": "Region America 1",
            "ns_address": "nam1.cloud.thethings.network",
            "as_address": "nam1.cloud.thethings.network",
            "js_address": "nam1.cloud.thethings.network",
            "is_address": "eu1.cloud.thethings.network",
            "app_id": "radiobridge-app-nam1"
        },
        "au1": {
            "id": "au1",
            "region": "Australia 1",
            "ns_address": "au1.cloud.thethings.network",
            "as_address": "au1.cloud.thethings.network",
            "js_address": "au1.cloud.thethings.network",
            "is_address": "eu1.cloud.thethings.network",
            "app_id": "radiobridge-app-aus1"
        }
    },
    "frequency_plans": [
        {
            "id": "EU_863_870",
            "name": "Europe 863-870 MHz (SF12 for RX2)",
            "base_frequency": 868
        },
        {
            "id": "EU_863_870_TTN",
            "base_id": "EU_863_870",
            "name": "Europe 863-870 MHz (SF9 for RX2 - recommended)",
            "base_frequency": 868
        },
        {
            "id": "EU_863_870_ROAMING_DRAFT",
            "base_id": "EU_863_870",
            "name": "Europe 863-870 MHz, 6 channels for roaming (Draft)",
            "base_frequency": 868
        },
        {
            "id": "EU_433",
            "name": "Europe 433 MHz (ITU region 1)",
            "base_frequency": 433
        },
        {
            "id": "US_902_928_FSB_1",
            "name": "United States 902-928 MHz, FSB 1",
            "base_frequency": 915
        },
        {
            "id": "US_902_928_FSB_2",
            "name": "United States 902-928 MHz, FSB 2 (used by TTN)",
            "base_frequency": 915
        },
        {
            "id": "US_902_928_FSB_3",
            "name": "United States 902-928 MHz, FSB 3",
            "base_frequency": 915
        },
        {
            "id": "US_902_928_FSB_4",
            "name": "United States 902-928 MHz, FSB 4",
            "base_frequency": 915
        },
        {
            "id": "US_902_928_FSB_5",
            "name": "United States 902-928 MHz, FSB 5",
            "base_frequency": 915
        },
        {
            "id": "US_902_928_FSB_6",
            "name": "United States 902-928 MHz, FSB 6",
            "base_frequency": 915
        },
        {
            "id": "US_902_928_FSB_7",
            "name": "United States 902-928 MHz, FSB 7",
            "base_frequency": 915
        },
        {
            "id": "US_902_928_FSB_8",
            "name": "United States 902-928 MHz, FSB 8",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_1",
            "name": "Australia 915-928 MHz, FSB 1",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_2",
            "name": "Australia 915-928 MHz, FSB 2 (used by TTN)",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_3",
            "name": "Australia 915-928 MHz, FSB 3",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_4",
            "name": "Australia 915-928 MHz, FSB 4",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_5",
            "name": "Australia 915-928 MHz, FSB 5",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_6",
            "name": "Australia 915-928 MHz, FSB 6",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_7",
            "name": "Australia 915-928 MHz, FSB 7",
            "base_frequency": 915
        },
        {
            "id": "AU_915_928_FSB_8",
            "name": "Australia 915-928 MHz, FSB 8",
            "base_frequency": 915
        },
        {
            "id": "CN_470_510_FSB_11",
            "name": "China 470-510 MHz, FSB 11",
            "base_frequency": 470
        },
        {
            "id": "AS_920_923",
            "name": "Asia 920-923 MHz",
            "base_frequency": 915
        },
        {
            "id": "AS_920_923_LBT",
            "base_id": "AS_920_923",
            "name": "Asia 920-923 MHz with LBT",
            "base_frequency": 915
        },
        {
            "id": "AS_923",
            "name": "Asia 923 MHz with only default channels",
            "base_frequency": 915
        },
        {
            "id": "AS_923_925",
            "name": "Asia 923-925 MHz",
            "base_frequency": 915
        },
        {
            "id": "AS_923_925_LBT",
            "base_id": "AS_923_925",
            "name": "Asia 923-925 MHz with LBT",
            "base_frequency": 915
        },
        {
            "id": "AS_920_923_TTN_AU",
            "base_id": "AS_920_923",
            "name": "Asia 920-923 MHz (used by TTN Australia)",
            "base_frequency": 915
        },
        {
            "id": "AS_923_925_TTN_AU",
            "base_id": "AS_923_925",
            "name": "Asia 923-925 MHz (used by TTN Australia - secondary channels)",
            "base_frequency": 915
        },
        {
            "id": "KR_920_923_TTN",
            "name": "South Korea 920-923 MHz",
            "base_frequency": 915
        },
        {
            "id": "IN_865_867",
            "name": "India 865-867 MHz",
            "base_frequency": 868
        },
        {
            "id": "RU_864_870_TTN",
            "name": "Russia 864-870 MHz",
            "base_frequency": 868
        },
        {
            "id": "ISM_2400_3CH_DRAFT2",
            "name": "LoRa 2.4 GHz with 3 channels (Draft 2)",
            "base_frequency": 2450
        }
    ],
    "selected_gateway": "",
    "gateway_image": "http:\/\/radiobridge.test\/images\/thethingsnetwork.png",
    "description": "<p class=\"text-center\">The Things Network By RadioBridge<\/p>"
}

# Create Gateway

Creates a new gateway and register them to radiobridge network accounts (Depends on network).

POST  /gateways

Example request

curl --location --request POST 'https://console.radiobridge.com/api/visualization/v1/gateways' \
--header 'Organization: 1' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
  "gateway_name":"Deepak Gateway",
  "gateway_ip":"192.168.0.1",
  "gateway_eui":"012030FFFFACBDE",
  "gateway_bridge":"thethingsnetwork",
  "frequency_plan":"US_902_928_FSB_2",
  "zone_id":"nam1"
}'

Example request body

{
  "gateway_name":"Deepak Gateway",
  "gateway_ip":"192.168.0.1",
  "gateway_eui":"012030FFFFACBDE",
  "gateway_bridge":"thethingsnetwork",
  "frequency_plan":"US_902_928_FSB_2",
  "zone_id":"nam1"
}

Request body changes based on different network type.

Example response

{
  "status": true,
  "message": "Gateway has been registered successfully.",
  "gateway": {
    "id": 7,
    "user_id": 1,
    "gateway_name": "Deepak Gateway",
    "gateway_bridge": "thethingsnetwork",
    "register_status": "active",
    "error_msg": null,
    "config_json": null,
    "created_at": "2018-07-31T22:29:19.000000Z",
    "updated_at": "2018-08-01T00:37:18.000000Z",
    "uuid": "9e7bbcf2-84cf-11eb-9dfd-0acf3b849a0a",
    "gateway_ip": null,
    "gateway_eui": "ABCDEF0012345678",
    "user": "User {Object}"
  }
}

# Retrieve a Gateway

Retrieve information about a single Gateway.

GET /gateways/{gateway_id}

Example request

{
  "gateway": {
    "id": 7,
    "user_id": 1,
    "gateway_name": "Deepak's Stand Alone Multitech Gateway",
    "gateway_bridge": "lora_multitech",
    "register_status": "active",
    "error_msg": null,
    "config_json": null,
    "created_at": "2018-07-31T22:29:19.000000Z",
    "updated_at": "2018-08-01T00:37:18.000000Z",
    "uuid": "9e7bbcf2-84cf-11eb-9dfd-0acf3b849a0a",
    "gateway_ip": null,
    "gateway_eui": "ABCDEF0012345678",
    "user": "User {Object}"
  },
  "gateway_configs": {
    "authorisation_token": "c9f0f895fb98ab9159f51fd0297e236d",
    "download_link": "http:\/\/console.radiobridge.com\/download-setup\/9e7bbcf2-84cf-11eb-9dfd-0acf3b849a0a\/multitech_sdk.tar.gz"
  }
}

# Update Gateway

Updates the properties of a particular gateway.

Property Description
gateway_name (required) the name of the gateway
gateway_ip (optional) local IP address of the gateway
PATCH  /gateways/{gateway_id}

Example request

curl --location --request PATCH 'https://console.radiobridge.com/api/visualization/v1/gateways/{gateway_id}' \
--header 'Organization: <organization id>' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw '{
"gateway_name":"Dpk Multitech Gateway",
"gateway_ip":null
}'

Example request body

{
  "gateway_name":"Dpk Multitech Gateway",
  "gateway_ip":null
}

Example response

{
  "status": true,
  "message": "Gateway detail has been updated"
}

# Delete gateway

Delete a gateway from the account, This action will remove the gateway from the registered networks.

DELETE  /gateways/{gateway_id}

Example request

curl --location --request DELETE 'https://console.radiobridge.com/api/visualization/v1/gateways/{gateway_id}' \
--header 'Organization: <organization id>' \
--header 'Authorization: Bearer <token>'

Example response

HTTP 204