I'm trying to delete an event from one of my Google calendars using the Java API. They code looks like:
calendarService.events().delete( calendarId , eventId ).execute();
When I do so, I get the error:
com.google.api.client.googleapis.json.GoogleJsonResponseException: 410 Gone
DELETE https://www.googleapis.com/calendar/v3/calendars/xxxxxxxxxxxxxxxxxxx#group.calendar.google.com/events/jm1gamo1cj3dm68bidsaufffdg
{
"code" : 410,
"errors" : [ {
"domain" : "global",
"message" : "Resource has been deleted",
"reason" : "deleted"
} ],
"message" : "Resource has been deleted"
}
I can't figure out what the message is telling me.
Is it saying the event wasn't found? If so, the wording seems odd - why wouldn't it say "not found".
Or, is it saying it was deleted previously where the event is marked as deleted (a logical deletion) but still remains in the system (thus it knows it was previously deleted) possibly queued for a physical deletion?
According to the Calendar API documentation here:
410: Gone
SyncToken or updatedMin parameters are no longer valid. This error can also occur if a request attempts to delete an event that has already been deleted.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "deleted",
"message": "Resource has been deleted"
}
],
"code": 410,
"message": "Resource has been deleted"
}
}
So, if you already deleted an event and you try to delete it again, you will most likely be getting this error message.
Reference
Calendar API Handling API Errors.
Related
I am trying to to get event resource using the following api
https://www.googleapis.com/calendar/v3/calendars/primary/events/eventId.
However, I am receiving 404 Not Found response, eventId is correct, I've checked it many times. Also, I've tried to call same method from their website (https://developers.google.com/calendar/api/v3/reference/events/get) and still receiving same error. You can find the attached screenshot here.
API Response Body :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"code": 404,
"message": "Not Found"
}
}
404 Not Found means just that not found.
The event.get method takes a event id as a parameter.
The user you are authencation with needs to have permission to access that event your its going to return a 404 not found for that user.
Try doing an events.list first for the calendar to get a list of all valid events for that calendar if it also returns a 404 then the problem would be that the user does not have access to that calendar.
I tried to connect this package and I follow all the steps
https://github.com/spatie/laravel-analytics#how-to-obtain-the-credentials-to-communicate-with-google-analytics
I keep getting this error:
Google_Service_Exception
{ "error": { "code": 403, "message": "User does not have sufficient permissions for this profile.", "errors": [ { "message": "User does not have sufficient permissions for this profile.", "domain": "global", "reason": "insufficientPermissions" } ] } }
I use the Account Settings / Account Id
my account id have 9 number no letters
The error talks about Profile not Account, so you need to use View ID instead Account ID.
On my file analytics.php
return [
/*
* The view id of which you want to display data.
*/
'view_id' => env('ANALYTICS_VIEW_ID'),
I change the
'view_id' => 11111111,
I put the direct number
you need to hit : https://analytics.google.com/analytics/web/#/usersettings then search All website data(XXXXXXXXX) and past it in view ID
I am using Google Drive API (v2) and used to make successful patch requests as explained here:
https://developers.google.com/drive/v2/reference/properties/patch
in order to add a new metadata property (myNewPr) into my documents.
However, recently (maybe 1-2 days) I started to receive 404 error messages:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "Property not found: key = myNewPr and visibility = PRIVATE",
"locationType": "other",
"location": "property"
}
],
"code": 404,
"message": "Property not found: key = myNewPr and visibility = PRIVATE"
}
}
Any ideas ? When I am testing by using insert (https://developers.google.com/drive/v2/reference/properties/insert) it seems to work.
I try list messages from LiveChat of YouTube. Request:
GET https://www.googleapis.com/youtube/v3/liveChat/messages?liveChatId=Qfad59EnhUA&part=snippet&key={YOUR_API_KEY}
Response:
404 Not Found
{
"error": {
"errors": [
{
"domain": "youtube.liveChat",
"reason": "liveChatNotFound",
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
],
"code": 404,
"message": "The live chat that you are trying to retrieve cannot be found. Check the value of the requests <code>liveChatId</code> parameter to ensure that it is correct."
}
}
Pages https://www.youtube.com/live_chat?is_popout=1&v=Qfad59EnhUA and
https://www.youtube.com/watch?v=Qfad59EnhUA exist.
What's wrong?
i decide this problem. liveChatId can be get from broadcast for python:
print '%s' % (broadcast['snippet']['liveChatId'])
when attempting to test out the api explorer for user.messages: get I have been getting an invalid message ID response.
I am getting the message ID from a recent email in my inbox sent to me, and removed the <> from either ends.
response:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "invalidArgument",
"message": "Invalid id value"
}
],
"code": 400,
"message": "Invalid id value"
}
}
I am a bit confused as I am using the powershell module gshell and noticed that the same messageID worked in my commands but returned invalid id value in the api explorer.
edit: if I do a inbox search for rfc822msgid:[messageID] it returns the correct message
First you have to call the users.messages.list api. It will give a list of messageids. Then we have to call users.message.get api with each messageid to fetch the mail content. You can query the mails with advanced search options provided by Gmail API.
You should not use the rfc822msgid, but the Gmail API message id. Try to list messages and use the id you get from that when getting the message.