GET
/
connections
/
oauth2
/
callback
curl --request GET \
  --url https://api.switchboard.svc.versori.io/v1alpha1/connections/oauth2/callback \
  --header 'Authorization: Bearer <token>'
{
  "id": "<string>",
  "organisationID": "<any>",
  "name": "<string>",
  "data": {},
  "type": "<string>",
  "redactFields": [
    "<string>"
  ],
  "expiresAt": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

code
string

The authorization code to exchange for an access token.

state
string

This value is generated by the /organisations/{organisationId}/connection-init operation and is an opaque string and should have no meaning to external clients. Internally, it's used to verify the flow was initialised by Switchboard and connect the authorisation grant to the user/organisation who initiated it.

error
string

An error code by the OAuth2.0 provider indicating a problem occurred during the grant.

error_description
string

A human-readable error message associated to the error code specified in the error parameter.

Response

201 - application/json
id
string
required

ID is the identifier for the credential.

organisationID
any
required

OrganisationID is the ID of the organisation which owns this credential.

name
string
required

Name is the credential name.

data
object
required

Data is a map of string keys to string base64 encoded values for the actual credential data.

type
string
required

Type provides additional context to what data the credential contains. Certain types dictate that certain fields must be set in order for the credential to be considered valid:

  • "Default" is the default type for a Credential. Data may contain arbitrary properties and will always be considered valid.
  • "OAuth2Refresh" signifies the credential is to be used for issuing OAuth 2.0 access tokens based on a refresh token. The credential data must json-marshal into a CredentialDataOAuth2Refresh in order to be valid. Credentials of this type may only be created or updated via the connections APIs, not by the credentials APIs.
  • "Raw" signifies the credential contains a value which can be used until the credential expires (or never if the credential has no expiry). The credential data must json-marshal into a CredentialDataRaw in order to be valid.
  • "BasicAuth" signifies the credential contains credentials to be used in HTTP Basic authentication schemes. The credential data must json-marshal into a CredentialDataBasicAuth in order to be valid.
redactFields
string[]

RedactFields is a list of fields within data which once created should not be returned to the user. This property is only applicable for "Default" credential types. Credentials of other types have their own redaction list internally and this field will be ignored.

expiresAt
string

ExpiresAt allows the user to specify when Switchboard should automatically delete the credential.