Lamps API Documentation

Lamps is a API allowing administrators to view counts and mcc in them.

Allowed HTTPs requests:

PUT     : To create resource 
POST    : Update resource
GET     : Get a resource or list of resources
DELETE  : To delete resource

Description Of Usual Server Responses:

  • 200 OK - the request was successful (some API calls may return 201 instead).

  • 201 Created - the request was successful and a resource was created.

  • 204 No Content - the request was successful but there is no representation to return (i.e. the response is empty).

  • 400 Bad Request - the request could not be understood or was missing required parameters.

  • 401 Unauthorized - authentication failed or user doesn’t have permissions for requested operation.

  • 403 Forbidden - access denied.

  • 404 Not Found - resource was not found.

Lamp

Represents Lamp Details


Lamp attributes:

  • lamp_id (String) : unique identifier.

  • lamp_hash_id (String) : Hash identifier.

  • lamp_location ([Number]) : Lamp location.

  • lamp_deployed_date (Date) : optional.

  • lamp_wifi_ssid (String) : optional .

  • lamp_wifi_password (String) : optional .

  • place_id (Number) : deploy place id .

  • created_at (Timestamps) : – .

  • updated_at (Timestamps) : – .


Lamp Collection

GET https://mosquitokiller.csie.ncku.edu.tw/apis/lamps
Responses200404
Headers
Content-Type: application/json
Body
[
      {
        "lamp_id": "TEST01",
        "lamp_location": [120.19151248216, 22.9997144678771],
        "lamp_deployed_date": null,
        "place_id": 1,
      }, {
        "lamp_id": "TEST02",
        "lamp_location": [120.193272644465, 22.9963046536379],
        "lamp_deployed_date": null,
        "place_id": 1,
      }
]
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

List all lamps
GET/lamps


POST https://mosquitokiller.csie.ncku.edu.tw/apis/lamps
Requestsexample 1
Headers
Content-Type: application/json
Body
{
  "lamp_id": "TEST02",
  "lamp_location": [
    120,
    22
  ],
  "lamp_deployed_date": "2017-09-26",
  "lamp_wifi_ssid": "ssid",
  "lamp_wifi_password": "sspw",
  "place_id": 1
}
Responses201
Headers
Content-Type: application/json
Location: /lamps/TEST02
Body
{
  "lamp_id": "TEST02",
  "lamp_hash_id": "2345",
  "lamp_location": [
    120,
    22
  ],
  "lamp_deployed_date": "2017-09-26",
  "lamp_wifi_ssid": "ssid",
  "lamp_wifi_password": "sspw",
  "place_id": 1,
  "created_at": "2017-09-24T11:14:56.044Z",
  "updated_at": "2017-09-24T11:14:56.044Z"
}

Create a Lamp
POST/lamps


Lamp

A single Lamp object with all its details

GET https://mosquitokiller.csie.ncku.edu.tw/apis/lamps/TEST01?key=hash
Responses200404
Headers
Content-Type: application/json
Body
{
        "lamp_id": "TEST01",
        "lamp_location": [120.19151248216, 22.9997144678771],
        "lamp_deployed_date": null,
        "place_id": 1,
      }
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

Retrieve a Lamp
GET/lamps/{id}{?key}

URI Parameters
HideShow
id
String (required) Example: TEST01

id of the Lamp to perform action with.

key
String (optional) Example: hash

use ‘?key=hash’ <= Query by lamp_hash_id pre 6 char


PUT https://mosquitokiller.csie.ncku.edu.tw/apis/lamps/TEST01?key=hash
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "lamp_location": [120,22],
    "lamp_deployed_date": "2017-09-26",
    "lamp_wifi_ssid": "ssid",
    "lamp_wifi_password": "sspw",
    "place_id": 1,
 }
Responses200
Body
{
  "lamp_id": "TEST01",
  "lamp_hash_id": "2345",
  "lamp_location": [
    120,
    22
  ],
  "lamp_deployed_date": "2017-09-26",
  "lamp_wifi_ssid": "ssid",
  "lamp_wifi_password": "sspw",
  "place_id": 1,
  "created_at": "2017-09-24T11:14:56.044Z",
  "updated_at": "2017-09-24T11:14:56.044Z"
}

Update a Lamp
PUT/lamps/{id}{?key}

URI Parameters
HideShow
id
String (required) Example: TEST01

id of the Lamp to perform action with.

key
String (optional) Example: hash

use ‘?key=hash’ <= Query by lamp_hash_id pre 6 char


DELETE https://mosquitokiller.csie.ncku.edu.tw/apis/lamps/TEST01?key=hash
Responses204
This response has no content.

Delete a Lamp
DELETE/lamps/{id}{?key}

URI Parameters
HideShow
id
String (required) Example: TEST01

id of the Lamp to perform action with.

key
String (optional) Example: hash

use ‘?key=hash’ <= Query by lamp_hash_id pre 6 char


Place

Represents Place Details


Place attributes:

  • place_id (Number) : unique identifier.

  • place_name (String(25)) : Require.

  • place_address (String(50)) : Require.

  • place_contact_person (String(10)) : optional.

  • place_phone (String(25)) : optional .

  • created_at (Timestamps) : – .

  • updated_at (Timestamps) : – .


Place Collection

GET https://mosquitokiller.csie.ncku.edu.tw/apis/places
Responses200404
Headers
Content-Type: application/json
Body
[
  {
    "place_id": 1,
    "place_name": "成大幼兒園",
    "place_address": "台南市東區大學路1號",
    "place_contact_person": "張先生",
    "place_phone": "09xx-xxxxxx",
    "created_at": "2017-09-24T11:14:56.035Z",
    "updated_at": "2017-09-24T11:14:56.035Z"
  },
  {
    "place_id": 2,
    "place_name": "NETDB",
    "place_address": "台南市東區大學路1號",
    "place_contact_person": "楊先生",
    "place_phone": "09xx-xxxxxx",
    "created_at": "2017-09-24T11:14:56.044Z",
    "updated_at": "2017-09-24T11:14:56.044Z"
  }
]
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

List all places
GET/places


POST https://mosquitokiller.csie.ncku.edu.tw/apis/places
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "place_name": "資訊系館一樓",
    "place_address": "台南市東區大學路1號",
    "place_contact_person": "楊先生",
    "place_phone": "09xx-xxxxxx",
}
Responses201
Headers
Content-Type: application/json
Location: /places/3
Body
{
    "place_id": 3,
    "place_name": "資訊系館一樓",
    "place_address": "台南市東區大學路1號",
    "place_contact_person": "楊先生",
    "place_phone": "09xx-xxxxxx",
    "created_at": "2017-09-24T11:14:56.073Z",
    "updated_at": "2017-09-24T11:14:56.073Z",
}

Create a Place
POST/places


Place

A single Place object with all its details

GET https://mosquitokiller.csie.ncku.edu.tw/apis/places/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "place_id": 1,
  "place_name": "成大幼兒園",
  "place_address": "台南市東區大學路1號",
  "place_contact_person": "張先生",
  "place_phone": "09xx-xxxxxx",
  "created_at": "2017-09-24T11:14:56.035Z",
  "updated_at": "2017-09-24T11:14:56.035Z"
}
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

Retrieve a Place
GET/places/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


PUT https://mosquitokiller.csie.ncku.edu.tw/apis/places/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "place_name": "成大商家",
    "place_address": "台南市東區大學路1號",
    "place_contact_person": "林先生",
    "place_phone": "09xx-xxxxxx",
 }
Responses200
Body
{
  "place_id": 1,
  "place_name": "成大商家",
  "place_address": "台南市東區大學路1號",
  "place_contact_person": "林先生",
  "place_phone": "09xx-xxxxxx",
  "created_at": "2017-09-24T11:14:56.035Z",
  "updated_at": "2017-09-24T11:14:56.035Z"
}

Update a Place
PUT/places/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


DELETE https://mosquitokiller.csie.ncku.edu.tw/apis/places/1
Responses204
This response has no content.

Delete a Place
DELETE/places/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


Count

Represents Count Details


Count attributes:

  • count_id (Number) : unique identifier.

  • lamp_id (String(25)) : Require.

  • counts (Number) : Require.

  • created_at (Timestamps) : – .


Count Collection

GET https://mosquitokiller.csie.ncku.edu.tw/apis/counts?formatBy=date&lampHashID=9b3814&limit=7&lampID=KG0915-01
Responses200200200200200200404
Headers
Content-Type: application/json
Body
use /counts will return

[
      {
        "count_id": 1,
        "lamp_id": "TEST01",
        "counts": 1,
        "created_at": "2017-09-24T11:14:56.035Z",
      }, {
        "count_id": 2,
        "lamp_id": "TEST01",
        "counts": 2,
        "created_at": "2017-09-24T11:14:56.044Z",
      }
]
Headers
Content-Type: application/json
Body
use /counts?lampID=TEST01 will return

[
    {
        "count_id": 1,
        "lamp_id": "TEST01",
        "counts": 1,
        "created_at": "2017-09-24T11:14:56.035Z",
    }
]
Headers
Content-Type: application/json
Body
use /counts?lampHashID=9b3814 will return

[
    {
        "count_id": 1,
        "lamp_id": "9b3814",
        "counts": 1,
        "created_at": "2017-09-24T11:14:56.035Z",
    }
]
Headers
Content-Type: application/json
Body
use /counts?formatBy=date will return

{
    "2017-10-05": {
        "KG0915-02": {
            "lamp_id": "KG0915-02",
            "sum": "30",
            "date": "2017-10-05",
            "size": 0
        },
        "KG0915-03": {
            "lamp_id": "KG0915-03",
            "sum": "95",
            "date": "2017-10-05",
            "size": 0
        }
    },
    "2017-10-06": {
        "KG0915-02": {
            "lamp_id": "KG0915-02",
            "sum": "51",
            "date": "2017-10-06",
            "size": 0
        },
        "KG0915-03": {
            "lamp_id": "KG0915-03",
            "sum": "92",
            "date": "2017-10-06",
            "size": 0
        }
    }
}
Headers
Content-Type: application/json
Body
use /counts?formatBy=date&lampHashID=9b3814 will return

{
    "2017-10-05": {
        "9b3814": {
            "lamp_id": "9b3814",
            "sum": "30",
            "date": "2017-10-05",
            "size": 0
        }
    },
    "2017-10-06": {
        "9b3814": {
            "lamp_id": "9b3814",
            "sum": "51",
            "date": "2017-10-06",
            "size": 0
        }
    }
}
Headers
Content-Type: application/json
Body
use /counts?formatBy=hour&lampHashID=9b3814 will return

{
    "2017-10-05": {
        "8": {
            "sum": "30",
            "date": "2017-10-05",
            "hour": "8",
            "lamp_id":"9b3814"
        },
        "9": {
            "sum": "30",
            "date": "2017-10-05",
            "hour": "9",
            "lamp_id":"9b3814"
        }
    },
    "2017-10-06": {
        "1": {
            "sum": "30",
            "date": "2017-10-05",
            "hour": "8",
            "lamp_id":"9b3814"
        },
        "2": {
            "sum": "30",
            "date": "2017-10-05",
            "hour": "9",
            "lamp_id":"9b3814"
        }
    }
}
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

List all counts
GET/counts{?formatBy,lampHashID,limit,lampID}

URI Parameters
HideShow
formatBy
String (optional) Example: date

use ‘?formatBy=date’ <= Return data Group By date & lamp_id

lampHashID
String (optional) Example: 9b3814

use ‘?formatBy=hour&lampHashID=9b3814’ <= Return one lamp data Group By date & hour

limit
String (optional) Example: 7

user ‘?limit=7’ <= return past 7 days data. e.g. today 10/8, reutrn data from 10/1 00:00

lampID
String (optional) Example: KG0915-01

use ‘?formatBy=hour&lampID=KG0915-01’ <= Return one lamp data Group By date & hour


POST https://mosquitokiller.csie.ncku.edu.tw/apis/counts
Requestsexample 1
Headers
Content-Type: application/json
Body
{
        "lamp_id": "TEST01",
        "counts": 1,
}
Responses201
Headers
Content-Type: application/json
Location: /counts/3
Body
{
    "count_id": 3,
    "lamp_id": "TEST01",
    "counts": "1",
    "created_at": "2017-09-24T11:14:56.073Z",
}

Create a Count
POST/counts


Count

A single Count object with all its details

GET https://mosquitokiller.csie.ncku.edu.tw/apis/counts/1
Responses200404
Headers
Content-Type: application/json
Body
{
        "count_id": 1,
        "lamp_id": "TEST01",
        "counts": "1",
        "created_at": "2017-09-24T11:14:56.073Z",
}
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

Retrieve a Count
GET/counts/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


DELETE https://mosquitokiller.csie.ncku.edu.tw/apis/counts/1
Responses204
This response has no content.

Delete a Count
DELETE/counts/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


State

Represents State Details


State attributes:

  • state_id (Number) : unique identifier.

  • lamp_id (String(25)) : Require.

  • lamp_state (Number) : Require, 0~2.

  • lamp_check_date (Date) : optional.

  • lamp_check_person (String(10)) : optional.

  • state_description (TEXT) : optional .

  • state_reason TEXT) : optional .

  • created_at (Timestamps) : – .

  • updated_at (Timestamps) : – .


State Collection

GET https://mosquitokiller.csie.ncku.edu.tw/apis/states
Responses200404
Headers
Content-Type: application/json
Body
[
  {
    "state_id": 1,
    "lamp_id": "TEST01",
    "lamp_state": 2,
    "lamp_check_date": "2017-09-26",
    "lamp_check_person": "張同學",
    "state_description": "無法傳送訊息",
    "state_reason": "推測是晶片故障",
    "created_at": "2017-09-24T11:14:56.035Z",
    "updated_at": "2017-09-24T11:14:56.035Z"
  },
  {
    "state_id": 2,
    "lamp_id": "TEST02",
    "lamp_state": 1,
    "created_at": "2017-09-24T11:14:56.044Z",
    "updated_at": "2017-09-24T11:14:56.044Z"
  }
]
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

List all states
GET/states


POST https://mosquitokiller.csie.ncku.edu.tw/apis/states
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "lamp_id": "TEST01",
    "lamp_state": 1,
}
Responses201
Headers
Content-Type: application/json
Location: /states/3
Body
{
    "state_id": 3,
    "lamp_id": "TEST01",
    "lamp_state": 1,
    "created_at": "2017-09-24T11:14:56.073Z",
    "updated_at": "2017-09-24T11:14:56.073Z",
}

Create a State
POST/states


State

A single State object with all its details

GET https://mosquitokiller.csie.ncku.edu.tw/apis/states/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "state_id": 1,
  "lamp_id": "TEST01",
  "lamp_state": 2,
  "lamp_check_date": "2017-09-26",
  "lamp_check_person": "張同學",
  "state_description": "無法傳送訊息",
  "state_reason": "推測是晶片故障",
  "created_at": "2017-09-24T11:14:56.035Z",
  "updated_at": "2017-09-24T11:14:56.035Z"
}
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

Retrieve a State
GET/states/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


PUT https://mosquitokiller.csie.ncku.edu.tw/apis/states/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "lamp_state": 2,
    "lamp_check_date": "2017-09-27",
    "lamp_check_person": "張同學",
    "state_description": "燈不會亮",
    "state_reason": "捕蚊燈故障,更換捕蚊燈",
 }
Responses200
Body
{
  "state_id": 1,
  "lamp_id": "TEST01",
  "lamp_state": 2,
  "lamp_check_date": "2017-09-27",
  "lamp_check_person": "張同學",
  "state_description": "燈不會亮",
  "state_reason": "捕蚊燈故障,更換捕蚊燈",
  "created_at": "2017-09-24T11:14:56.035Z",
  "updated_at": "2017-09-24T11:14:56.035Z"
}

Update a State
PUT/states/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


DELETE https://mosquitokiller.csie.ncku.edu.tw/apis/states/1
Responses204
This response has no content.

Delete a State
DELETE/states/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


Mcc

Represents Mcc Details


Mcc attributes:

  • mcc_id (Number) : unique identifier.

  • mcc_keys ([String(25)]) : Require.

  • mcc_points ([String(25)]) : Require.

  • mcc_center (Double) : Require.

  • rule_id (Number) : Require.

  • created_at (Timestamps) : – .


Mcc Collection

GET https://mosquitokiller.csie.ncku.edu.tw/apis/mcc
Responses200404
Headers
Content-Type: application/json
Body
[
  {
    "mcc_id": 1,
    "mcc_keys": [
      "TEST01",
      "TEST02"
    ],
    "mcc_points": [
      "TEST01",
      "TEST02"
    ],
    "mcc_center": [
      120.192393,
      22.9980096
    ],
    "rule_id": 1,
    "created_at": "2017-09-24T11:14:56.073Z"
  }
]
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

List all mcc
GET/mcc


POST https://mosquitokiller.csie.ncku.edu.tw/apis/mcc
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "mcc_keys": ["TEST01", "TEST02"],
    "mcc_points": ["TEST01", "TEST02", "TEST03"],
    "mcc_center": [120.192393, 22.9980096],
    "rule_id": 1,
}
Responses201
Headers
Content-Type: application/json
Location: /mcc/2
Body
{
    "mcc_id": 2,
    "mcc_keys": ["TEST01", "TEST02"],
    "mcc_points": ["TEST01", "TEST02", "TEST03"],
    "mcc_center": [120.192393, 22.9980096],
    "rule_id": 1,
    "created_at": "2017-09-24T11:14:56.073Z",
}

Create a Mcc
POST/mcc


Mcc

A single Mcc object with all its details

GET https://mosquitokiller.csie.ncku.edu.tw/apis/mcc/1
Responses200404
Headers
Content-Type: application/json
Body
{
        "mcc_id": 1,
        "mcc_keys": ["TEST01", "TEST02"],
        "mcc_points": ["TEST01", "TEST02"],
        "mcc_center": [120.192393, 22.9980096],
        "rule_id": 1,
        "created_at": "2017-09-24T11:14:56.035Z",
}
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

Retrieve a Mcc
GET/mcc/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


DELETE https://mosquitokiller.csie.ncku.edu.tw/apis/mcc/1
Responses204
This response has no content.

Delete a Mcc
DELETE/mcc/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


Rules

Represents Rules Details


Rules attributes:

  • rule_id (Number) : unique identifier.

  • timeline_upper_limit (Number) : Require.

  • distance_lower_limit (Number) : Require.

  • points_lower_limit (Number) : Require.

  • counts_lower_limit (Number) : Require.

  • created_at (Timestamps) : – .

  • updated_at (Timestamps) : – .


Rules Collection

GET https://mosquitokiller.csie.ncku.edu.tw/apis/rules
Responses200404
Headers
Content-Type: application/json
Body
[
  {
    "rule_id": 1,
    "timeline_upper_limit": 3,
    "distance_lower_limit": 500,
    "points_lower_limit": 5,
    "counts_lower_limit": 20,
    "created_at": "2017-09-24T11:14:56.066Z",
    "updated_at": "2017-09-24T11:14:56.066Z"
  }
]
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

List all rules
GET/rules


POST https://mosquitokiller.csie.ncku.edu.tw/apis/rules
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "timeline_upper_limit": 3,
    "distance_lower_limit": 500,
    "points_lower_limit": 5,
    "counts_lower_limit": 20,
}
Responses201
Headers
Content-Type: application/json
Location: /rules/3
Body
{
  "rule_id": 3,
  "timeline_upper_limit": 3,
  "distance_lower_limit": 500,
  "points_lower_limit": 5,
  "counts_lower_limit": 20,
  "created_at": "2017-09-24T11:14:56.066Z",
  "updated_at": "2017-09-24T11:14:56.066Z"
}

Create a Rules
POST/rules


Rules

A single Rules object with all its details

GET https://mosquitokiller.csie.ncku.edu.tw/apis/rules/1
Responses200404
Headers
Content-Type: application/json
Body
{
  "rule_id": 1,
  "timeline_upper_limit": 3,
  "distance_lower_limit": 500,
  "points_lower_limit": 5,
  "counts_lower_limit": 20,
  "created_at": "2017-09-24T11:14:56.066Z",
  "updated_at": "2017-09-24T11:14:56.066Z"
}
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

Retrieve a Rules
GET/rules/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


PUT https://mosquitokiller.csie.ncku.edu.tw/apis/rules/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "timeline_upper_limit": 3,
    "distance_lower_limit": 500,
    "points_lower_limit": 10,
}
Responses200
Body
{
  "rule_id": 1,
  "timeline_upper_limit": 3,
  "distance_lower_limit": 500,
  "points_lower_limit": 10,
  "counts_lower_limit": 20,
  "created_at": "2017-09-24T11:14:56.066Z",
  "updated_at": "2017-09-24T11:14:56.066Z"
}

Update a Rules
PUT/rules/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


DELETE https://mosquitokiller.csie.ncku.edu.tw/apis/rules/1
Responses204
This response has no content.

Delete a Rules
DELETE/rules/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


Comments

Represents Comments Details


Comments attributes:

  • comments_id (Number) : unique identifier.

  • lamp_id (Number) : Require.

  • comment_content (Text) : Require.

  • created_at (Timestamps) : – .


Comments Collection

GET https://mosquitokiller.csie.ncku.edu.tw/apis/comments
Responses200404
Headers
Content-Type: application/json
Body
[{
    "comments_id": 1,
    "lamp_id": "TEST01",
    "comment_content": "我不會用",
    "created_at": "2017-09-24T11:14:56.066Z",
}]
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

List all comments
GET/comments


POST https://mosquitokiller.csie.ncku.edu.tw/apis/comments
Requestsexample 1
Headers
Content-Type: application/json
Body
lamp_id should be 6 characters lamp_hash_id

{
    "lamp_id": "9b3814",
    "comment_content": "我不會用",
}
Responses201
Headers
Content-Type: application/json
Location: /comments/3
Body
{
    "comments_id": 3,
    "lamp_id": "TEST01",
    "comment_content": "我不會用",
    "created_at": "2017-09-24T11:14:56.066Z",
}

Create a Comments
POST/comments


Comments

A single Comments object with all its details

GET https://mosquitokiller.csie.ncku.edu.tw/apis/comments/1
Responses200404
Headers
Content-Type: application/json
Body
{
        "comments_id": 1,
        "lamp_id": "TEST01",
        "comment_content": "我不會用",
        "created_at": "2017-09-24T11:14:56.066Z",
}
Headers
Content-Type: application/json
Body
{
  "error": "not found"
}

Retrieve a Comments
GET/comments/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


PUT https://mosquitokiller.csie.ncku.edu.tw/apis/comments/1
Requestsexample 1
Headers
Content-Type: application/json
Body
{
    "comment_content": "我還是不會用",
 }
Responses200
Body
{
    "comments_id": 1,
    "lamp_id": "TEST01",
    "comment_content": "我還是不會用",
    "created_at": "2017-09-24T11:14:56.066Z",
}

Update a Comments
PUT/comments/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


DELETE https://mosquitokiller.csie.ncku.edu.tw/apis/comments/1
Responses204
This response has no content.

Delete a Comments
DELETE/comments/{id}

URI Parameters
HideShow
id
Number (required) Example: 1

Numeric id of the User to perform action with.


Generated by aglio on 01 Dec 2017