Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Outdoor Issue

Table of contents

  1. /app/outdoorIssue/all
    1. Request cURL
    2. Response body
  2. /app/outdoorIssue/:id
    1. Request cURL
    2. Response body
  3. /app/outdoorIssue/add
    1. Request cURL
    2. Response body
  4. /app/outdoorIssue/update/:id
    1. Request cURL
    2. Response body
  5. /app/outdoorIssue/delete/:id
    1. Request cURL
    2. Response body

/app/outdoorIssue/all

Request cURL

curl https://accessnav-api-git-ctine987.apps.cloudapps.unc.edu/app/outdoorIssue/all

Response body

[
    {
        "_id": "6242966907941f5e76b34770",
        "location": "Rosenau Hall",
        "avoidPolygon": [],
        "latitude": 35.905877677908045,
        "longitude": -79.05360645370045,
        "category": ["Door"]
        "description": "Automatic door broken",
        "status": "Closed",
        "datetimeOpen": 1634359400378,
        "datetimeClosed": 1635309497378,
        "datetimePermanent": 0,
        "votes": [
            "31"
        ],
        "__v": 0
    },
    {
        "_id": "6242989036c1d86631672ab2",
        "location": "Peabody Hall",
        "avoidPolygon": [],
        "latitude": 35.91062629670515,
        "longitude": -79.05362209913692,
        "category": ["Maintenance"]
        "description": "Elevator maintenance",
        "status": "Closed",
        "datetimeOpen": 1644359400378,
        "datetimeClosed": 1645309497378,
        "datetimePermanent": 0,
        "votes": [
            "32"
        ],
        "__v": 0
    }
]

/app/outdoorIssue/:id

Request cURL

curl https://accessnav-api-git-ctine987.apps.cloudapps.unc.edu/app/outdoorIssue/:id

Response body

{
    "_id": "6242989036c1d86631672ab2",
    "avoidPolygon": [],
    "location": "Peabody Hall",
    "latitude": 35.91062629670515,
    "longitude": -79.05362209913692,
    "category": ["Maintenance"]
    "description": "Elevator maintenance",
    "status": "Closed",
    "datetimeOpen": 1644359400378,
    "datetimeClosed": 1645309497378,
    "datetimePermanent": 0,
    "votes": [
        "32"
    ],
    "__v": 0
}

/app/outdoorIssue/add

Request cURL

curl -X POST 'https://accessnav-api-git-ctine987.apps.cloudapps.unc.edu/app/outdoorIssue/add' -H "Content-type: application/json" -d '{
  "location": "Test Hall",
  "avoidPolygon": [],
  "latitude": 35.910172,
  "longitude": -79.050574,
  "category": ["Test"],
  "description": "Test outdoorIssue",
  "status": "Open",
  "datetimeOpen": 1658532213016,
  "datetimeClosed": 0,
  "datetimePermanent": 0,
  "votes": []
}'

Response body

{
    "msg": "successfully added outdoor issue",
    "data": {
        "location": "Test Hall",
        "avoidPolygon": [],
        "latitude": 35.910172,
        "longitude": -79.050574,
        "category": "Test",
        "description": "Test outdoorIssue",
        "status": "Open",
        "datetimeOpen": 1658532213016,
        "datetimeClosed": 0,
        "datetimePermanent": 0,
        "votes": [],
        "_id": "63ff69ea486ef1a08b20a22a",
        "__v": 0
    }
}

/app/outdoorIssue/update/:id

Request cURL

curl -X PATCH 'http://accessnav-api-git-ctine987.apps.cloudapps.unc.edu/app/outdoorIssue/update/:id' -H "Content-type: application/json" -d '{
    "datetimeClosed": 1659532213016,
    "votes": ["625843cae357724a2aa4d0ba"]
}'

Response body

{
    "msg": "successfully updated outdoor issue",
    "oldData": {
        "_id": "63ff69ea486ef1a08b20a22a",
        "location": "Test Hall",
        "avoidPolygon": [],
        "latitude":35.910172,
        "longitude": -79.050574,
        "category": ["Test"],
        "description": "Test outdoorIssue",
        "status": "Open",
        "datetimeOpen": 1658532213016,
        "datetimeClosed": 0,
        "datetimePermanent": 0,
        "votes": [],
        "__v": 0
    }
}

/app/outdoorIssue/delete/:id

Request cURL

curl -X DELETE https://accessnav-api-git-ctine987.apps.cloudapps.unc.edu/app/outdoorIssue/delete/:id

Response body

{
    "msg": "successfully deleted outdoor issue",
    "data": {
        "_id": "63e948b91f0bdf63525ca500",
        "location": "Test Hall",
        "avoidPolygon": [],
        "latitude":35.910172,
        "longitude": -79.050574,
        "category": ["Test"],
        "description": "Test outdoorIssue",
        "status": "Open",
        "datetimeOpen": 1658532213016,
        "datetimeClosed": 0,
        "datetimePermanent": 0,
        "votes": [
            "1"
        ],
        "__v": 0
    }
}