The Oauth2 documentation for google doesnt contain (that I have seen yet) Information on what I am trying to do.
From my server I want to post request to my google cloud to get a response.
For this I need an access token, currently i'm taking it manually from the playground. I am going from my server to my cloud and the documentation states about a user accepting access and then being redirected etc but I don't involve any users.
- I need to continuously, automatically get an access token for my requests, or similar. Without needing to click for access?
this is the request, for context:
var options = {
method: 'POST',
uri: 'https://dialogflow.googleapis.com/v2beta1/projects/someproject/agent/sessions/1:detectIntent',
headers: {
'Authorization': 'Bearer ya29.GlsGBscelmqeHgOVgx1p4EF_L45zetym6s3isC1HF4IYJqb20vHd8FolxvsmM_vU2fmIPWN3JElGIEuNN3i_-N9V-68YlwNvEduMIA5SuSltK-Sepsl0yNYM9REy',
'Content-Type': 'application/json'
},
body: {
"queryInput": {
"event": {
"name": "Matching",
"languageCode": "en"
}
}
},
json: true // Automatically stringifies the body to JSON
};
For more information, I am triggering an intent from dialogflow.