Cloud IoT API has not been used in project before or it is disabled


The Cloud IoT API should be enabled for the project in Google Cloud Platform before using that API in the application. If not enabled, API error message is returned.

When the Cloud IoT API is not enabled when verifying the service account , IoT Cloud Tester  application will return the error.

Following error message is returned by Google Cloud API.

403 Forbidden
GET https://cloudiot.googleapis.com/v1/projects/second-inquiry-315605/locations/asia-east1/registries
{
"code" : 403,
"errors" : [ {
"domain" : "usageLimits",
"message" : "Cloud IoT API has not been used in project 496777850585 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudiot.googleapis.com/overview?project=496777850585 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"reason" : "accessNotConfigured",
"extendedHelp" : "https://console.developers.google.com"
} ],
"message" : "Cloud IoT API has not been used in project 496777850585 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/cloudiot.googleapis.com/overview?project=496777850585 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"status" : "PERMISSION_DENIED"
}

To fix this error, enable the Cloud IoT API in GCP,

  • Enable Cloud Pub/Sub API in GCP by visiting the below URL for the project - https://console.cloud.google.com/apis/library/cloudiot.googleapis.com?authuser=2&project=second-inquiry-315605