Skip to content

Server API Reference

tedneward edited this page Oct 5, 2014 · 11 revisions

.NET WebAPI Server reference

Endpoints

POST /api/members: Add a new member

POST /api/pickups: Add a new pickup
GET /api/pickups/range/{lat}/{long}/{range} : Return the pickups within {range} miles of {lat}/{long}
PUT /api/pickups/{pickupId}: Edit/modify/replace a particular pickup

POST /api/donors: Add a new donor
GET /api/donors/{donorId}/pastdonations: Retrive all pickups for a particular donor
PUT /api/donors: Edit/modify/replace a particular donor
DELETE /api/donors/{donorId}: Delete a donor

Remaining CRUD Endpoints

GET /api/members: Return all members
GET /api/members/{memberId}: Return particular member
DELETE /api/members/{memberId}: Remove particular member
PUT /api/members/{memberId}: Modify/replace particular member

GET /api/pickups: Return all pickups
GET /api/pickups/{pickupId}: Return particular pickup
DELETE /api/pickups/{pickupId}: Delete particular pickup

GET /api/donors: Return all donors
GET /api/donors/{donorId}: Return particular donor

JSON (passed in body and as return)

member json: {
"$id":"1",   // Not sure where this came from
"Id":1,
"Name":"Sealandia Food Bank",
"ContactFirstName":"John",
"ContactLastName":"Doe",
"Email":"[email protected]",
"Address":"1 North Sealandia Drive",
"City":"Sealandia",
"Zip":"12345",
"RangeInMeters":1000,
"Phone":"5555555555",
"Latitude":123.45,
"Longitude":123.45
}

donor json: {
"$id":"1",
"Id":2,
"DeviceId":"B06D4C35-3E2A-4CAE-A393-D2E7C713B51C",
"FirstName":"Betty",
"LastName":"White",
"Phone":"4256474526",
"Email":"[email protected]",
"OptIn":true
}

pickup json: {
"$id":"1",
"ID":1,
"DonorId":2,
"Donor":null,
"Items":"Bag of bagels by the back door",
"Address":"1 Old Folks Way",
"City":"Redmond",
"Zip":"98053",
"Latitude":123.45,
"Longitude":123.45,
"Notes":"Tell them you are with GiveCamp",
"Schedule":"2011-12-19T07:28:46.493",
"Status":1   // Where 0=New, 1=Scheduled, 2=Closed
}
Clone this wiki locally