Hi,
I use the API to create devices from a previously created device type. I use the following call: “https://industrial.api.ubidots.com/api/v1.6/devices/device-type-test/?type=new-type”
But the call to this API requires a token. According to my tests, only the account token can be used. I tried with the organization token but it didn’t work. Is this correct?
I have a problem with this, as I’d like the devices created from the device type with the API to be assigned to the right organization.
I’ve had a look in the API documentation but I can’t find anything directly related to such a case.
Your help would be greatly appreciated
Hello @bertrandgauvreau ,
You’re right; this endpoint does not support assigning the created devices to your desired organization. However, we have a solution that involves an additional request. This is the simplest way to assign the devices.
Alongside creating a Device Type, you can also create a Device Group with the same name and devices, if desired. This allows you to assign the Device Group to an organization. You can complete this process directly on the platform:
Or just using the endpoint for device group creation:
Create Device Group
After creating a new device via the API and assigning it to your Device Type, you can simultaneously use the following endpoint to assign the device to the corresponding Device Group.
Assign Device to Device Group
Every time you add a new device to a device group, it will be assigned to the organization of the group.
Please let me know if this approach is useful for you.
Alejandro