Skip to main content
100%

Braze API Mockup for local dev

✓ Published0🌍 Public
Aadkdev
Last edited Nov 15, 2022
Created on Sep 21, 2021

This example shows a FastAPI-based mock server for the Braze user-tracking API, designed to support local development and testing. It defines a `/users/track/` endpoint that accepts POST requests, parses the incoming JSON body via FastAPI’s `Request.json()` method, and returns a fixed success response containing the count of processed attributes. The server also includes a root `/` endpoint returning a simple JSON greeting. The code includes commented-out options for randomly returning an error or forcing failures after a request threshold, though these are not active in the current behavior. Dependencies are FastAPI and Uvicorn, with the server run via `uvicorn main:app --reload`.

AI-generated description

Similar vizzes