Create device using HTTP (the things stack)


Playing around with the things stack v3, trying to create end devices using HTTP, but getting errors. Using Python.

endpoint = {}/api/v3/applications/{}/devices

According to 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,

and then:

params_json = json.dumps(params)
data1 =, 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?

As you can see in the API reference, the EndDeviceRegistry.Create expects a CreateEndDeviceRequest type, which looks like this:

  "end_device": {},

Your request seems to only pass the EndDevice object.

I would recommend you to compare your requests to the requests made by the Console (which uses the exact same API) or the CLI (with the --dump-requests flag).

1 Like

This topic was automatically closed after 30 days. New replies are no longer allowed.