-
Notifications
You must be signed in to change notification settings - Fork 68
API Reference
Гленда edited this page Jan 14, 2023
·
13 revisions
data.json is you main database.
{"1":
{"id":"1",
"maidenname":"Doe",
"name":"John Doe",
"age":23,
"bday":"1.1.2000",
"address":"That Street. 1, NYC, US",
"phone":"+12 34567890",
"ssn":"1234",
"civilstatus":"Married",
"kids":"1",
"hobbies":"Coding",
"email":"johndoe@placeholder.com",
"occupation":"Accountant",
"prevoccupation":"Mailman",
"education":"The School",
"military":"First Lieutenant",
"religion":"None",
"pets":"Cat",
"club":"Chess Club",
"legal":"Divorce with Jane Doe",
"political":"Middle",
"notes":"Very cool guy",
"accounts":
{"GitHub":
{"service":"GitHub",
"id":"1234567890",
"username":"johndoe",
"url":"https://github.com/johndoe",
"profilePicture":["really long base64 string"],
"imgHash":[123],
"bio":["Hi! I am John Doe"],
"firstname":"",
"lastname":""},
"SlideShare":
{"service":"SlideShare",
"id":"",
"username":"johndoe",
"url":"https://slideshare.net/johndoe",
"profilePicture":["really long base64 string"],
"imgHash":[123],
"bio":null,
"firstname":"",
"lastname":""}},
"notaccounts":null}}
curl http://localhost:8080/people/3/addAccounts/9glenda
curl http://localhost:8080/getAccounts/johndoe
{"GitHub":
{"service":"GitHub",
"id":"1234567890",
"username":"johndoe",
"url":"https://github.com/johndoe",
"profilePicture":["really long base64 string"],
"imgHash":[123],
"bio":["Hi! I am John Doe"],
"firstname":"",
"lastname":""},
"SlideShare":
{"service":"SlideShare",
"id":"",
"username":"johndoe",
"url":"https://slideshare.net/johndoe",
"profilePicture":["really long base64 string"],
"imgHash":[123],
"bio":null,
"firstname":"",
"lastname":""}
}
curl http://localhost:8080/people/4/addAccount --include --header "Content-Type: application/json" --request "POST" --data ' {
"service": "slideshare",
"id": "",
"username": "9glenda",
"url": "",
"profilePicture": null,
"bio": null
}'
I'm not sure what exacly is the limit but the data.json generated by tes-data.sh is to big to fit into a curl request
curl -X 'POST' -d '{"1":{"pictures":null,"id":"1","maidenname":"","name":"hacker1","age":49,"bday":"","address":"","phone":"","ssn":"","civilstatus":"","kids":"","hobbies":"","email":"","occupation":"","prevoccupation":"","education":"","military":"","religion":"","pets":"","club":"","legal":"","political":"","notes":"","sources":null,"accounts":null,"notaccounts":null}}' http://localhost:8080/dataJson
to post a data.json the old data.json will be overwritten. be careful blah blah blah