Hi
Playing around with the things stack v3, trying to create end devices using HTTP, but getting errors. Using Python.
endpoint = {domain.name}/api/v3/applications/{app.name}/devices
According to https://www.thethingsindustries.com/docs/api/reference/grpc/end_device/ only the field ids is required when doing a EndDeviceRegistery
(identidy server). Therefore my ids dict looks like:
ids = {
“device_id”: “test5746”,
“application_ids”: {“application_id” : “test-app”},
“dev_eui”: “70B3D5BB3919CDDE”,
“join_eui”: “70B3AAAB99EECDFF”,
“dev_addr”: “27112303”,
}
params = {"ids":ids,
"name":"testdevice"}
and then:
params_json = json.dumps(params) data1 = requests.post(endpoint, headers={'Authorization': f'Bearer {API_key}'}, data=params_json)
But im getting error code 3, invalid identifiers and the following
'attributes': {'field': 'device_id',
'name': 'EndDeviceIdentifiersValidationError',
'reason': 'value does not match regex pattern "^[a-z0-9](?:[-]?[a-z0-9]){2,}$"'},
however my device_id matches the regex pattern? Any help?