NO BUG: Cannot use dynamic tag in URL for API call (v2.1-beta)

Goal: use a dynamic tag in the API Endpoint URL so you can get Google Reviews based on the Place ID of a CPT Location. The CPT Location has the name of the location and a field with their Place ID.

Requirements (if you want to test with Google Reviews)

  1. Create a Google Cloud API key for the “Places API (New)”.
  2. Create a CPT Locations
  3. Create an ACF Field group with field “place_id” and link it to the Locations
  4. Add some locations with real-world places. You can find place IDs here: Place IDs  |  Places API  |  Google for Developers

Note that the new Places API adds the “Place ID” before the query parameters!

https://places.googleapis.com/v1/places/ChIJMXL6ylNrxkcRkoZqYWfQjAY?fields=addressComponents,reviews&key=

  1. In the Single Post Template create an API call
  2. Test with an API call to Google: https://places.googleapis.com/v1/places/ChIJMXL6ylNrxkcRkoZqYWfQjAY?fields=addressComponents,reviews&key=
  3. If the call works, replace the hardcoded value of the place id with a dynamic tag: https://places.googleapis.com/v1/places/{acf_location_place_id}?fields=addressComponents,reviews&key=
  4. When I tested this the response was: API: Response | Request: Error (HTTP 404: Not Found)


Hi @lbch,

You are right - I was able to replicate the issue and I’ve added it to our internal bug tracker.

Thank you,
Matej

1 Like

Hi @lbch ,

Please may I know if the issue is still there if you use the latest Bricks 2.1.2 version?

I believe this issue has been resolved, as we can’t replicate this anymore.

Regards,
Jenn