I need to get data from Google Analytics GA4 via API. I have created a service account and downloaded the JSON file. See below for an partial copy of the file. I need to use PowerShell and have not had any luck figuring out how to get the tokens for AUTH 2.0 to actually do the API call. I don't know if I need to load a module, but suggestions would be welcome. I don't have a secret code so all of the examples I looked at would not work. If someone can share your knowledge I would gratefully appreciate it.
Sample JSON file
{
"type": "service_account",
"project_id": "ccc-pull-16
"private_key_id": "313a20f
"private_key": "-----BEGIN
"client_email": "starting-
"client_id": "106846481226
"auth_uri": "https://accou
"token_uri": "https://oaut
"auth_provider_x509_cert_u
"client_x509_cert_url": "h
"universe_domain": "google
}
Existing Code: I have not tried as I don't have the proper understanding of what I have to do.