You can create, retrieve, update, or delete todos with the following commands:
curl -X POST https://XXXXXXX.execute-api.eu-west-1.amazonaws.com/dev/todos --data '{ "text": "Learn Serverless" }'
Example Result:
{"id":"e585bb70-74ed-11eb-a999-c7c1b4267e55","text":"Learn Serverless","checked":false,"createdAt":1613985067175,"updatedAt":1613985067175}%
curl https://XXXXXXX.execute-api.eu-west-1.amazonaws.com/dev/todos
Example output:
[{"checked":false,"createdAt":1613985067175,"text":"Learn Serverless","id":"e585bb70-74ed-11eb-a999-c7c1b4267e55","updatedAt":1613985067175}]%
# Replace the <id> part with a real id from your todos table
curl https://XXXXXXX.execute-api.eu-west-1.amazonaws.com/dev/todos/<id>
Example Result:
[{"checked":false,"createdAt":1613985067175,"text":"Learn Serverless","id":"e585bb70-74ed-11eb-a999-c7c1b4267e55","updatedAt":1613985067175}]%
# Replace the <id> part with a real id from your todos table
curl -X PUT https://XXXXXXX.execute-api.eu-west-1.amazonaws.com/dev/todos/<id> --data '{ "text": "Learn Serverless", "checked": true }'
Example Result:
{"checked":true,"createdAt":1613985067175,"text":"Learn Serverless","id":"e585bb70-74ed-11eb-a999-c7c1b4267e55","updatedAt":1613985228142}%
# Replace the <id> part with a real id from your todos table
curl -X DELETE https://XXXXXXX.execute-api.eu-west-1.amazonaws.com/dev/todos/<id>
Example Result:
{}%