Looker Studio Integration Swagger Intro

You are here:
Estimated reading time: 1 min

Summary of What I See in the Swagger Docs

From the screenshots, here’s a structured breakdown of your available API endpoints and what matters for our Looker setup:


πŸ“Œ Auth Headers (Required for all requests)

Header Required
client-id βœ… Yes
client-secret βœ… Yes

These must be sent on every request from the Cloud Run proxy (you’re doing this already in your Flask app).


🟒 GET Endpoints (Good for Looker Studio)

These are the endpoints you’re using or planning to use for reporting:

Endpoint Purpose Surgery-Code Required?
/patients/{patient_id} Get a single patient βœ… yes (in headers)
/pharmacies Get list of pharmacies βœ… yes
/pharmacies/{id} Get one pharmacy βœ… yes
/services Get procedures & services βœ… yes
/surgeries Get all surgeries ❌ (optional?)
/reports (POST) Reporting data βœ… yes

πŸ“Œ You’re already calling these via Cloud Run + header injection in Flask.


⚠️ POST Endpoints (like /reports)

  • These can work in Looker Studio only via your Cloud Run proxy, since Looker can’t make direct POST requests.

  • You’ve already handled this in Flask (/reports route uses requests.post())


🧠 Important Field: surgery_code or surgery_id

From Swagger and your app logic:

  • You must include surgery_code or surgery_id in every request either as:

    • A query param (e.g. ?surgery_code=DE09) or

    • A header (you’re already doing it in build_headers())

βœ… This allows filtering data by clinic/surgery and supports secure, tenant-level dashboards.


βœ… Current Approach

  • Using Cloud Run to inject secure headers and serve API

  • Using Ayvah in LookerStudio for JSON API to consume from Cloud Run

  • Passing surgery_code dynamically from app via URL to Looker

  • Handling GET and POST logic in Flask

Was this article helpful?
Dislike 0
Views: 14