GetConnectorOAuthToken returns a user's OAuth access token for a connector in the calling deployment's project, refreshing it first if it is about to expire. It returns NotFound if the user has not authorized the connector's current OAuth configuration. It can only be called by deployments.

Changed on
post/v1/deployments/-/connector-oauth-token

Request

  • The document declares no server URL.
  • Auth
    none declared

Request body

configHashstring

Hash of the connector's current OAuth configuration, as computed by the runtime. A token is only returned if the user authorized this configuration, so changing it never reuses an existing authorization.

connectorstring

Name of the connector in the deployment's project.

forceRefreshboolean

If true, the token is refreshed even if it has not expired yet (used after the server rejected the current token).

userIdstring

ID of the user whose token to return.

Response

A successful response.

accessTokenstring
expiresOnstring date-time

When the access token expires. Unset if the token does not expire.

Changes