devopsgoogle-cloud-iot

Google IoT-core v1 API discovery not found


I have some issues trying to access google iot-core API from my remote server (hosted on Digital Ocean). The same piece of code could work on my local machine, and I ensured that even the service key was the same, yet there was no explicit message to point me in some general direction.

I'm not sure if this is an issue with the discovery API as I could get the proper response on my local machine using the curl command below but when i tried to do this on my remote server it returned a 404 error. Anyone experienced this before?

curl https://cloudiot.googleapis.com/$discovery/rest?version=v1

Solution

  • Google Cloud IoT API endpoint is: https://cloudiot.googleapis.com/

    The current version is v1 and it is available here: https://cloudiot.googleapis.com/v1

    The discovery doc for this API and this version is: https://www.googleapis.com/discovery/v1/apis/cloudiot/v1/rest

    You may find Google API Explorer a useful tool too: https://developers.google.com/apis-explorer/#p/

    Here is the API Explorer result for Cloud IoT API v1: https://developers.google.com/apis-explorer/#search/cloudiot/cloudiot/v1/

    Even with these endpoints, you will need to authenticate your curl requests before they succeed.

    I strongly encourage you to consider using Google's SDKs (Libraries) for interaction with any Google service and for Cloud IoT for service management (munging registries, devices etc.).

    Once your configuration is established, your devices should use either MQTT or HTTP.