Reviews API
The directory needed reviews submitted through custom forms.
- Client
- Professional directory site (Israel)
- Market
- Israel
- Service
- Web development
- Status
- Live
01 / Build
What I built
REST endpoint and form hooks for a custom review system.
- WordPress
- PHP
- REST API
02 / Decisions
Key decisions
- A REST endpoint of its own instead of a reviews plugin, because the reviews had to arrive through the directory's custom forms, not a plugin's form.
- Hook into the existing forms rather than replace them, so the forms people already use keep working and the change ships without a redesign.
- Validate and sanitize every field on the server, because a public endpoint is the first place spam and malformed data arrive.
03 / Notes
Architecture and hindsight
Architecture
A form submission runs through a hook that passes the review to a custom WordPress REST endpoint. The endpoint checks the request, validates every field and stores the review against the professional's listing. Keeping the logic in the endpoint, not the form, means any future form or app can submit reviews the same way.
What I'd do differently
Version the endpoint from the first release (/v1/). Then a mobile app or a partner site could use it later, and the endpoint could change, without breaking the forms already on the site.
04 / Outcome
Outcome
Live in production; reviews arrive through the directory's own forms.
Have a problem like this one?