I’m trying to use the HTTP REST API for creating a device profile. The device profile UUID (/ID) is also needed by other service for reference purposes (basically creating a device with a given device profile).
My problem is that every time I create the device profile with the same information, it has a different ID, e.g., b1d9f4e0-06e5-4166-a5f1-39055d53cdbc
the first time and 19990b47-496e-4d82-a136-c0e6b208c401
the second time, etc. If I could create a profile with a statically known profile ID, then I the other dependent services could also use that without some sort of communication between them.
The swagger docs tell me the /api/device-profiles
API can accept an id
string in its JSON payload.
However, even if I give it this string, it still creates the profile with a different ID.
Example payload
{'deviceProfile': {'adrAlgorithmID': 'default', 'factoryPresetFreqs': [868100000, 868300000, 868500000, 867100000, 867300000, 867500000, 867000000, 867900000], 'id': '19990b47-496e-4d82-a136-c0e6b208c401', 'macVersion': '1.0.2', 'maxEIRP': 12, 'name': 'OTAA', 'networkServerID': '1', 'organizationID': '1', 'regParamsRevision': 'B', 'rxDataRate2': 3, 'rxDelay1': 1, 'rxFreq2': 869525000, 'supportsClassB': False, 'supportsClassC': False, 'supportsJoin': True, 'tags': {}, 'uplinkInterval': '86400s'}}
Resulted in the profile <host>/#/organizations/1/device-profiles/099568f1-b15c-4f36-a94a-0adb88217056
being created – the id
parameter seems ignored (although the rest of the profile creation works just fine with the given parameters).
Is there a way to create fixed-ID device profiles through the REST API?