Skip to main content

oauth2

Creates, updates, deletes, gets or lists an oauth2 resource.

Overview

Nameoauth2
TypeResource
Iddigitalocean.genai.oauth2

Fields

The following fields are returned by SELECT queries:

A successful response.

NameDatatypeDescription
urlstringThe oauth2 url (example: example string)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
genai_get_oauth2_urlselecttype, redirect_urlTo 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_tokensexecTo 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.

NameDatatypeDescription
redirect_urlstringThe redirect url. (example: "example string")
typestringType "google" / "dropbox". (example: "example string")

SELECT examples

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

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 }}"
}';