Lesson 5: Talking to another system without getting hurt
18 min read·13 Oct 2026
Module 1 · Lesson 5 · About 45 minutes · Needs: Lesson 1 (functions, exceptions) and Lesson 3 (environment variables, secrets)
The situation
Priya wants a morning report of every open order. The orders live in the order system, which Dev runs. He will not hand out database access; he gives you an address and a key: "Use the order API."
Your first script prints two orders when there are five, crashes with a KeyError when an order number is wrong, and one night hangs until morning because the order system was restarting. The order system behaved normally every time; your script did not know the rules. This lesson is the rules, traced through one order: 5730, Aisha Rahman's kettle, status "shipped".