0

When I create a device via the IoT Hub SDK it assigns the device to the parent org. Is there a way to change the org programmatically via the SDK or the REST (IoT Central or Hub)?

Mike Lenart
  • 767
  • 1
  • 5
  • 19

1 Answers1

1

You can try to use PATCH /api/devices/:id?api-versoin=2022-07-31 with JSON payload:

{
   "organizations": ["org-id-to-be-updated"]
}
Roman Marusyk
  • 23,328
  • 24
  • 73
  • 116
  • What do you mean by the "org-id" aspect. Do you mean the organization name or an actual ID? I have tried a couple of things and they throw me 400s. I used the "Org Name" and I also tried the "Parent Org / Child Org Name". – Mike Lenart Sep 07 '22 at 00:04
  • 1
    You can Try GET /api/organizations, find the org id from response payload – Johnson Yang Sep 08 '22 at 06:06