Error [Forbidden] when sending event in google calendar, googleCL API

Asked

Viewed 245 times

5

For those who do not know, the googleCl(Command line tools for the Google Data Apis) follow the link https://code.google.com/p/googlecl/

I use only the command that sends an event to my google calendar.

Now I have an error message, where previously ran normal, just stopped working for a while, follow an example of the error:

#google calendar add "teste"
Traceback (most recent call last):
File "/usr/local/bin/google", line 991, in <module>
main()
File "/usr/local/bin/google", line 977, in main
run_once(options, args)
File "/usr/local/bin/google", line 763, in run_once
task.run(client, options, args)
File "/usr/local/lib/python2.7/dist-packages/googlecl/calendar/__init__.py", line 330, in _run_add
results = client.quick_add_event(events_list, cal.user)
File "/usr/local/lib/python2.7/dist-packages/googlecl/calendar/service.py", line 277, in quick_add_event
USER_BATCH_URL_FORMAT % calendar_user)
File "/usr/local/lib/python2.7/dist-packages/gdata/calendar/service.py", line 446, in ExecuteBatch
return self.Post(batch_feed, url, converter=converter)
File "/usr/local/lib/python2.7/dist-packages/googlecl/service.py", line 69, in retry_post
return self.retry_operation(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/googlecl/base.py", line 394, in retry_operation
raise err
gdata.service.RequestError: {'status': 403, 'body': '<HTML>\n<HEAD>\n<TITLE>Forbidden</TITLE>\n</HEAD>\n<BODY BGCOLOR="#FFFFFF" TEXT="#000000">\n<H1>Forbidden</H1>\n<H2>Error 403</H2>\n</BODY>\n</HTML>\n', 'reason': 'Forbidden'}

I’ve already updated the API to the latest version (googlecl_0.9.14-2_all.deb) and nothing, still with the same error

  • The request is returning 403 Forbidden, should be the cause. You are trying to access a resource that the server does not allow.

  • @qmechanik I had been using this API for some time, only if google stopped accepting calendar insertion with this API, because going there via site the feature remains available.

1 answer

4


The problem is that the Googlecl uses version 2 of Calendar Gdata API, that was discontinued in November 2014:

Any Calendar Gdata API dependent service (v1, v2), such as o Google Calendar Connectors (GCC), will no longer function as intended. Users of GCC must update to use the Interop Calendar or build your own custom connectors so that you can build with API v3.

Like the Googlecl was no longer updated, the last time was on december 2012, there is no support for v3 of the Calendar Gdata.

Alternatively, you can use the gcalcli, using the v3 of the Gdata Calendar. The downside is that gcalcli does not support other Google services, only Calendar.

Installation

To install it open a terminal and enter the command:

$ sudo pip install gcalcli

If you don’t have the pip installed, do the following:

$ sudo apt-get install python-pip

Utilizing

Syntax:

gcalcli [opcoes] comando [argumentos ou opções de comando] 

For information on how to use it, type:

gcalcli --help

Note: The first time you use it, a page will open in the browser to request the authorization, is used Oauth2 to log in to the account.

  • swiped right here when I run the direct command in the shell, just a detail, I set up a script.sh and when my program calls the script, in the log it asks p/ register again a google account, the script runs with Zabbix user, who has already registered a google account, then I was floating why in the program hangs and msg in the log, and running straight from the shell with Zabbix user right, know how to tell me why or how to solve it?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.