How can I create entities in Fiware-Orion for anonymous reports submitted by multiple smartphones, where I have no control over the entity ID? I'd like Fiware-Orion to automatically generate the entity ID, but I'm facing issues with it not working as expected.
The version of Fiware-Orion I'm using is 3.7.0, and it's running with the following details:
Uptime: 2 days, 7 hours, 13 minutes, 24 seconds
Git Hash: 8b19705a8ec645ba1452cb97847a5615f0b2d3ca
Compile Time: Thu May 26 11:45:49 UTC 2022
Compiled By: root
Compiled In: 025d96e1419a
Release Date: Thu May 26 11:45:49 UTC 2022
Machine: x86_64
Documentation: Fiware-Orion Documentation
Library Versions:
boost: 1_74
libcurl: libcurl/7.74.0 OpenSSL/1.1.1n zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3
libmosquitto: 2.0.12
libmicrohttpd: 0.9.70
openssl: 1.1
rapidjson: 1.1.0
mongoc: 1.17.4
bson: 1.17.4
POST
{
"type": "Complaint",
"description": "Short description of the complaint",
"creationDate": {
"type": "DateTime",
"value": "2023-07-26T12:34:56.789Z"
},
"location": {
"type": "geo:json",
"value": {
"type": "Point",
"coordinates": [-46.73004, -23.55469]
}
},
"image": "SGVsbG8gV29ybGQh",
"deviceId": "012edf4",
"autoAssignId": true
}
returns:
{
"error": "BadRequest",
"description": "entity id length: 0, min length supported: 1"
}
The simple workaround is to generate the entity ID at client side. If you don't need a particular ID, you can generate it randomly.