Azure IoT Hub API call RRS feed

  • Question

  • Hi,

      I use java with spring boot for developing an azure wrapper service for my microservices. I have been generating the bearer token using the URL "{clientID}/oauth2/token", and using the token generated, I am trying to do a POST/PUT/GET operation, for an IoT device, inside IoT Hub, using the URl, "https://{Iot-Hub-name}{deviceID}?api-version." But I have been receiving error messages like,

    "Message""ErrorCode:IotHubUnauthorized;23241i0-2341-5f4g-ww32-ww99r42gqwe1 is not valid"

    Can anyone guide me through this, regarding whether i am using the wrong authentication method for REST APIs, or whether i am doing something else wrong.

    • Moved by Michael Xu-MSFT Thursday, July 16, 2020 1:45 AM The issue is related to Azure Development
    Monday, July 13, 2020 3:53 AM

All replies

  • Dear friend

    If you got "IotHubUnauthorized" error, you can refer to this page for trouble shooting:

    401003 IoTHubUnauthorized

    Keep Fighting

    Monday, July 13, 2020 12:36 PM
  • Like they say in the documentation, there could be some issue with the authorization token. If you are aware of the process, could you please help me with that. What i did follow, were the steps mentioned above.

    Thanks in advance!!

    Wednesday, July 15, 2020 6:34 AM