Real APIs do not only answer requests. A payment succeeds, a contact is updated, an export finishes, and the API posts an event to your app. Understudy can do the same, so your event-receiving code finally has something real to exercise.
Webhook rules
A simulation can carry webhook rules. When a record is created, updated or deleted, each matching enabled rule fires an HTTP POST of the record to a target URL you choose. The post is signed, so your signature-checking code runs for real. You set them up in the editor's Webhooks tab, with no code.
A rule has:
- A resource, whose record changes fire it.
- A change: created, updated or deleted.
- A field (for updates only): fire only when a particular field changes, or leave it off for any change.
- A value (for an update to a field): fire only when that field's new value matches.
- An event type, carried in the payload, like
order.cancelled.
So the full loop, your app calls the API, the API calls your app back, can be tested end to end, on your own machine.