LICHeTofPrototype / web_app

webアプリ(試作)
0 stars 0 forks source link

APIの詳細設計 #9

Open napire223 opened 4 years ago

napire223 commented 4 years ago

iOS appとの連携と本格的な運用を考慮し,APIの詳細設計を行う.

napire223 commented 4 years ago

Resource URL

https://192.168.2.105/api/get_pnn/

Resource Information

Question Answer
request format json
Requires authentication? No
Rate limited? No

Parameters

name required Description default value Example
user_id required User's unique id 123
measurement_id required Measurement id for user which discriminate this measurement from others 123
required_index required API sends a response of the data which have bigger array-index of data than required_index 123

Example request

https://192.168.2.105/api/get_pnn/1/1/0/

Example response

[
    {
        "id": 99,
        "measurement": {
            "id": 1,
            "user": {
                "id": 1,
                "username": "napire",
                "first_name": "yuki",
                "last_name": "nakagawa",
                "login_count": 0
            },
            "location": "yokohama"
        },
        "pnn_time": 99.0,
        "pnn": 9801.0
    },
    {
        "id": 100,
        "measurement": {
            "id": 1,
            "user": {
                "id": 1,
                "username": "napire",
                "first_name": "yuki",
                "last_name": "nakagawa",
                "login_count": 0
            },
            "location": "yokohama"
        },
        "pnn_time": 100.0,
        "pnn": 10000.0
    }
]