Hi All,
I’m dealing for a while without success trying to add some devices using API.
Following the tutorial and the example on the page simply doesn’t work.
Using the API | The Things Stack for LoRaWAN (thethingsindustries.com)
Below are my commands.
curl --location \
--header 'Authorization: Bearer NNSXS.SECRET' --header 'Content-Type: application/json' \
--header 'User-Agent: my-integration/my-integration-version' \
--request POST \
--data '{
"end_device": {
"ids": {
"device_id": "eui-000516800010f48a",
"dev_eui": "000516800010f48a",
"join_eui": "01203F04E0D5B370"
},
"join_server_address": "au1.cloud.thethings.network",
"network_server_address": "au1.cloud.thethings.network",
"application_server_address": "au1.cloud.thethings.network"
},
"field_mask": {
"paths": [
"join_server_address",
"network_server_address",
"application_server_address",
"ids.join_eui",
"ids.device_id",
"ids.dev_eui"
]
}
}' \
'https://au1.cloud.thethings.network/api/v3/applications/my_app_id/devices/eui-000516800010f48a'
curl --location \
--header 'Accept: application/json' \
--header 'Authorization: Bearer NNSXS.SECRET' --header 'Content-Type: application/json' \
--header 'User-Agent: my-integration/my-integration-version' \
--request PUT \
--data '{
"end_device": {
"supports_join": true,
"lorawan_version": "MAC_V1_0_2",
"ids": {
"device_id": "eui-000516800010f48a",
"dev_eui": "000516800010f48a",
"join_eui": "01203F04E0D5B370"
},
"lorawan_phy_version": "PHY_V1_0_2_REV_B",
"frequency_plan_id": "AU_915_928_FSB_1"
},
"field_mask": {
"paths": [
"supports_join",
"lorawan_version",
"ids.device_id",
"ids.dev_eui",
"ids.join_eui",
"lorawan_phy_version",
"frequency_plan_id"
]
}
}' \
'https://au1.cloud.thethings.network/api/v3/ns/applications/my_app_id/devices/eui-000516800010f48a'
curl --location \
--header 'Authorization: Bearer NNSXS.SECRET' --header 'Content-Type: application/json' \
--header 'User-Agent: my-integration/my-integration-version' \
--request PUT \
--data '{
"end_device": {
"ids": {
"device_id": "eui-000516800010f48a",
"dev_eui": "000516800010f48a",
"join_eui": "01203F04E0D5B370"
}
},
"field_mask": {
"paths": [
"ids.device_id",
"ids.dev_eui",
"ids.join_eui"
]
}
}' \
'https://au1.cloud.thethings.network/api/v3/as/applications/my_app_id/devices/eui-000516800010f48a'
curl --location \
--header 'Authorization: Bearer NNSXS.SECRET' --header 'Content-Type: application/json' \
--header 'User-Agent: my-integration/my-integration-version' \
--request PUT \
--data '{
"end_device": {
"ids": {
"device_id": "eui-000516800010f48a",
"dev_eui": "000516800010f48a",
"join_eui": "01203F04E0D5B370"
},
"network_server_address": "au1.cloud.thethings.network",
"application_server_address": "au1.cloud.thethings.network",
"root_keys": {
"app_key": {
"key": "01203F04E08005204303007XXXXXXXX"
}
}
},
"field_mask": {
"paths": [
"network_server_address",
"application_server_address",
"ids.device_id",
"ids.dev_eui",
"ids.join_eui",
"root_keys.app_key.key"
]
}
}' \
'https://au1.cloud.thethings.network/api/v3/js/applications/my_app_id/devices/eui-000516800010f48a'
Any help will be apreciated.
Regards from Brazil.