Skip to content
Snippets Groups Projects
Commit 4af04e22 authored by Martin Schmollinger's avatar Martin Schmollinger
Browse files

Updated README.md for branch rest-api

parent e461aa2d
No related branches found
No related tags found
No related merge requests found
...@@ -39,3 +39,31 @@ http://localhost:8080/h2-console. ...@@ -39,3 +39,31 @@ http://localhost:8080/h2-console.
Look at the different levels of log messages (debug, trace, info etc.). Look at the different levels of log messages (debug, trace, info etc.).
The level for the execution of the application is set in file application.properties. Change The level for the execution of the application is set in file application.properties. Change
the setting to see effect on the log messages after restarting the application. the setting to see effect on the log messages after restarting the application.
* branch rest-api
Below you'll find how to use the API with curl
### curl commands
#### Get all campaigns
`curl localhost:8080/campaigns`
#### add new campaign
`curl -X POST -H 'Content-type:application/json' -d '{"name":"Trikots A-Jugend","donationMinimum":1.0,"targetAmount":1000.0,"account":{"iban":"DE4112312312312345","name":"Jogi Löw","nameOfBank":"KSK Freiburg"}}' localhost:8080/campaigns`
#### Get Campaign with id
`curl localhost:8080/campaigns/1`
#### Update Campaign
`curl -X PUT localhost:8080/campaigns/1 -H 'Content-type:application/json' -d '{"name":"Trikots B-Jugend","donationMinimum":1.0,"targetAmount":1000.0,"account":{"iban":"DE4112312312312345","name":"Jogi Löw","nameOfBank":"KSK Freiburg"}}'`
#### Delete Campaign with id
`curl -X DELETE localhost:8080/campaigns/1`
#### Add Donation to Campaign with id
`curl -H "Content-Type: application/json" -d '{"amount":20,"donorName":"Martin","receiptRequested":true,"status":"IN_PROCESS","account":{"name":"Martin","nameOfBank":"DKB Bank","iban":"DE41123456123456"}}' localhost:8080/campaignss/1/donations`
### Call Swagger-UI for more convenient testing the API
http://localhost:8080/swagger-ui.html
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment