Q: Google Calendar API, Foreground color - google-calendar-api

I am currently working with the google calendar API and and have ran into an issue.
I can't seem to update (or patch) a calendarList's foreground color.
Even when working directly with their API at:
https://developers.google.com/calendar/v3/reference/calendarList/patch
With both queries, I have colorRgbFormat set to true, and these are the only values I provide.
This input works fine:
{
"backgroundColor": "#ac725e"
}
Where this input:
{
"backgroundColor": "#ac725e",
"foregroundColor": "#c1c1c1"
}
Gives me the following error:
400 bad request:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Invalid foreground color."
}
],
"code": 400,
"message": "Invalid foreground color."
}
}
Any ideas?
I have tried using similar color format that is needed for ColorId, AKA "1", but that also gives me a bad request error.
What am I missing or doing wrong?

After doing trial and error, I found out that the foregroundColor is limited only to black(#000000) and white (#FFFFFF).
Example:
Reference:
CalendarList

Related

Internal Error when attempting to set thermostat heat setpoint

I am trying to control my thermostats heat setpoint, but am getting an internal error every time I try to set the heat setpoint. The thermostat is in heat mode and I can control the heat setpoint from the Google Home App. This is happening with a Nest Thermostat and Nest Learning Thermostat.
command:
{
"command": "sdm.devices.commands.ThermostatTemperatureSetpoint.SetHeat",
"params": {
"heatCelcius": 20.0
}
}
Response:
{
"error": {
"code": 500,
"message": "Internal error encountered.",
"status": "INTERNAL"
}
}
Is there any way to debug what is happening? I have tried to remove and set up the thermostats again, but the issue persists.
You could try and recreate through Postman, it usually gives more information on the why

Google calendar RRULE fails when updating but not when initially creating calendar entry

I already have an event entry that I created from my custom calendar with the following RRULE
FREQ=WEEKLY;DTSTART=20201203T090000;INTERVAL=2;BYDAY=TH;EXDATE:20201203T090000
When I update the event without changing the rrule I get an error
Error Message: Google_Service_Exception: { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid recurrence rule." } ], "code": 400, "message": "Invalid recurrence rule." } }
The only thing I can think of is that this rrule has dates in the past. Can anyone confirm that this would be the issue?
FREQ=WEEKLY;DTSTART=20201203T090000;INTERVAL=2;BYDAY=TH;EXDATE:20201203T090000 is not a valid recurrence rule. With all the invalid parts removed the rule would look like this:
FREQ=WEEKLY;INTERVAL=2;BYDAY=TH
DTSTART and EXDATE are separate properties.

Suddenly getting intermittent error "Failed to parse Dialogflow response into AppResponse : null"

I've suddenly recently started seeing errors like "Failed to parse Dialogflow response into AppResponse : null" on Actions On Google/Dialogflow projects that previously worked ok.
Even now, the error seems intermittent, and happens despite the response from my Firebase function (fulfilment webhook) being identical. In other words, sometimes I get the above error, and other times it works, but the response from my Firebase function is identical in both cases.
As an example, here is a response that sometimes, but not always, causes the error I mention above:
{ "status": 200, "headers": { "content-type":
"application/json;charset=utf-8" }, "body": { "payload": { "google": {
"expectUserResponse": true, "systemIntent": { "intent":
"actions.intent.OPTION", "data": { "#type":
"type.googleapis.com/google.actions.v2.OptionValueSpec", "listSelect":
{ "title": "Please select one option:", "items": [ { "optionInfo": {
"key": "Yes", "synonyms": [ [ "Go", "Lets go", "Let's go", "Get
started", "Yes", "I am ready", "Start the survey", "Start", "1", "One"
] ] }, "description": " Start a new diary entry", "title": "1. Let's
Go" }, { "optionInfo": { "key": "Stop", "synonyms": [ [ "No", "Don't
continue", "No thanks", "Stop", "Stop the survey", "2", "Two" ] ] },
"description": " Don't make a new diary entry", "title": "1. Stop" } ]
} } }, "richResponse": { "items": [ { "simpleResponse": {
"textToSpeech": "Hi. It’s
nice to have you here and we look forward to discussing the food and
drink you give your baby.Let us know each time
you give them something to eat or drink.When you
are ready to start, say Let’s go.", "displayText":
"Hi. \n \nLet us know each time you give them something to eat or
drink. \n \nWhen you are ready to start, select Let’s go." } } ] },
"userStorage":
"{\"data\":{\"userId\":\"bb46f3f9-e522-2da0-7b3c-302a615d28e4\",\"unicomId\":\"danone2\"}}"
} } } }
So in the Firebase logs I can see the above being returned in all cases, but sometimes Google Assistant fails, and the Google Cloud logs show the "Failed to parse Dialogflow response into AppResponse : null" error, and other times, with the identical JSON returned by Firebase, it happily works.
I'm at a slight loss as to where to look further, if anyone has any pointers that'd be much appreciated, thanks!
I had a same problem. In my case, systemIntent in my response json was null and it caused this error. It worked fine before but recently It failed. I hope it helps someone.
Just to close this issue - turns out this was my fault, and the JSON response was contructed wrongly (the "synonyms" were enclosed in duplicate [[ and ]]). I believe Dialogflow was suddenly flagging this as an error, when previously it was more forgiving.
Anyway - fixing the JSON response has fixed the issue.

google prediction api "hello prediction" tutorial

I have run through the Google Prediction API tutorials and documentation for "hello prediction - https://cloud.google.com/prediction/docs/hello_world
However when training the model in the developer console my request fails with the following output:
Request:
POST https://www.googleapis.com/prediction/v1.6/projects/959568262740/trainedmodels?key={YOUR_API_KEY}
{
"id": "language_id",
"storageDataLocation": "http://storage.googleapis.com/2341234/language_id.txt"
}
Response:
400 OK
- Show headers -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "Training data file is empty.",
"locationType": "other",
"location": "id"
}
],
"code": 400,
"message": "Training data file is empty."
}
}
I've implemented Authorize requests using OAuth 2.0: - is there anything else that I should be doing, or that may have changed between Google PRediction API v 1.6 and the tutorial. Any link to any additional tutorial or article on the subject would also be extremely valuable so can debug myself!
Your storageDataLocation is not correct.
When you go to the Overview tab in Google Developers Console, you'll find your Project ID: xxxxx (example) and the bucket you've stored in is called yyyy (example).
Then replace the "storageDataLocation:" "xxxxx/yyyy". Should solve this problem. You need the relative path to Google Storage, and not the absolute web path.

What is the issue in the Google map engine Query

i need to query some data with where clause
as per the API google map engine i have request as below.
https://www.googleapis.com/mapsengine/v1/tables/14538994882799551513-11853667273131550346/features?where=gx_id%3D900
for the above URL it says BAD REQUEST where=gx_id=900
and the response is
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalid",
"message": "The value is invalid.",
"locationType": "parameter",
"location": "query"
}
],
"code": 400,
"message": "The value is invalid."
}
}
Please suggest me what is wrong in this URL
You use a Number in your query, but the particular gx_id seems to be of type String.
Enclose the Number with single-quotes:
https://www.googleapis.com/mapsengine/v1/tables/14538994882799551513-11853667273131550346/features?where=gx_id%3D%27900%27
Also, you don't have to worry about creating and keeping track of your ID's. the API says you need to include gx_id only to make sure that no Feature is sent twice.
Therefore, you can just throw in a string representing your system's current time for example.

Resources