View Interactive Miracle Messages Map API Docs
DELETE /api/homeless/:id
| Name | Type | Description |
|---|---|---|
| id | id | User Id (comes from URL) |
Request
axios.delete('/api/homeless/:id');
Response
HTTP/1.1 204 No Content
PUT /api/homeless/:id
| Name | Type | Description |
|---|---|---|
| id | id | Required User Id (comes from URL) |
| name | string | optional Optional updated Homeless Name |
| string | optional Optional updated Homeless Email |
|
| city | string | optional Optional updated Homeless City |
| state | string | optional Optional updated Homeless State |
| country | string | optional Optional updated Homeless Country |
| longitude | float | optional Optional updated Homeless Longitude |
| latitude | float | optional Optional updated Homeless Latitude |
Request
axios.put('/api/homeless/:id', updatedHomeless);
Response
{
"id": 2,
"firstName": "Joel",
"lastName": "Perez",
"city": "Lafayette",
"state": "CO",
"zip": null,
"country": "United States of America",
"created": 1564524174115,
"longitude": -105.097455,
"latitude": 39.994962
} *
GET /api/homeless
| Name | Type | Description |
|---|---|---|
| token | string | Token returned from login passed in as req.headers.authorization |
Request
axios.get('/api/homeless');
Response
[
{
"id": 14,
"firstName": "McClure",
"lastName": "Daley",
"longitude": -121.806,
"latitude": 38.0049
},
{
"id": 15,
"firstName": "Edmondson",
"lastName": "Africa",
"longitude": -122.198,
"latitude": 37.4613
}
]
GET /api/homeless/:id
| Name | Type | Description |
|---|---|---|
| token | string | Token returned from login passed in as req.headers.authorization |
| Name | Type | Description |
|---|---|---|
| id | id | User Id (comes from URL) |
Request
axios.get('/api/homeless/:id');
Response
{
"id": 2,
"firstName": "Joel",
"lastName": "Perez",
"city": "Lafayette",
"state": "CO",
"zip": null,
"country": "United States of America",
"created": 1564524174115,
"longitude": -105.097455,
"latitude": 39.994962
}
POST /api/homeless
| Name | Type | Description |
|---|---|---|
| firstName | string | Mandatory First Name |
| lastName | string | Mandatory Last Name |
| city | string | optional Optional city |
| state | string | optional Optional state |
| zip | string | optional Optional zip code |
| country | string | optional Optional country |
| longitude | float | optional Optional longitude |
| latitude | float | optional Optional latitude |
Request
axios.post('/api/homeless', newHomelessPerson);
Response
{
"id": 2,
"firstName": "Joel",
"lastName": "Perez",
"city": "Lafayette",
"state": "CO",
"zip": null,
"country": "United States of America",
"created": 1564524174115,
"longitude": -105.097455,
"latitude": 39.994962
}
DELETE /api/partners/:id
| Name | Type | Description |
|---|---|---|
| id | id | User Id (comes from URL) |
Request
axios.delete('/api/partners/:id');
Response
HTTP/1.1 204 No Content
PUT /api/partners/:id
| Name | Type | Description |
|---|---|---|
| id | id | Required User Id (comes from URL) |
| name | string | optional Optional updated Partner Name |
| string | optional Optional updated Partner Email |
|
| city | string | optional Optional updated Partner City |
| state | string | optional Optional updated Partner State |
| country | string | optional Optional updated Partner Country |
| longitude | float | optional Optional updated Partner Longitude |
| latitude | float | optional Optional updated Partner Latitude |
Request
axios.put('/api/partners/:id', updatedPartner);
Response
{
"id": 447,
"name": "Joels food bank",
"email": "yeahright@noway.com",
"city": "Denver",
"state": "CO",
"country": "USA",
"longitude": -104.988415,
"latitude": 39.749885,
"password": "$2a$10$l1AbQFAGX.CZOEQm1RgaP.qVstDpteUXm2XuqhT9q280KMnQDQYxi"
}
GET /api/partners
Request
axios.get('/api/partners');
Response
[
{
"id": 1,
"name": "Nicole Zaborsky",
"email": "nicolezaborsky@charter.net",
"longitude": -119.9843482,
"latitude": 38.9332411
},
{
"id": 2,
"name": "Jill Baker",
"email": "jlbaker@nnva.gov",
"longitude": -76.4321089,
"latitude": 36.9786449
}
]
GET /api/partners/:id
| Name | Type | Description |
|---|---|---|
| id | id | User Id (comes from URL) |
Request
axios.get('/api/partners/:id');
Response
{
"id": 447,
"name": "Joels food bank",
"email": "yeahright@noway.com",
"city": "Denver",
"state": "CO",
"country": "USA",
"longitude": -104.988415,
"latitude": 39.749885,
"password": "$2a$10$l1AbQFAGX.CZOEQm1RgaP.qVstDpteUXm2XuqhT9q280KMnQDQYxi"
}
POST /api/auth/login
| Name | Type | Description |
|---|---|---|
| string | Mandatory email |
|
| password | string | Mandatory password |
Request
axios.post('/api/auth/login');
Response
{
"id": 447,
"name": "Joels food bank",
"email": "yeahright@noway.com",
"city": "Denver",
"state": "CO",
"country": "USA",
"longitude": -104.988415,
"latitude": 39.749885,
"password": "$2a$10$l1AbQFAGX.CZOEQm1RgaP.qVstDpteUXm2XuqhT9q280KMnQDQYxi"
}
POST /api/auth/register
| Name | Type | Description |
|---|---|---|
| name | string | optional Optional name |
| string | Mandatory email |
|
| password | string | Mandatory password |
| city | string | optional Optional city |
| state | string | optional Optional state |
| country | string | optional Optional country |
| longitude | float | optional Optional longitude |
| latitude | float | optional Optional latitude |
Request
axios.post('/api/auth/register');
Response
{
"id": 447,
"name": "Joels food bank",
"email": "yeahright@noway.com",
"city": "Denver",
"state": "CO",
"country": "USA",
"longitude": -104.988415,
"latitude": 39.749885,
"password": "$2a$10$l1AbQFAGX.CZOEQm1RgaP.qVstDpteUXm2XuqhT9q280KMnQDQYxi"
}
Site working at: https://miraclemessages.netlify.com