How APIs work · Demo 3 of 4

Break it on purpose

A request does not always come back quickly, full, or at all. Every outcome is a screen someone has to design. Pick an outcome, then switch the designed states off to see what users get without them.

1 Choose what happens to the request

2 The interface: what the user sees

Projects

Behind the scenes · what travelled between them
Choose an outcome to send a request.

What to notice

  1. “Loading” is a state too. It lasts as long as the server takes.
  2. Empty is a success: status 200, with nothing in the list.
  3. 4xx means the request was wrong. 5xx means the server failed.
  4. With no connection there is no status code at all.

Explain it back

  • Which outcomes return status 200? Which return no status?
  • Why is a skeleton better than a blank screen during a slow request?
  • What should the button on the error state do?
  • Pick a screen you designed recently. Which of these states is missing?