Forum Discussion
BoleslawX
2 years agoNew Member
REST API Access with POST method
Hello Everyone, I am looking for help to setup in PBB the REST API connection with Google Cloud Air Quality service. Simple GET requests from PBI work just fine with other services such as Dista...
lbendlin
Super User
2 years agoWhere's that documentation? Can you show a curl example?
BoleslawX
2 years agoNew Member
Thank you for taking interest in my case.
The documentation of the service can be found here with two sample requests down below.
https://developers.google.com/maps/documentation/air-quality/current-conditions
I do not know how to approach this as Power BI returns error "Expression.Error Access to the resource is forbidden". despite the fact that I have a valid token.
Thank you in advance.
Basic CURL example
curl -X POST -d '{
"location": {
"latitude": 37.419734,
"longitude": -122.0827784
}
}' \
-H 'Content-Type: application/json' \
'https://airquality.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY'
and more advanced
curl -X POST -d '{
"universalAqi": true,
"location": {
"latitude": 37.419734,
"longitude": -122.0827784
},
"extraComputations": [
"HEALTH_RECOMMENDATIONS",
"DOMINANT_POLLUTANT_CONCENTRATION",
"POLLUTANT_CONCENTRATION",
"LOCAL_AQI",
"POLLUTANT_ADDITIONAL_INFO"
],
"languageCode": "en"
}' \
-H 'Content-Type: application/json' \
'https://airquality.googleapis.com/v1/currentConditions:lookup?key=YOUR_API_KEY'