Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
BoleslawX
New 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 Distance Matrix but in this case something went wrong.

 

The code was designed to execute an API request in accordance with the documentation for the "currentConditions" function, but the system returned the following error "Expression.Error Access to the resource is forbidden"

 

In the Google documentation for this method there is no hint on how to design URL, only cURL. I have a suspicion that when Power BI is connected to the Web.Contents function with a POST query instead of GET, it is not able to process this... Is there any way to bypass this, or any recommended solution.

 

Please help!

 

Thank you,

 

B.

 

2 REPLIES 2
lbendlin
Super User
Super User

Where's that documentation?  Can you show a curl example?

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'



 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.