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
POSTrequests. -
You’ve already handled this in Flask (
/reportsroute usesrequests.post())
π§ Important Field: surgery_code or surgery_id
From Swagger and your app logic:
-
You must include
surgery_codeorsurgery_idin 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_codedynamically from app via URL to Looker -
Handling GET and POST logic in Flask
