Devices Endpoint - 400 required field error - deviceRegistrationId - google-cloud-platform

Getting the following error when calling the /devices endpoint:
https://smartdevicemanagement.googleapis.com/v1/enterprises/projectId/devices
error code: 400
message: deviceRegistrationId value must be set. This is a required field.
status: INVALID_ARGUMENT
The API is being called from a Crestron home automation processor. The same get devices api call (same projectId and tokens) works fine from Postman or CURL. The documentation makes no reference to this error for the deviceRegistrationId parameter.

Are you using that literal URL or did you replace "projectid" with your actual project id from the developer console?

Related

When using the OLP CLI I get error: "Unexpected HRN entity type"

Using the OLP CLI, how do I determine the HRN to use? When I take the HRN that shows in the console for my project and call
./olp app domain list "hrn:here:authorization::myorg:project/projectId"
I get the error:
"error_description": "errorCode: '400288'. Unexpected HRN entity type for requested resource : hrn authorization:myorg:project/projectId",
(Obviously I’ve replace the actual IDs here)
I can't see any documentation that relates to this error message, or about how I determine the HRN to use. In fact this HRN is the only one I can find in the console.
(Cross-posted from Slack workspace for reach)
The error is connected to the fact that you pass a project HRN instead of an application HRN. According to the documentation the command accepts only application HRNs.
olp app domain list <app HRN> [command options]
The HRN for the application can be retrieved using olp app list. The documentation of the command can be found here. For the case when the application has been created via CLI.
If you want get the HRN for the application created on the portal. Please use the following steps:
Go to Access Manager.
Find your application in the list of apps.
Open Developer Tools in the browser and refresh the page of the application.
Find trustedDomainsEnabled request and check the URL. It should contain URL encoded HRN as the part of URL before /trustedDomainsEnabled See the picture from Chrome.
I know it is tricky, but this is the only solution I found.

Caller does not have permission error when using GMail API

I get 500 server error on my django website thats running on Google App Engine. When I look at Google App Engine logs I see the following error:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest returned "The caller does not have permission">
When I hard refresh the browser this error goes away. Then after some time it pops back up. Happens on mobile(firefox, safari), laptop (firefox,chrome).
UPDATE:
In Django settings.py I have following code. Its last line generates the error :
pickle_path = 'token.pickle' # path to token.pickle
with open(pickle_path, 'rb') as token:
creds = pickle.load(token)
SERVICE = build('gmail', 'v1', credentials=creds) # ERROR LINE
When I run the django server locally: I get following error:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest returned "The caller does not have permission">
When I restart cloud sql connection from my terminal - the error is gone. This never used to happen until a few days ago.
Here's a workaround:
Download the discovery_doc directly from google here
Load the json file (you can name it gmail-api.json)
Build from this json file using build_from_document
Before
from googleapiclient.discovery import build
gmail_creds = get_service_account_creds()
gmail_service = build('gmail', 'v1', credentials=gmail_creds)
After
from googleapiclient.discovery import build_from_document
discovery_doc = load_json('config/gmail-api.json')
gmail_creds = get_service_account_creds()
gmail_service = build_from_document(discovery_doc, credentials=gmail_creds)
It seems that it is now a P0 for Google, so hopefully it will be fixed soon.
https://issuetracker.google.com/issues/160441983
I am also started facing this issue. I have been using Google APIs for more than a year, but suddenly this error HttpError 403 when requesting https://www.googleapis.com/discovery/v1/apis/gmail/v1/rest returned "The caller does not have permission. However, couple of times I didn't see this error and API call was successful. I hope this error at the Gmail API server.
Update:
I am able to call Google APIs without any issues. Seems like issue is resolved at google's end.
I am having the same issue with GAM ADV-X. I thought it was an issue on my computer so I tried on 2 different computers and get the same error. It indeed looks like something changed in the Gmail API over the weekend. Will submit a ticket to Google.

facebook's sharing debugger gives response code 0

I have the following problem: when I'm trying to check how facebook shares my website, I get the following errors:
Inferred Property: The 'og:image' property should be explicitly provided, even if a value can be inferred from other tags.
Missing Properties: The following required properties are missing: og:url, og:type, og:title, og:image, og:description, fb:app_id
Could Not Connect To Server: Check that the webserver is running, and that there are no firewalls blocking Facebook's crawlers.
Curl Error: Curl error: 56 (RECV_ERROR)
The response code is 0.
Anyone an idea?
EDIT: it was a problem with my DNS-settings. It works now.

Invalid argument (HTTP 400): The request contained an invalid argument. When trying to create a new Datastore instance

I'm logged in as the account owner/admin on console.cloud.google.com web control panel. From in there I'm trying to add a new cloud Datastore instance. When I click "Create entity" I get to a page where I have to choose the region from a drop down. No matter what region I choose, I get and error when pressing "next".
The page is showing a spinner for a couple of seconds with "Setting region" (see screenshot).
Then it fails with the message: "Invalid argument (HTTP 400): The request contained an invalid argument" (see screenshot).
I tried with different browsers too.
What could be going wrong here?
After a while I ended up running gcloud app describe in the cloud console. It told me to first run: gcloud app create. After doing that and selecting a region again, I got some more useful error output:
ERROR: (gcloud.app.create) INVALID_ARGUMENT: The request contained an invalid argument.
- '#type': type.googleapis.com/google.rpc.BadRequest
fieldViolations:
- description: App Engine does not support project identifiers with a ":" character.
field: id
So apparently the issue was that the id of my project had a colon in it - which I don't think I ever choose, it was an old project. Creating a new works :-D

Hello, invoking restwebservice from bpel?

I am trying to invoke mapquest geocoding api from BPEL by passing variables as city, state to get response as latitude and longitude accordingly. But its showing error
fault 1:
oracle.fabric.common.FabricInvocationException: Unable to invoke
endpoint URI
"http://www.mapquestapi.com/geocoding/v1/address?key=XXXXXXXXXXX"
successfully due to: javax.xml.soap.SOAPException: Bad response: 403
Forbidden from url
http://www.mapquestapi.com/geocoding/v1/address?key=XXXXXXXX?City=xxxx&County=xxxx&State=xxxx&Zip=xxxx&operationName=Request-Response
I think there should be "&" after key=XXXXXXXX instead of "?".
http://www.mapquestapi.com/geocoding/v1/address?key=XXXXXXXX&City=xxxx&County=xxxx&State=xxxx&Zip=xxxx&operationName=Request-Response