-
Notifications
You must be signed in to change notification settings - Fork 325
Description
Summary
The API requires a device name in lower case but device manufacturer provides device name in upper case. Using lower case device name in in API request does not return any data while upper case device name in API request results the following error:
{
"error": {
"code": 3,
"message": "error:pkg/errors:validation (invalid end_device_ids
: embedded message failed validation)",
"details": [
{
"@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
"namespace": "pkg/errors",
"name": "validation",
"message_format": "invalid {field}
: {reason}",
"attributes": {
"field": "end_device_ids",
"name": "GetStoredApplicationUpRequestValidationError",
"reason": "embedded message failed validation"
},
"correlation_id": "6e43c71f588f49549cb8c3ecd73d630b",
"cause": {
"namespace": "pkg/errors",
"name": "validation",
"message_format": "invalid {field}
: {reason}",
"attributes": {
"field": "device_id",
"name": "EndDeviceIdentifiersValidationError",
"reason": "value does not match regex pattern "^a-z0-9{2,}$""
},
"correlation_id": "491804e4bebf4581b9ff0d420547396b",
"code": 3
},
"code": 3
}
]
}
}
Is there a workaround?
Steps to Reproduce
- Make an application in The Things Stack
- Register a device in The Things Stack
- Add API key in The Things Stack
- Run following Python script:
# Import libraries
import requests
# Aurorisatie
AUTORISATIE = '<your api key>'
APPLICATION = '<your application>'
DEVICE_ID = '<your device id>'
# HTTP headers
headers = {
'Accept': 'application/json',
'Authorization': 'bearer ' + AUTORISATIE,
"User-Agent": "curl/7.61.0"
}
# Opstellen URL
url = 'https://eu1.cloud.thethings.network/api/v3/as/applications/' + APPLICATION + '/devices/' + DEVICE_ID + '/packages/storage/uplink_message'
# Uitvoeren HTTP request
response = requests.get(url, headers=headers)
print(response)
Current Result
{
"error": {
"code": 3,
"message": "error:pkg/errors:validation (invalid end_device_ids
: embedded message failed validation)",
"details": [
{
"@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
"namespace": "pkg/errors",
"name": "validation",
"message_format": "invalid {field}
: {reason}",
"attributes": {
"field": "end_device_ids",
"name": "GetStoredApplicationUpRequestValidationError",
"reason": "embedded message failed validation"
},
"correlation_id": "6e43c71f588f49549cb8c3ecd73d630b",
"cause": {
"namespace": "pkg/errors",
"name": "validation",
"message_format": "invalid {field}
: {reason}",
"attributes": {
"field": "device_id",
"name": "EndDeviceIdentifiersValidationError",
"reason": "value does not match regex pattern "^a-z0-9{2,}$""
},
"correlation_id": "491804e4bebf4581b9ff0d420547396b",
"code": 3
},
"code": 3
}
]
}
}
Expected Result
Data from sensor
Relevant Logs
URL
No response
Deployment
The Things Stack Enterprise (self-hosted)
The Things Stack Version
No response
Client Name and Version
Other Information
No response
Proposed Fix
No response
Contributing
- I can help by doing more research.
- I can help by implementing a fix after the proposal above is approved.
- I can help by testing the fix before it's released.
Validation
- The fix is tested in a staging environment.
- The fix is documented in The Things Stack Documentation
Code of Conduct
- I agree to follow TTN's Community Code of Conduct.