CourseAI Engineering: The Complete Course · Module 1: Programming Foundations · part 13 of 105
Part 13 · Module 1: Programming Foundations

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".

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.