Skip to content

API Create Entry

Martin René Sørensen edited this page Sep 30, 2020 · 1 revision

POST /api/entry
To Create a entry with the API you can send a HTTP POST request to the path /api/entry.

Headers

Content-Type: application/json
Authorization: bearer <my-token>

Content / DTO

interface EntryPostDTO {
    sound: string;// numeric string
    temp: string;// numeric string
    light: string;// numeric string
    humidity: string;// numeric string
    celsius: string;// numeric string
    fahrenheit: string;// numeric string
    kelvin: string;// numeric string
}
Example:
{
    "sound": "24565",
    "temp": "0.850794",
    "light": "0.841758",
    "humidity": "55",
    "celsius": "24",
    "fahrenheit": "80.6",
    "kelvin": "300.15"
}

Response

{
    "id": "b29cfe0c-5d9a-49b8-9fcc-f94c1f862082",
    "sound": "0",
    "temp": "0.7831500000",
    "light": "1.0000000000",
    "humidity": "43.0000000000",
    "celsius": "25.0000000000",
    "fahrenheit": "77.0000000000",
    "kelvin": "298.1500000000",
    "token": "f2a3fbfb-912a-42ec-8c1c-7c6aec99a678",
    "created_at": "2020-09-24T13:53:58+0000",
    "updated_at": "2020-09-24T13:53:58+0000"
}