Interacting with the GraphQL APIConnecting to services via OAuth
Connecting to services via OAuth
If you need to connect to an external service via OAuth authentication (such as Google Sheets), you must first obtain the access token by any means, as Gato GraphQL does not provide the OAuth flow to obtain the credentials.
Once you've got the access token, you can provide it to the Send HTTP request field in the Gato GraphQL query, and connect to the service:
query ConnectToAPIViaOAuth(
$endpoint: String!
$accessToken: String!
) {
authorizationHeader: _sprintf(
string: "Basic %s",
values: [$accessToken]
)
@remove
response: _sendJSONObjectItemHTTPRequest(input: {
url: $endpoint,
method: POST,
options: {
headers: [
{
name: "Authorization",
value: $__authorizationHeader
}
]
}
})
}