I’m trying to store value from google api into influx via telegraf.
I do have a bash script that take care of the token and authentication for now, but since telegraf support oauth now, I would like to get rid of my script.
Here’s my config
[[inputs.http]] urls = [ "https://smartdevicemanagement.googleapis.com/v1/enterprises/XXXXXXXXXX/devices" ] client_id = "XXXXXapps.googleusercontent.com" client_secret = "XXXXXXX" token_url = "https://www.googleapis.com/oauth2/v4/token" name_override = "XXXX_Nest" method = "GET" data_format = "json" interval = "60s"
I’ve tried a lot of different thing and there is no way I can have it working properly.
The error I have is :
2023-07-17 18:37:00 2023-07-17T22:37:00Z E! [inputs.http] Error in plugin:
[url=https://smartdevicemanagement.googleapis.com/v1/enterprises/XXXXXXXX/devices]: Get "https://smartdevicemanagement.googleapis.com/v1/enterprises/XXXXXXXXX/devices": oauth2: "unsupported_grant_type" "Invalid grant_type: client_credentials"
Anybody have found a way to have google api working directly in telegraf?