oauth2
Creates, updates, deletes, gets or lists an oauth2
resource.
Overview
Name | oauth2 |
Type | Resource |
Id | digitalocean.genai.oauth2 |
Fields
The following fields are returned by SELECT
queries:
- genai_get_oauth2_url
A successful response.
Name | Datatype | Description |
---|---|---|
url | string | The oauth2 url (example: example string) |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
genai_get_oauth2_url | select | type , redirect_url | To generate an Oauth2-URL for use with your localhost, send a GET request to /v2/gen-ai/oauth2/url . Pass 'http://localhost:3000 as redirect_url | |
genai_create_oauth2_dropbox_tokens | exec | To obtain the refresh token, needed for creation of data sources, send a GET request to /v2/gen-ai/oauth2/dropbox/tokens . Pass the code you obtrained from the oauth flow in the field 'code' |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
redirect_url | string | The redirect url. (example: "example string") |
type | string | Type "google" / "dropbox". (example: "example string") |
SELECT
examples
- genai_get_oauth2_url
To generate an Oauth2-URL for use with your localhost, send a GET request to /v2/gen-ai/oauth2/url
. Pass 'http://localhost:3000 as redirect_url
SELECT
url
FROM digitalocean.genai.oauth2
WHERE type = '{{ type }}'
AND redirect_url = '{{ redirect_url }}';
Lifecycle Methods
- genai_create_oauth2_dropbox_tokens
To obtain the refresh token, needed for creation of data sources, send a GET request to /v2/gen-ai/oauth2/dropbox/tokens
. Pass the code you obtrained from the oauth flow in the field 'code'
EXEC digitalocean.genai.oauth2.genai_create_oauth2_dropbox_tokens
@@json=
'{
"code": "{{ code }}",
"redirect_url": "{{ redirect_url }}"
}';