You've already forked OpenIntegrations
mirror of
https://github.com/Bayselonarrend/OpenIntegrations.git
synced 2026-05-22 10:05:29 +02:00
Перевод доков с новой структурой
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Calendar list management",
|
||||
"position": "3"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Calendar metadata management",
|
||||
"position": "2"
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"label": "Event management",
|
||||
"position": "4"
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
---
|
||||
id: GoogleCalendar
|
||||
sidebar_class_name: GoogleCalendar
|
||||
---
|
||||
|
||||
<img src={require('../../static/img/APIs/GoogleCalendar.png').default} width='64px' />
|
||||
|
||||
# Google Calendar
|
||||
|
||||
This section is dedicated to the library for working with API Google Calendar. On this page, all the steps necessary to start working are described
|
||||
|
||||
:::important
|
||||
If you're already using the API to interact with other Google Workspace services and have completed the initial setup, you can skip the steps for **Creating a Project** and **Setting Up OAuth**. You just need to enable the Google Drive** service in your existing project and reacquire the token (the last two steps in the instructions).
|
||||
:::
|
||||
|
||||
## Getting started
|
||||
|
||||
<hr/>
|
||||
|
||||
### Project creation
|
||||
|
||||
1. Go to the [Google Cloud Console](https://console.cloud.google.com) and create a project
|
||||
|
||||

|
||||
|
||||
2. Select the created project and in the side menu go to APIs and Services -> OAuth consent screen
|
||||
|
||||

|
||||
|
||||
3. Choose External
|
||||
|
||||

|
||||
|
||||
4. Fill in the fields: App name, User support email, and Email addresses (all fields with asterisks)
|
||||
|
||||

|
||||
|
||||
5. Click on Next and then Save and continue on the last tab
|
||||
|
||||

|
||||
|
||||
6. Click on Publish App
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### OAuth settings
|
||||
|
||||
1. In the side menu, select Credentials -> Create Credentials -> OAuth client ID
|
||||
|
||||

|
||||
|
||||
2. Enter the name and choose Application type - Desktop app
|
||||
|
||||

|
||||
|
||||
3. Save ClientID and Client Secret
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Enable service - Google Calendar
|
||||
|
||||
1. Go to the [Calendar page on the Marketplace](https://console.cloud.google.com/marketplace/product/google/calendar-json.googleapis.com)
|
||||
|
||||
2. Click Enable
|
||||
|
||||

|
||||
|
||||
<hr/>
|
||||
|
||||
### Token retrieval
|
||||
|
||||
1. Pass the ClientID to the function OPI_GoogleWorkspace.FormCodeRetrievalLink() with boolean parameters of the services you use. The function will result in a URL that needs to be opened in the browser. Authorize with your Google account
|
||||
|
||||

|
||||
|
||||
2. Copy the code from the URL after authorization
|
||||
|
||||

|
||||
|
||||
3. Use the obtained code, ClientID, and Client Secret to call the function OPI_GoogleWorkspace.GetTokenByCode(ClientID, ClientSecret, Code)
|
||||
|
||||
```json title="Result of the function GetTokenByCode() if converted to JSON"
|
||||
|
||||
{
|
||||
"token_type": "Bearer",
|
||||
"refresh_token": "1//09au6OES3JN9oCgYIARAAGAkSNwF-L9Ir1B7uawfwafT1wE0FKO519Xj6JxawfawfyjMyJ_QlUZYLHZqw",
|
||||
"scope": "https://www.googleapis.com/auth/calendar",
|
||||
"expires_in": 3599,
|
||||
"access_token": "ya29.a0AfB_byA344tXkIawdawdwadadhyZQV8bSZn_snNXtY2HLb7l71awdawdawdad-ASgpzyOSWIvEmPruhUa_1yCCq6jvoD0r_q-fNEsARrH8zpJ3c6LNGWvwdg8CXsSxYaCgYKAWkSawfwafawfrCK0EP5kZY_A0171"
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
4. Use the **access_token** to pass as a Token parameter when calling functions of the library, and the **refresh_token** - to obtain a new access_token (function OPI_GoogleWorkspace.RefreshToken(ClientID, ClientSecret, RefreshToken)), when the old one expires. When refreshing the token, the refresh_token is not updated - you can use the same one to get a new access_token each time.
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"label": "Google Calendar",
|
||||
"position": 7,
|
||||
"link": {
|
||||
"type": "doc",
|
||||
"id": "GoogleCalendar"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user