Public
Documentation Settings

The API

An API to track circadian rhythm.

Say goodbye to loading spreadsheets in the browser followed by manual data entry!

Built using Express.JS.

POSTInput data

localhost:3000/hourdata

Create new hourly data about the Circadian Rhythm.

HEADERS
Content-Type

application/json

Bodyraw
{
	"focus": 5,
	"energy": 5,
	"enthusiasm": 5
}
Example Request
curl
curl --location 'localhost:3000/hourdata' \
--header 'Content-Type: application/json' \
--data '{
	"focus": 5,
	"energy": 5,
	"enthusiasm": 5
}'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

GETRetrieve data

localhost:3000/hourdata/:id?hour=11

Retrieve hourly data about the Circadian Rhythm.

PARAMS
date

6-5-2019

[Optional] Hourly data by the date. Format: D-MM-YYYY (6-5-2019 or 15-11-2019)

hour

11

[Optional]

  • Hourly data by the hour. Format: 1-24 { 1 = 0000 to 0100 hours }, { 24 = 2300 - 2400 hours }
PATH VARIABLES
id

1

[Optional] The id of the hourly data present in the database

Example Request
curl
curl --location 'localhost:3000/hourdata/1?hour=11'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

GETRetrieve all data

localhost:3000/hourdata/?date=6-5-2019

Retrieve hourly data about the Circadian Rhythm.

HEADERS
Content-Type

application/json

PARAMS
date

6-5-2019

[Optional] Hourly data by the date. Format: D-MM-YYYY

hour

11

[Optional] Hourly data by the hour. Format: 1-24 { 1 = 0000 to 0100 hours }, { 24 = 2300 - 2400 hours }

Example Request
curl
curl --location 'localhost:3000/hourdata/?date=6-5-2019' \
--header 'Content-Type: application/json'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

DELETEDelete data

localhost:3000/hourdata/:id

Delete hourly data about the Circadian Rhythm.

HEADERS
Content-Type

application/json

PATH VARIABLES
id

1

[Optional] The id of the hourly data present in the database

Example Request
curl
curl --location --request DELETE 'localhost:3000/hourdata/1' \
--header 'Content-Type: application/json'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers