Method: projects.locations.collections.dataConnector.acquireAndStoreRefreshToken

Exchanges OAuth authorization credentials for a refresh token and stores the refresh token and the scopes. The stored data will be keyed by the connector name and the user identifier from the EUC.

HTTP request

POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}:acquireAndStoreRefreshToken

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. Connector resource.

The connector name identifies the 3rd party system to use for authorization. It is also used as a key to store the refresh token.

Request body

The request body contains data with the following structure:

JSON representation
{
  "scopes": [
    string
  ],
  "fullRedirectUri": string,
  "instanceUri": string
}
Fields
scopes[]

string

The scopes of the authorization code and the refresh token.

fullRedirectUri

string

Required. The URI the user is redirected to after authorization, including all parameters. E.g., https://example.com/redir?code=5

instanceUri

string

Optional. The instance URI for the connector, if provided, supported connectors will use this instance URI to construct the token exchange URL. For example, Shopify instance URI is the shop URL.

Response body

Response message for DataConnectorService.AcquireAndStoreRefreshToken method.

If successful, the response body contains data with the following structure:

JSON representation
{
  "additionalOauthResponses": [
    {
      object (AdditionalOAuthResponse)
    }
  ]
}
Fields
additionalOauthResponses[]

object (AdditionalOAuthResponse)

Optional. Additional OAuth responses from the authorization response. This field is optional and will not always be populated. It depends on the connector's type and the authorization response.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/discoveryengine.assist.readwrite
  • https://www.googleapis.com/auth/discoveryengine.readwrite
  • https://www.googleapis.com/auth/discoveryengine.serving.readwrite

For more information, see the Authentication Overview.

IAM Permissions

Requires the following IAM permission on the name resource:

  • discoveryengine.dataConnectors.acquireAndStoreRefreshToken

For more information, see the IAM documentation.

AdditionalOAuthResponse

Additional OAuth responses from the authorization response.

JSON representation
{
  "key": string,

  // The following is a list of mutually exclusive fields. At most one of the
  // fields will be set in a response:
  "stringValue": string,
  "intValue": string,
  "boolValue": boolean
  // End of mutually exclusive fields.
}
Fields
key

string

The key of the additional OAuth response.

The value of the additional OAuth response. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response:
stringValue

string

The string value of the additional OAuth response.

intValue

string (int64 format)

The integer value of the additional OAuth response.

boolValue

boolean

The boolean value of the additional OAuth response.

End of mutually exclusive fields.