31,003
edits
(→Setup) |
|||
| Line 64: | Line 64: | ||
=== Synchronize events from Dolibarr to Google Agenda === | === Synchronize events from Dolibarr to Google Agenda === | ||
The other feature is to write/update an event into Google Calendar, each time an event is added/updated into Dolibarr. | The other feature is to write/update an event into Google Calendar, each time an event is added/updated into Dolibarr. | ||
For this, go onto module setup page, tab "Sync to Google Agenda", and set "Create a Google event into Google Calendar when creating a Dolibarr event" to "Yes". | |||
Then, you must setup and enter the API keys provided by Google. This is dones in several step. | |||
1) Find the Google Agenda ID or your calendar. | |||
Go into your Google Calendar, then "Parameters" in the wheels, then tab "Agenda", or try this link https://www.google.com/calendar/render#i and then click on name or your Agenda. You Agenda ID is an ID that looks like an email. | |||
Fille this ID found into field "ID Agenda". | |||
2) You must create a service account user/email from page https://code.google.com/apis/console/, menu "API & Authentication" -> "Credentials" . Click on "Create a client ID" and choose "Service Account" then "Create". You will get a new service account with a Service account client ID and a Service account EMail. You need here to enter the Service account EMail. | |||
Note: A popup to download a file (used by next step) | |||
3) Once you have you created your service account user/email (see note on previous fields), you must download your security p12 file (or use the one downloaded at previous step). Return on https://code.google.com/apis/console/ and select "API & Authentication" -> "Credentials". Then Click on "Generate a p12 key" to download the file on your desktop. Then submit it using this form. | |||
4) You must also enable the API for your Google account. For this go on page https://code.google.com/apis/console/, menu "API & Authentication" -> "API". Click to enable API for "Calendar API". | |||
5) You must also share the agenda (all permissions) with the service account user/email (created at step 2): For this, go into Google calendar, choose "Parameters" then tab "Agendas" (direct access with this link https://www.google.com/calendar/render?tab=mc#i). Click on link "Share parameters" at end of line of the Agenda to synchronize (It must be same Agenda than the one choosed on parameter "ID Agenda" at step 1). Then add the service account user into the email field, choose permission "Edit events" and validate by clicking "Add user". | |||
With Google Apps for work (not required for standard gmail account), permissions may be forced to "Ready only" instead of "Edit". To solve this, go onto https://admin.google.com/AdminHome#AppDetails:service=Calendar&flyout=sharing and check that sharing option of Agenda application allows sharing with external service account. | |||
Once all steps are done, you can use the button to make a synchronization test. Click on it to make a test. | |||
'''TroubleShooting''' | |||
* If you receive error "ERROR Error calling POST https://www.googleapis.com/calendar/v3/calendars/yourcalendarid/events: (404) Not Found". | |||
Check the step 3 was done. | |||
[[File:Warning.png]] Note: A possible error is that Google denies access, even if login and password are correct, but just because the server that host Dolibarr is located into another country than country you are using google apps usually | [[File:Warning.png]] Note: A possible error is that Google denies access, even if login and password are correct, but just because the server that host Dolibarr is located into another country than country you are using google apps usually | ||
To check Google has locked your access for this reason, go onto page https://security.google.com/settings/security/activity?hl=fr after failure. | To check Google has locked your access for this reason, go onto page https://security.google.com/settings/security/activity?hl=fr after failure. | ||