Skip to content

API: Examples

curl recipes with correct paths and response shapes.

Complete curl examples assuming default prefix api and local server at http://127.0.0.1:8000.

List entries

curl -s "http://127.0.0.1:8000/api/streams/films/entries"

Filter and paginate

curl -s "http://127.0.0.1:8000/api/streams/films/entries\
?where[director]=Lucas&per_page=10&page=1"

Create entry

curl -s -X POST "http://127.0.0.1:8000/api/streams/films/entries" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"title":"A New Hope","director":"George Lucas"}'

Update entry

curl -s -X PATCH "http://127.0.0.1:8000/api/streams/films/entries/1" \
  -H "Content-Type: application/json" \
  -d '{"title":"Star Wars: A New Hope"}'

Delete entry

curl -s -o /dev/null -w "%{http_code}" \
  -X DELETE "http://127.0.0.1:8000/api/streams/films/entries/1"
# 204

Query endpoint

curl -s -X POST "http://127.0.0.1:8000/api/streams/films/query" \
  -H "Content-Type: application/json" \
  -d '{"parameters":[{"where":["director","George Lucas"]}]}'

Related