This repository has been archived by the owner on Sep 2, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
api
kakaka19 edited this page Jun 12, 2018
·
13 revisions
以下のAPIを提供する
status: 500
{
"error":{
"message": "サーバが正常に稼働していません。管理者にお問い合わせください。"
}
}
I/O
name | value |
---|---|
API | /register |
method | POST |
Request
Content-Type: application/json
{
"id": "sdfasdfasdf",
"user":{
"mail": "ta-low@hoge.ne.jsp",
"name": "土曜開放太郎"
}
}
Response
status: 200
{
"user":{
"mail": "ta-low@hoge.ne.jsp",
"name": "土曜開放太郎"
}
}
status: 400
{
"user":{
"mail": "ta-low@hoge.ne.jsp",
"name": "土曜開放太郎"
},
"error":{
"message": "あなたは登録済みです。"
}
}
I/O
name | value |
---|---|
API | /update |
method | POST(PUT) |
Request
Content-Type: application/json
{
"id": "{ICcard'sID}",
"user":{
"mail": "ta-low@hoge.ne.jsp"
}
}
Response
status: 200
{
"id": "{ICcard'sID}",
"user":{
"mail": "ta-low@hoge.ne.jsp"
}
}
status: 400
{
"id": "{ICcard'sID}",
"error":{
"message": "未登録のカードIDです。"
}
}
I/O
name | value |
---|---|
API | /entry |
method | POST |
Request
Content-Type: application/json
{
"id": "{ICcard'sID}",
"porpose": "勉強会 or 自習 or 仕事 or 遊び"
}
Response
status: 201
{
"id": "{ICcard'sID}",
"user": {
"name": "土曜開放太郎",
"isEntry": "true"(boolean)
}
}
I/O
name | value |
---|---|
API | /out |
method | POST(PUT) |
Request
Content-Type: application/json
{
"id": "{ICcard'sID}"
}
Response
status: 200
{
"id": "{ICcard'sID}",
"user": {
"name": "土曜開放太郎",
"isEntry": "false"(boolean)
}
}
I/O
name | value | repletion |
---|---|---|
API | /users/{:date} |
{:date} には日付(yyyymmdd)が入ります |
method | GET |
Response
入室時間で降順にソート。利用者が一人もいない場合は空の配列を返す。
status: 200
{
"users": [
{
"mail": "ta-low@hoge.ne.jsp",
"name": "hoge",
"purpose": "勉強会 or 自習 or 仕事 or 遊び",
"isEntry": "true/false",(boolean)
"workspace": {
"entry": "入室時刻",(long)
"exit": "退室時刻(しているなら)"(long)
}
},{
....
}
]
}
status: 500
{
"error":{
"message": "サーバが正常に稼働していません。管理者にお問い合わせください。"
}
}
I/O
name | value |
---|---|
API | /users |
method | GET |
Request
key | value |
---|---|
from | yyyymmdd |
to | yyyymmdd |
Response
status: 200
[
{
"mail": "ta-low@hoge.ne.jsp",
"name": "hoge",
"purpose": "work or study or meetUp or circle or other",
"isEntry": "true/false",(boolean)
"workspace": {
"entry": "入室時刻",(long)
"exit": "退室時刻(しているなら)"(long)
}
},{
....
}
]
I/O
name | value |
---|---|
API | /users/recent |
method | GET |
Request
なし
Response
status: 200
[
{
"mail": "ta-low@hoge.ne.jsp",
"name": "hoge",
"purpose": "work or study or meetUp or circle or other",
"isEntry": "true/false",(boolean)
"workspace": {
"entry": "入室時刻",(long)
"exit": "退室時刻(しているなら)"(long)
}
},{
....
}
]
I/O
name | value |
---|---|
API | /total/user/purpose |
method | GET |
Request
key | value |
---|---|
date | yyyymmdd |
order | desc/asc |
Response status: 200
[
{
"date": "yyyymmdd",(date)
"purpose" :{
"work": 19,(integer)
"study": 20,(integer)
"meetUp": 30,(integer)
"circle": 40s(integer)
}
},
{
...
}
]