Interagir avec l'API GraphQLConnexion aux services via OAuth
Connexion aux services via OAuth
Si vous avez besoin de vous connecter à un service externe via l'authentification OAuth (comme Google Sheets), vous devez d'abord obtenir le jeton d'accès par tous les moyens, car Gato GraphQL ne fournit pas le flux OAuth pour obtenir les identifiants.
Une fois que vous avez le jeton d'accès, vous pouvez le fournir au champ Send HTTP request dans la requête Gato GraphQL, et vous connecter au 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
}
]
}
})
}