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

Indoor Issue

Table of contents

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

/app/indoorIssue/all

Request cURL

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

Response body

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

/app/indoorIssue/:id

Request cURL

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

Response body

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

/app/indoorIssue/add

Request cURL

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

Response body

{
    "msg": "successfully added indoor issue",
    "data": {
        "location": "Test Hall",
        "category": "Test",
        "description": "Test indoorIssue",
        "status": "Open",
        "datetimeOpen": 1658532213016,
        "datetimeClosed": 0,
        "datetimePermanent": 0,
        "votes": [],
        "_id": "63ff69ea486ef1a08b20a22a",
        "__v": 0
    }
}

/app/indoorIssue/update/:id

Request cURL

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

Response body

{
    "msg": "successfully updated indoor issue",
    "oldData": {
        "_id": "63ff69ea486ef1a08b20a22a",
        "location": "Test Hall",
        "category": "Test",
        "description": "Test indoorIssue",
        "status": "Open",
        "datetimeOpen": 1658532213016,
        "datetimeClosed": 0,
        "datetimePermanent": 0,
        "votes": [],
        "__v": 0
    }
}

/app/indoorIssue/delete/:id

Request cURL

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

Response body

{
    "msg": "successfully deleted indoor issue",
    "data": {
        "_id": "63e948b91f0bdf63525ca500",
        "location": "Test Hall",
        "category": "Test",
        "description": "Test indoorIssue",
        "status": "Open",
        "datetimeOpen": 1658532213016,
        "datetimeClosed": 0,
        "datetimePermanent": 0,
        "votes": [
            "1"
        ],
        "__v": 0
    }
}