{"mock":"https://private-anon-dce1f9619b-cameratraptw.apiary-mock.com/api/v1/","production":"https://api-dev.camera-trap.tw/api/v1/","proxy":"https://private-anon-dce1f9619b-cameratraptw.apiary-proxy.com/api/v1/"}
FORMAT: 1A HOST: https://api-dev.camera-trap.tw/api/v1 # api.camera-trap.tw CameraTrap.TW is a repository for automatic biodiversity monitoring. # Status Code - 200 成功。 - 204 成功且不回覆內容,用於回覆 cross site access 的 OPTIONS request,以及 DELETE request。 - 400 表單驗證失敗,前端必須在發送前驗證使用者的輸入,後端返回訊息僅供開發使用。 - 401 未登入,前端可顯示需登入提示或直接轉跳到 oauthUrl 進行登入。 - 403 已登入,但仍然沒有權限,如存取自己沒有權限的計畫,或用計畫執行者權限編輯常見物種...等。 - 404 找不到,網址錯誤或資源不存在。 - 500 後端發生錯誤。 # Time Format 資料傳輸一律使用 ISO 8601 UTC 時區 `2019-01-01T00:00:00.000Z`。 僅 CSV 匯出、匯入時使用設定檔的預設時區 GMT+8。 # Location 經緯度前端空間資訊呈現僅使用 WGS84,故資料來源需要注意原始大地基準,若為 TWD97 則應該在提供給前端時轉換為 WGS84。 請尋找類似的程式:https://github.com/yichunsung/trans97.js # Group System ## Configuration [/config] ### Retrieve configuration [GET /config] - No permission required. + Request Get system configuration (application/json) + Response 200 (application/json) + Body { "languages": { "zh-TW": { "title": "繁體中文" } }, "oauthUrl": "https://orcid.org/oauth/authorize?client_id=APP-J9YGHZ0YL4KAMGKV&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fcallback%2Forcid%2Fauth&response_type=code&scope=%2Fauthenticate" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "language": { "type": "object", "description": "目前支援的語系", "properties": { "zh-TW": { "type": "object", "description": "繁體中文", "properties": { "title": { "type": "string" } } } } }, "oauthUrl": { "type": "string", "description": "登入網址,前端將瀏覽器轉跳到此網址讓使用者進行登入程序。登入完成後使用者會導回前端網址,前端網址在 [camera-trap-credentials](https://github.com/TaiBIF/camera-trap-credentials/blob/master/default.js#L1) 設定" } } } ## Announcements [/system-announcements] - No permission required. ### Retrieve notification [GET /system-announcements{?index,size,sort}] 取得系統公告。 + Parameters + index: `0` (number, optional) - The index number. + Default: 0 + size: `20` (number, optional) - The size of the response (1~100). + Default: 20 + sort: `-createTime` (enum[string], optional) ... + Default: `-createTime` + Members + `createTime` + `-createTime` + Request Get system announcements (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 20, "total": 1, "items": [ { "id": "5ccbb9f80d9091a83c7f0593", "type": "system", "message": { "zh-TW": "緊急通知:2019/05/30 下午10點緊急維修,系統暫停使用" }, "createTime": "2019-05-02T02:45:58.242Z" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID." }, "type": { "type": "string" }, "message": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "The message in Traditional Chinese." } } }, "createTime": { "type": "string", "format": "date-time", "description": "Session create time." } } } } } } # Group Account ## Profile [/me] ### Retrieve profile [GET /me] + Request Get my profile (application/json) + Response 200 (application/json) + Body { "id": "5c949bbbe5d5377f98c81ab0", "name": "Your Name", "email": "email@example.com", "permission": "general-account", "hotkeys": [ { "species": { "id": "5cd661e332a98b60839c6caa", "title": { "zh-TW": "空拍" }, "code": "empty-shot" }, "hotkey": "P" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "permission": { "type": "string", "enum": ["administrator", "general-account"] }, "hotkeys": { "type": "array", "item": { "type": "object", "properties": { "species": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string" } } } } }, "hotkey": { "type": "string" } } } } } } ## Update profile [PUT /me] - The user's permission should be 'administrator' or 'general-account'. + Request Update my profile (application/json) + Body { "name": "Your Name", "email": "email@example.com", "hotkeys": [ { "species": "5cd661e332a98b60839c6caa", "hotkey": "P" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "name": { "type": "string" }, "email": { "type": "string", "format": "idn-email" }, "hotkeys": { "type": "array", "item": { "type": "object", "properties": { "species": { "type": "string" }, "hotkey": { "type": "string" } } } } } } + Response 200 (application/json) + Body { "id": "5c949bbbe5d5377f98c81ab0", "name": "Your Name", "email": "email@example.com", "permission": "general-account", "hotkeys": [ { "species": { "id": "5cd661e332a98b60839c6caa", "title": { "zh-TW": "空拍" }, "code": "empty-shot" }, "hotkey": "P" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string", "format": "idn-email" }, "permission": { "type": "string", "enum": ["administrator", "general-account"] }, "hotkeys": { "type": "array", "item": { "type": "object", "properties": { "species": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string" } } } } }, "hotkey": { "type": "string" } } } } } } ## Upload sessions [/me/upload-sessions] ### Retrieve upload sessions [GET /me/upload-sessions{?index,size,sort}] 取得上傳紀錄。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + index: `0` (number, optional) - The index number. + Default: 0 + size: `100` (number, optional) - The size of the response (1~100). + Default: 100 + sort: `-createTime` (enum[string], optional) ... + Default: `-createTime` + Members + `createTime` + `-createTime` + Request Get upload sessions (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 1, "items": [ { "id": "5ca996477242134e2593331d", "state": "failure", "errorType": "lost-exif-time", "project": { "id": "5c9af1d2403d37067adadbc5", "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ "5c9af16a4ee1b606477f9236" ], "coverImageFile": "5c9b1dfafc43be12b823b7b2", "members": [ { "user": "5c949bbbe5d5377f98c81ab0", "role": "manager" }, { "user": "5ca570886ee6391d81fd773e", "role": "researcher" } ], "dataFields": [ "5c9af16a4ee1b606477f9229", "5c9af16a4ee1b606477f922a", "5c9af16a4ee1b606477f922b", "5c9af16a4ee1b606477f922c", "5c9af16a4ee1b606477f922d", "5c9af16a4ee1b606477f9231" ], "dailyTestTime": "13:00:00" }, "cameraLocation": { "id": "5c9f28070d9cee99f8a11a12", "studyArea": { "id": "5c9d95acea5c9b4036d97c88", "title": { "zh-TW": "titleX" }, "parent": { "id": "5c9d9428e7462d3d989cb69b", "title": { "zh-TW": "title" } } }, "name": "PT02A", "settingTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型" }, "file": { "id": "5ca996477242134e2593331c", "type": "annotation-image", "originalFilename": "IMG_1073.JPG", "filename": "5ca996477242134e2593331c.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/annotation-images/5ca996477242134e2593331c.jpg", "size": 1609437 }, "createTime": "2019-04-07T06:18:47.234Z" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string", "description": "The session ID." }, "state": { "type": "string", "enum": [ "processing", "wait-for-review", "cancel", "success", "failure" ] }, "errorType": { "type": "string", "enum": [ "lost-exif-time", "inconsistent-quantity", "images-and-csv-not-match", "permission-denied", "others" ] }, "project": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime": { "type": "Date", "description": "計畫時間(開始)" }, "endTime": { "type": "Date", "description": "計畫時間(結束)" }, "areas": { "type": "array", "description": "計畫地區", "item": { "title": "id", "type": "string" } }, "coverImageFile": { "type": "string", "description": "封面檔案 ID" }, "members": { "type": "array", "description": "計畫成員", "item": { "type": "object", "properties": { "user": { "type": "string", "description": "成員 ID" }, "role": { "type": "string", "description": "計畫管理員, 計畫研究員, 計畫執行者", "enum": [ "manager", "researcher", "executor" ] } } } }, "dataFields": { "type": "array", "description": "資料欄位", "item": { "type": "string", "description": "欄位名稱" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。<br/>此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。", "enum": [ "null", "" ] } } }, "cameraLocation": { "type": "object", "properties": { "id": { "type": "string", "description": "The camera location ID." }, "studyArea": { "type": "object", "properties": { "id": { "type": "string", "description": "The study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "The study area title in Traditional Chinese." } } }, "parent": { "type": "object", "properties": { "id": { "type": "string", "description": "The affiliating study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "The affiliating study area title in Traditional Chinese." } } } } } } }, "name": { "type": "string", "description": "相機位置編號如 PT02A。" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" } } }, "file": { "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": [ "project-cover-image", "annotation-image" ] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." } } }, "createTime": { "type": "string", "format": "date-time", "description": "Session create time." } } } } } } ### Get the upload session [GET /me/upload-sessions/{uploadSessionId}] 取得上傳紀錄。 - The user's permission should be 'administrator' or 'general-account'. - The user should be the creator of this upload session. + Parameters + uploadSessionId: `5cc932399628d9ac0c1aa3a4` (string) - The upload session id. + Request Get the upload session (application/json) + Response 200 (application/json) + Body { "id": "5ca996477242134e2593331d", "state": "failure", "errorType": "lost-exif-time", "project": { "id": "5c9af1d2403d37067adadbc5", "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ "5c9af16a4ee1b606477f9236" ], "coverImageFile": "5c9b1dfafc43be12b823b7b2", "members": [ { "user": "5c949bbbe5d5377f98c81ab0", "role": "manager" }, { "user": "5ca570886ee6391d81fd773e", "role": "researcher" } ], "dataFields": [ "5c9af16a4ee1b606477f9229", "5c9af16a4ee1b606477f922a", "5c9af16a4ee1b606477f922b", "5c9af16a4ee1b606477f922c", "5c9af16a4ee1b606477f922d", "5c9af16a4ee1b606477f9231" ], "dailyTestTime": "13:00:00" }, "cameraLocation": { "id": "5c9f28070d9cee99f8a11a12", "studyArea": { "id": "5c9d95acea5c9b4036d97c88", "title": { "zh-TW": "titleX" }, "parent": { "id": "5c9d9428e7462d3d989cb69b", "title": { "zh-TW": "title" } } }, "name": "PT02A", "settingTime": "2019-01-01T00:00:00.000Z", "retireTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "geodeticDatum": "WGS84", "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "verbatimLocality": "傾斜屋對面產道,小池旁", "remarks": "備註" }, "file": { "id": "5ca996477242134e2593331c", "type": "annotation-image", "originalFilename": "IMG_1073.JPG", "filename": "5ca996477242134e2593331c.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/annotation-images/5ca996477242134e2593331c.jpg", "size": 1609437 }, "createTime": "2019-04-07T06:18:47.234Z" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "The session ID." }, "state": { "type": "string", "enum": [ "processing", "wait-for-review", "cancel", "success", "failure" ] }, "errorType": { "type": "string", "enum": [ "lost-exif-time", "inconsistent-quantity", "images-and-csv-not-match", "permission-denied", "others" ] }, "project": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime": { "type": "Date", "description": "計畫時間(開始)" }, "endTime": { "type": "Date", "description": "計畫時間(結束)" }, "areas": { "type": "array", "description": "計畫地區", "item": { "title": "id", "type": "string" } }, "coverImageFile": { "type": "string", "description": "封面檔案 ID" }, "members": { "type": "array", "description": "計畫成員", "item": { "type": "object", "properties": { "user": { "type": "string", "description": "成員 ID" }, "role": { "type": "string", "description": "計畫管理員, 計畫研究員, 計畫執行者", "enum": [ "manager", "researcher", "executor" ] } } } }, "dataFields": { "type": "array", "description": "資料欄位", "item": { "type": "string", "description": "欄位名稱" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。<br/>此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。", "enum": [ "null", "" ] } } }, "cameraLocation": { "type": "object", "properties": { "id": { "type": "string", "description": "The camera location ID." }, "studyArea": { "type": "object", "properties": { "id": { "type": "string", "description": "The study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "The study area title in Traditional Chinese." } } }, "parent": { "type": "object", "properties": { "id": { "type": "string", "description": "The affiliating study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "The affiliating study area title in Traditional Chinese." } } } } } } }, "name": { "type": "string", "description": "相機位置編號如 PT02A。" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" } } }, "file": { "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": [ "project-cover-image", "annotation-image" ] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." } } }, "createTime": { "type": "string", "format": "date-time", "description": "Session create time." } } } ### Cancel the upload session [POST /me/upload-sessions/{uploadSessionId}/_cancel] 取消等待確認是否複寫標註的上傳紀錄。 - The user's permission should be 'administrator' or 'general-account'. - The user should be the creator of this upload session. + Parameters + uploadSessionId: `5cc932399628d9ac0c1aa3a4` (string) - The upload session id. + Request Cancel the upload session (application/json) + Response 200 (application/json) + Body { "id": "5cc9a4d4b69a35e2043dbb02", "state": "cancel", "project": "5c9af1d2403d37067adadbc5", "cameraLocation": "5cbc125b431eb3db39702744", "file": "5cc9a4d4b69a35e2043dbb01", "createTime": "2019-05-01T13:53:24.269Z" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "The upload session id." }, "state": { "type": "string", "enum": [ "processing", "wait-for-review", "cancel", "success", "failure" ] }, "project": { "type": "string", "description": "The project id." }, "cameraLocation": { "type": "string", "description": "The camera location id." }, "file": { "type": "string", "description": "The file id." }, "createTime": { "type": "string" } } } ### Overwrite annotations of the upload session [POST /me/upload-sessions/{uploadSessionId}/_overwrite] 確認複寫上傳紀錄的標註。 - The user's permission should be 'administrator' or 'general-account'. - The user should be the creator of this upload session. + Parameters + uploadSessionId: `5cc932399628d9ac0c1aa3a4` (string) - The upload session id. + Request Overwrite annotations of the upload session (application/json) + Response 200 (application/json) + Body { "id": "5cc9a4d4b69a35e2043dbb02", "state": "success", "project": "5c9af1d2403d37067adadbc5", "cameraLocation": "5cbc125b431eb3db39702744", "file": "5cc9a4d4b69a35e2043dbb01", "createTime": "2019-05-01T13:53:24.269Z" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "The upload session id." }, "state": { "type": "string", "enum": [ "processing", "wait-for-review", "cancel", "success", "failure" ] }, "project": { "type": "string", "description": "The project id." }, "cameraLocation": { "type": "string", "description": "The camera location id." }, "file": { "type": "string", "description": "The file id." }, "createTime": { "type": "string" } } } ## Notifications [/me/notifications] ### Retrieve my notification [GET /me/notifications{?index,size,sort,isRead}] 取得通知。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + index: `0` (number, optional) - The index number. + Default: 0 + size: `20` (number, optional) - The size of the response (1~100). + Default: 20 + sort: `-createTime` (enum[string], optional) ... + Default: `-createTime` + Members + `createTime` + `-createTime` + isRead: `false` (enum[string], optional) - `false` means fetch unread notifications. + Members + `true` + `false` + Request Get my notifications (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 20, "total": 1, "items": [ { "id": "5cc9468f75ad8cb7e8eea934", "type": "data-field-application", "isRead": true, "dataField": { "id": "5cc9468f75ad8cb7e8eea933", "state": "wait-for-review", "title": { "zh-TW": "for testing notifications" }, "widgetType": "text", "description": { }, "options": [ ] }, "sender": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example.com", "permission": "administrator" }, "createTime": "2019-05-01T07:11:11.552Z" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string", "description": "The notification ID." }, "type": { "type": "string", "enum": [ "upload-success", "upload-failure'", "data-field-application", "data-field-approved", "new-camera-location-abnormality", "new-issue", "new-suggestion" ] }, "isRead": { "type": "boolean" }, "dataField": { "type": "object", "properties": { "id": { "type": "string" }, "systemCode": { "type": "string", "description": "樣區" }, "title": { "type": "object", "properties": { "zh-TW": "string", "description": "繁體中文樣區名稱" } }, "widgetType": { "type": "string", "enum": [ "select" ] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文相機位置名稱" } } }, "options": { "type": "array" } } }, "issue": { "type": "object", "properties": { "id": { "type": "string", "description": "The issue ID." } } }, "cameraLocationAbnormality": { "type": "object", "properties": { "id": { "type": "string", "description": "The ID." }, "project": { "type": "object", "properties": { "id": { "type": "string" } } }, "cameraLocation": { "type": "object", "properties": { "studyArea": { "type": "object", "properties": { "id": { "type": "string" }, "parent": { "type": "object" } } } } } } }, "uploadSession": { "type": "object", "properties": { "id": { "type": "string", "description": "The upload session ID." }, "state": { "type": "string", "enum": [ "processing", "wait-for-review", "cancel", "success", "failure" ] }, "errorType": { "type": "string", "enum": [ "lost-exif-time", "inconsistent-quantity", "images-and-csv-not-match", "permission-denied", "others" ] }, "project": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime": { "type": "Date", "description": "計畫時間(開始)" }, "endTime": { "type": "Date", "description": "計畫時間(結束)" }, "areas": { "type": "array", "description": "計畫地區", "item": { "title": "id", "type": "string" } }, "coverImageFile": { "type": "string", "description": "封面檔案 ID" }, "members": { "type": "array", "description": "計畫成員", "item": { "type": "object", "properties": { "user": { "type": "string", "description": "成員 ID" }, "role": { "type": "string", "description": "計畫管理員, 計畫研究員, 計畫執行者", "enum": [ "manager", "researcher", "executor" ] } } } }, "dataFields": { "type": "array", "description": "資料欄位", "item": { "type": "string", "description": "欄位名稱" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。<br/>此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。", "enum": [ "null", "" ] } } }, "cameraLocation": { "type": "object", "properties": { "id": { "type": "string", "description": "The camera location ID." }, "studyArea": { "type": "object", "properties": { "id": { "type": "string", "description": "The study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "The study area title in Traditional Chinese." } } }, "parent": { "type": "object", "properties": { "id": { "type": "string", "description": "The affiliating study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "The affiliating study area title in Traditional Chinese." } } } } } } }, "name": { "type": "string", "description": "相機位置編號如 PT02A。" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" } } }, "file": { "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": [ "project-cover-image", "annotation-image" ] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." } } }, "createTime": { "type": "string", "format": "date-time", "description": "Session create time." } } } } } } } } ### Set `isRead` of all notifications as `true` [POST /me/notifications/_read] 將所有通知變更為已讀。 - The user's permission should be 'administrator' or 'general-account'. + Request Set `isRead` of all notifications as `true` (application/json) + Response 204 (application/json) ## Logout [/logout] ### Log out [POST /logout] - The user's permission should be 'administrator' or 'general-account'. + Request Logout (application/json) + Response 204 # Group Users ## Search users [/users] ### Search users [GET /users{?user}] 檢查帳號是否存在。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + user: `email@example.com` (string) - 使用帳號 orcid 或 email 搜尋 + Request Get users (application/json) + Response 200 + Body { "index": 0, "size": 100, "total": 1, "items": [ { "id": "5c9f28070d9cee99f8a11a12", "name": "user name", "email": "email@example.com", "permission": "general-account" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "名稱" }, "email": { "type": "string", "description": "電子信箱" }, "permission": { "type": "string", "description": "權限", "enum": ["administrator", "general-account"] } } } } } } # Group Projects ## Overview [/projects] ### List projects [GET /projects{?index,size,sort}] 取得計畫列表。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects. + Parameters + index: `0` (number, optional) - The page index. + Default: 0 + size: `100` (number, optional) - The size of the result set (1~100). + Default: 24 + sort: `oldestAnnotationTime` (enum[string], optional) ... + Default: `oldestAnnotationTime` + Members + `oldestAnnotationTime` + `latestAnnotationTime` + `funder` + `title` + Request Get projects (application/json) + Response 200 + Body { "index": 0, "size": 24, "total": 1, "items": [ { "id": "5c99e565fa899867c32377cf", "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ "5c9af16a4ee1b606477f9236" ], "description": "計畫摘要", "note": "備註", "coverImageFile": { "id": "5c9b1dfafc43be12b823b7b2", "type": "project-cover-image", "originalFilename": "432x324c.jpg", "filename": "5c9b1dfafc43be12b823b7b2.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/project-covers/5c9b1dfafc43be12b823b7b2.jpg", "size": 26172 }, "publishTime": "2029-01-01T00:00:00.000Z", "interpretiveDataLicense": "cc0", "identificationInformationLicense": "by", "videoMaterialLicense": "by", "members": [ { "user": "5c949bbbe5d5377f98c81ab0", "role": "manager" } ], "dataFields": ["5c99bece337ea758248ffd5b"], "dailyTestTime": "13:00:00", "latestAnnotationTime": "2019-01-01T00:00:00.000Z", "oldestAnnotationTime": "2019-01-01T00:00:00.000Z" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "number", "description": "The page index." }, "size": { "type": "number", "description": "The page size." }, "total": { "type": "number", "description": "Total of all documents." }, "items": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime": { "type": "Date", "description": "計畫時間(開始)" }, "endTime": { "type": "Date", "description": "計畫時間(結束)" }, "areas": { "type": "array", "description": "計畫地區", "item": { "title": "id", "type": "string" } }, "description": { "type": "string", "description": "計畫摘要" }, "note": { "type": "string", "description": "備註" }, "coverImageFile": { "type": "object", "description": "計畫封面圖片檔案,物件內容參照 FileModel", "properties": { "id": { "type": "string", "description": "File id string" }, "type": { "type": "string", "description": "影像類型", "enum": ["project-cover-image"] }, "originalFilename": { "type": "string", "description": "原始檔案名" }, "filename": { "type": "string", "description": "系統編碼後之檔案名稱" }, "url": { "type": "string", "description": "公開存取網址" }, "size": { "type": "integer", "description": "File size in byte." } } }, "publishTime": { "type": "string", "format": "data-time", "description": "公開日期" }, "interpretiveDataLicense": { "type": "string", "description": "詮釋資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "identificationInformationLicense": { "type": "string", "description": "鑑定資訊創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "videoMaterialLicense": { "type": "string", "description": "影像資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "members": { "type": "array", "description": "計畫成員", "item": { "type": "object", "properties": { "user": { "type": "string", "description": "成員 ID" }, "role": { "type": "string", "description": "計畫管理員, 計畫研究員, 計畫執行者", "enum": ["manager", "researcher", "executor"] } } } }, "dataFields": { "type": "array", "description": "資料欄位", "item": { "type": "string", "description": "欄位名稱" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。<br/>此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。", "enum": ["null", ""] }, "latestAnnotationTime": { "type": "string", "format": "date-time", "description": "資料最後更新時間" }, "oldestAnnotationTime": { "type": "string", "format": "data-time", "description": "資料起始年份" } } } } } } ## Create a project [POST /projects] 新增計畫。 - The user's permission should be 'administrator' or 'general-account'. + Request Create a project (application/json) + Body { "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ "5c9af16a4ee1b606477f9236" ], "description": "計畫摘要", "note": "備註", "coverImageFile": "5c9b1dfafc43be12b823b7b2", "publishTime": "2029-01-01T00:00:00.000Z", "interpretiveDataLicense": "cc0", "identificationInformationLicense": "by", "videoMaterialLicense": "by" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "title": { "type": "string", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime" : { "type": "string", "format": "date-time", "description": "計畫時間(開始)" }, "endTime": { "type": "string", "format": "date-time", "description": "計畫時間(結束)" }, "areas": { "type": "array", "item": { "type": "string", "description": "計畫地區 ProjectAreaModel 的 id" } }, "description": { "type": "string", "description": "計畫摘要" }, "note": { "type": "string", "description": "備註" }, "coverImageFile": { "type": "string", "description": "計畫封面圖片檔案 id 內容為 FileModel 的 id" }, "publishTime": { "type": "string", "format": "data-time", "description": "公開日期" }, "interpretiveDataLicense": { "type": "string", "description": "詮釋資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "identificationInformationLicense": { "type": "string", "description": "鑑定資訊創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "videoMaterialLicense": { "type": "string", "description": "影像資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false } }, "required": ["title", "shortTitle", "funder", "code", "principalInvestigator", "startTime", "endTime"] } + Response 200 + Body { "id": "5c99e565fa899867c32377cf", "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ { "id": "5c9af16a4ee1b606477f9236", "title": { "zh-TW": "台北市", "en-US": "Taipei City" } } ], "description": "計畫摘要", "note": "備註", "coverImageFile": { "id": "5c9b1dfafc43be12b823b7b2", "type": "project-cover-image", "originalFilename": "432x324c.jpg", "filename": "5c9b1dfafc43be12b823b7b2.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/project-covers/5c9b1dfafc43be12b823b7b2.jpg", "size": 26172 }, "publishTime": "2029-01-01T00:00:00.000Z", "interpretiveDataLicense": "cc0", "identificationInformationLicense": "by", "videoMaterialLicense": "by", "members": [ { "user": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example.com", "permission": "general-account" }, "role": "manager" } ], "dataFields": [ { "id": "5c99bece337ea758248ffd5b", "systemCode": "study-area", "title": { "zh-TW": "樣區" }, "widgetType": "select", "description": { "zh-TW": "樣區-子樣區" }, "options": [ ] } ], "dailyTestTime": "13:00:00", "latestAnnotationTime": "2019-01-01T00:00:00.000Z", "oldestAnnotationTime": "2019-01-01T00:00:00.000Z" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime": { "type": "string", "format": "date-time", "description": "計畫時間(開始)" }, "endTime": { "type": "string", "format": "data-time", "description": "計畫時間(結束)" }, "areas": { "type": "array", "item": { "type": "string", "description": "計畫地區 ProjectAreaModel 的 id" } }, "description": { "type": "string", "description": "計畫摘要" }, "note": { "type": "string", "description": "備註" }, "coverImageFile": { "type": "object", "description": "計畫封面圖片檔案,物件內容參照 FileModel", "properties": { "id": { "type": "string", "description": "File id string" }, "type": { "type": "string", "description": "影像類型", "enum": ["project-cover-image"] }, "originalFilename": { "type": "string", "description": "原始檔案名" }, "filename": { "type": "string", "description": "系統編碼後之檔案名稱" }, "url": { "type": "string", "description": "公開存取網址" }, "size": { "type": "integer", "description": "File size in byte." } } }, "publishTime": { "type": "string", "format": "data-time", "description": "公開日期" }, "interpretiveDataLicense": { "type": "string", "description": "詮釋資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "identificationInformationLicense": { "type": "string", "description": "鑑定資訊創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "videoMaterialLicense": { "type": "string", "description": "影像資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "members": { "type": "array", "description": "計畫成員", "item": { "type": "object", "properties": { "user": { "type": "string", "description": "成員 ID" }, "role": { "type": "string", "description": "計畫管理員, 計畫研究員, 計畫執行者", "enum": [ "manager", "researcher", "executor" ] } } } }, "dataFields": { "type": "array", "description": "資料欄位", "item": { "type": "string", "description": "欄位名稱" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。格式請見 <https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times>。" }, "latestAnnotationTime": { "type": "string", "format": "date-time", "description": "資料最後更新時間" }, "oldestAnnotationTime": { "type": "string", "format": "date-time", "description": "資料起始年份" } } } ### Get a project [GET /projects/{projectId}] - The user's permission should be 'administrator' or 'general-account'. - The administrator gets study areas of all projects. - The general-account gets the project who joined. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + Request Get a project (application/json) + Response 200 (application/json) + Body { "id": "5c99e565fa899867c32377cf", "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ { "id": "5c9af16a4ee1b606477f9236", "title": { "zh-TW": "台北市", "en-US": "Taipei City" } } ], "description": "計畫摘要", "note": "備註", "coverImageFile": { "id": "5c9b1dfafc43be12b823b7b2", "type": "project-cover-image", "originalFilename": "432x324c.jpg", "filename": "5c9b1dfafc43be12b823b7b2.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/project-covers/5c9b1dfafc43be12b823b7b2.jpg", "size": 26172 }, "publishTime": "2029-01-01T00:00:00.000Z", "interpretiveDataLicense": "cc0", "identificationInformationLicense": "by", "videoMaterialLicense": "by", "members": [ { "user": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example.com", "permission": "general-account" }, "role": "manager" } ], "dataFields": [ { "id": "5c99bece337ea758248ffd5b", "systemCode": "study-area", "title": { "zh-TW": "樣區" }, "widgetType": "select", "description": { "zh-TW": "樣區-子樣區" }, "options": [ ] } ], "dailyTestTime": "13:00:00", "latestAnnotationTime": "2019-01-01T00:00:00.000Z", "oldestAnnotationTime": "2019-01-01T00:00:00.000Z" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "string", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime" : { "type": "string", "format": "date-time", "description": "計畫時間(開始)" }, "endTime": { "type": "string", "format": "date-time", "description": "計畫時間(結束)" }, "areas": { "type": "array", "item": { "type": "string", "description": "計畫地區 ProjectAreaModel 的 id" } }, "description": { "type": "string", "description": "計畫摘要" }, "note": { "type": "string", "description": "備註" }, "coverImageFile": { "type": "object", "description": "計畫封面圖片檔案,物件內容參照 FileModel", "properties": { "id": { "type": "string", "description": "File id string" }, "type": { "type": "string", "description": "影像類型", "enum": ["project-cover-image"] }, "originalFilename": { "type": "string", "description": "原始檔案名" }, "filename": { "type": "string", "description": "系統編碼後之檔案名稱" }, "url": { "type": "string", "description": "公開存取網址" }, "size": { "type": "integer", "description": "File size in byte." } } }, "publishTime": { "type": "string", "format": "data-time", "description": "公開日期" }, "interpretiveDataLicense": { "type": "string", "description": "詮釋資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "identificationInformationLicense": { "type": "string", "description": "鑑定資訊創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "videoMaterialLicense": { "type": "string", "description": "影像資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": ["cc0", "by", "by-nc"], "additionalItems": false }, "members": { "type": "array", "description": "計畫成員", "item": { "type": "object", "properties": { "user": { "type": "string", "description": "成員 ID" }, "role": { "type": "string", "description": "計畫管理員, 計畫研究員, 計畫執行者", "enum": [ "manager", "researcher", "executor" ] } } } }, "dataFields": { "type": "array", "description": "資料欄位", "item": { "type": "string", "description": "欄位名稱" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。格式請見 <https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times>。" }, "latestAnnotationTime": { "type": "string", "format": "date-time", "description": "資料最後更新時間" }, "oldestAnnotationTime": { "type": "string", "format": "date-time", "description": "資料起始年份" } } } ### Update the project [PUT /projects/{projectId}] - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + Request Update the project (application/json) + Body { "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ "5c9af16a4ee1b606477f9236" ], "description": "計畫摘要", "note": "備註", "coverImageFile": "5c9b1dfafc43be12b823b7b2", "publishTime": "2029-01-01T00:00:00.000Z", "interpretiveDataLicense": "cc0", "identificationInformationLicense": "by", "videoMaterialLicense": "by", "dataFields": [ "5c9af16a4ee1b606477f9229", "5c9af16a4ee1b606477f922a", "5c9af16a4ee1b606477f922b", "5c9af16a4ee1b606477f922c", "5c9af16a4ee1b606477f922d" ], "dailyTestTime": "13:00:00" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "title": { "type": "string", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime": { "type": "string", "format": "date-time", "description": "計畫時間(開始)" }, "endTime": { "type": "string", "format": "date-time", "description": "計畫時間(結束)" }, "areas": { "type": "array", "item": { "type": "string", "description": "計畫地區 ProjectAreaModel 的 id" } }, "description": { "type": "string", "description": "計畫摘要" }, "note": { "type": "string", "description": "備註" }, "coverImageFile": { "type": "string", "description": "計畫封面圖片檔案 id 內容為 FileModel 的 id" }, "publishTime": { "type": "string", "format": "data-time", "description": "公開日期" }, "interpretiveDataLicense": { "type": "string", "description": "詮釋資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "identificationInformationLicense": { "type": "string", "description": "鑑定資訊創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "videoMaterialLicense": { "type": "string", "description": "影像資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "dataFields": { "type": "array", "description": "計畫資料所包含的欄位。", "item": { "type": "string", "description": "資料欄位 id。" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。格式請見 <https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times>。" } }, "required": ["title", "shortTitle", "funder", "code", "principalInvestigator", "startTime", "endTime"] } + Response 200 (application/json) + Body { "id": "5c99e565fa899867c32377cf", "title": "計畫名稱", "shortTitle": "計畫簡稱", "funder": "委辦單位", "code": "計畫編號", "principalInvestigator": "計畫主持人", "startTime": "2019-01-01T00:00:00.000Z", "endTime": "2029-01-01T00:00:00.000Z", "areas": [ { "id": "5c9af16a4ee1b606477f9236", "title": { "zh-TW": "台北市", "en-US": "Taipei City" } } ], "description": "計畫摘要", "note": "備註", "coverImageFile": { "id": "5c9b1dfafc43be12b823b7b2", "type": "project-cover-image", "originalFilename": "432x324c.jpg", "filename": "5c9b1dfafc43be12b823b7b2.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/project-covers/5c9b1dfafc43be12b823b7b2.jpg", "size": 26172 }, "publishTime": "2029-01-01T00:00:00.000Z", "interpretiveDataLicense": "cc0", "identificationInformationLicense": "by", "videoMaterialLicense": "by", "members": [ { "user": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example.com", "permission": "general-account" }, "role": "manager" } ], "dataFields": [ { "id": "5c99bece337ea758248ffd5b", "systemCode": "study-area", "title": { "zh-TW": "樣區" }, "widgetType": "select", "description": { "zh-TW": "樣區-子樣區" }, "options": [ ] } ], "dailyTestTime": "13:00:00", "latestAnnotationTime": "2019-01-01T00:00:00.000Z", "oldestAnnotationTime": "2019-01-01T00:00:00.000Z" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "計畫在資料庫中的 id" }, "title": { "type": "string", "description": "計畫名稱" }, "shortTitle": { "type": "string", "description": "計畫簡稱" }, "funder": { "type": "string", "description": "委辦單位" }, "code": { "type": "string", "description": "計畫編號" }, "principalInvestigator": { "type": "string", "description": "計畫主持人" }, "startTime": { "type": "string", "format": "date-time", "description": "計畫時間(開始)" }, "endTime": { "type": "string", "format": "date-time", "description": "計畫時間(結束)" }, "areas": { "type": "array", "item": { "type": "string", "description": "計畫地區 ProjectAreaModel 的 id" } }, "description": { "type": "string", "description": "計畫摘要" }, "note": { "type": "string", "description": "備註" }, "coverImageFile": { "type": "object", "description": "計畫封面圖片檔案,物件內容參照 FileModel", "properties": { "id": { "type": "string", "description": "File id string" }, "type": { "type": "string", "description": "影像類型", "enum": [ "project-cover-image" ] }, "originalFilename": { "type": "string", "description": "原始檔案名" }, "filename": { "type": "string", "description": "系統編碼後之檔案名稱" }, "url": { "type": "string", "description": "公開存取網址" }, "size": { "type": "integer", "description": "File size in byte." } } }, "publishTime": { "type": "string", "format": "data-time", "description": "公開日期" }, "interpretiveDataLicense": { "type": "string", "description": "詮釋資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "identificationInformationLicense": { "type": "string", "description": "鑑定資訊創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "videoMaterialLicense": { "type": "string", "description": "影像資料創用 CC 授權許可 cc0 (無著作權), by (姓名標示), by-nc (姓名標示-非商業性)", "enum": [ "cc0", "by", "by-nc" ], "additionalItems": false }, "members": { "type": "array", "description": "計畫成員", "item": { "type": "object", "properties": { "user": { "type": "object" }, "role": { "type": "string", "enum": [ "" ] } } } }, "dataFields": { "type": "array", "description": "計畫資料所包含的欄位。", "item": { "type": "string", "description": "資料欄位 id。" } }, "dailyTestTime": { "type": "string", "format": "time", "description": "每日測試照片拍攝時間,null 或空字串代表關閉此功能。此欄位僅儲存字串,測試時尋找 csv 中時間欄位為此字串結尾且物種為測試。格式請見 <https://json-schema.org/understanding-json-schema/reference/string.html#dates-and-times>。" }, "latestAnnotationTime": { "type": "string", "format": "date-time", "description": "資料最後更新時間" }, "oldestAnnotationTime": { "type": "string", "format": "date-time", "description": "資料起始年份" } }, "required": ["title", "shortTitle", "funder", "code", "principalInvestigator", "startTime", "endTime"] } ## Species Preset [/projects/{projectId}/species] 維䕶隨計畫而定的預設物種清單。 + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. ### Retrieve species preset [GET /projects/{projectId}/species{?index,size,sort}] 取得計畫預設物種清單。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + index: `0` (number, optional) - The page index. + Default: 0 + size: `9007199254740991` (number, optional) - The size of the result set (1~9007199254740991). + Default: 9007199254740991 + sort: `index` (enum[string], optional) ... + Default: `index` + Members + `index` + `-index` + Request Retrieve species preset (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 4, "items": [ { "id": "5c99e565fa899867c32377d0", "title": { "zh-TW": "空拍" }, "index": 0, "code": "empty-shot" }, { "id": "5c99e565fa899867c32377d1", "title": { "zh-TW": "測試" }, "index": 1, "code": "test" }, { "id": "5c99e565fa899867c32377d2", "title": { "zh-TW": "人" }, "index": 2, "code": "people" }, { "id": "5c99e9f772033c68e65592fb", "title": { "zh-TW": "test" }, "index": 3 } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "number", "description": "The page index." }, "size": { "type": "number", "description": "The page size." }, "total": { "type": "number", "description": "Total of all documents." }, "items": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "description": "名稱", "properties": { "zh-TW": { "type": "string", "description": "Naming in Traditional Chinese." } } }, "index": { "type": "integer" }, "code": { "type": "string", "description": "Machine code for internal referencing." } } } } } } ## Update species preset [PUT /projects/{projectId}/species] 批次新增、更新物種清單。 已存在物種僅可更改順序,不可更改標題且不可刪除。 新增的物種標題為必填。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + Request Update species of the project (application/json) + Body [ { "id": "5c9af1d2403d37067adadbc6" }, { "id": "5c9af1d2403d37067adadbc7" }, { "id": "5c9af1d2403d37067adadbc8" }, { "title": { "zh-TW": "Create this one." } } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" } } }, { "type": "object", "properties": { "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Message in Traditional Chinese." } } } } } ] } } + Response 200 (application/json) + Body { "index": 0, "size": 9007199254740991, "total": 4, "items": [ { "id": "5c9af1d2403d37067adadbc6", "title": { "zh-TW": "空拍" }, "index": 0, "code": "empty-shot" }, { "id": "5c9af1d2403d37067adadbc7", "title": { "zh-TW": "測試" }, "index": 1, "code": "test" }, { "id": "5c9af1d2403d37067adadbc8", "title": { "zh-TW": "人" }, "index": 2, "code": "people" }, { "id": "5ca74924b92468b3ef96fcfd", "title": { "zh-TW": "Create this one." }, "index": 3 } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "oneOf": [ { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Title in Traditional Chinese." } } }, "index": { "type": "integer" }, "code": { "type": "string", "description": "Machine code for internal reference." } } }, { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Message in Traditional Chinese." } } }, "index": { "type": "integer" } } } ] } } } ## Members [/projects/{projectId}/members] + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. ### Add a member [POST /projects/{projectId}/members] 新增成員於指定計畫中。 新增前必須檢查帳號是否存在。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. ] + Request Add a member into the project (application/json) + Body { "user": "name@example.com", "role": "manager" } or, { "user": "0000-0002-6376-3705", "role": "manager" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "user": { "type": "string", "description": "使用者的 ORCiD 或 email." }, "role": { "type": "string", "description": "manager (計畫管理員), researcher (計畫研究員), executor (計畫執行者)", "enum": ["manager", "researcher", "executor"] } } } + Response 200 (application/json) + Body [ { "user": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "name@example.com", "permission": "general-account" }, "role": "manager" } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "items": { "type": "object", "properties": { "user": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "Full name of the member." }, "email": { "type": "string", "format": "idn-email" }, "permission": { "type": "string", "enum": ["administrator", "general-account"] } } }, "role": { "type": "string", "description": "manager (計畫管理員), researcher (計畫研究員), executor (計畫執行者)", "enum": ["manager", "researcher", "executor"] } } } } ## Update members [PUT /projects/{projectId}/members] 批次更新/刪除計畫成員。 上傳的資料不包含某成員代表刪除,不支援批次新增成員。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + Request Update members of the project (application/json) + Body [ { "user": "5c949bbbe5d5377f98c81ab0", "role": "manager" }, { "user": "5ca570886ee6391d81fd773e", "role": "researcher" } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "items": { "oneOf": [ { "type": "object", "properties": { "user": { "type": "string" } } }, { "type": "object", "properties": { "role": { "type": "string", "description": "manager (計畫管理員), researcher (計畫研究員), executor (計畫執行者)", "enum": ["manager", "researcher", "executor"] } } } ] } } + Response 200 (application/json) + Body [ { "user": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "name@example.com", "permission": "general-account" }, "role": "manager" }, { "user": { "id": "5c949bbbe5d5377f98c81ab1", "name": "測試2", "email": "name2@example.com", "permission": "general-account" }, "role": "researcher" } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "item": { "type": "object", "properties": { "user": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "Full name of the member." }, "email": { "type": "string", "format": "idn-email" }, "permission": { "type": "string", "enum": ["administrator", "general-account"] } } }, "role": { "type": "string", "description": "manager (計畫管理員), researcher (計畫研究員), executor (計畫執行者)", "enum": ["manager", "researcher", "executor"] } } } } ## Study Areas [/projects/{projectId}/study-areas] + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. ### List study areas [GET /projects/{projectId}/study-areas] 取得專案啟用的所有樣區。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets study areas of all projects. - The general-account gets the project who joined. + Request Get study areas of the project (application/json) + Response 200 (application/json) + Body [ { "id": "5c9d9428e7462d3d989cb69b", "title": { "zh-TW": "台北" }, "failures": 1, "isLockedAllCameraLocation": false, "children": [ { "id": "5c9d9456e7462d3d989cb69c", "title": { "zh-TW": "內湖站" }, "failures": 1, "isLockedAllCameraLocation": true, "parent": "5c9d9428e7462d3d989cb69b", "cameraLocation": { "id": "5c9f28070d9cee99f8a11a12", "studyArea": "5c9d95acea5c9b4036d97c88", "name": "PT02A", "settingTime": "2018-01-01T00:00:00.000Z", "retireTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "geodeticDatum": "WGS84", "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "verbatimLocality": "傾斜屋對面產道,小池旁", "remarks": "備註" } }, { "id": "5c9d95acea5c9b4036d97c88", "title": { "zh-TW": "大安站" }, "failures": 0, "isLockedAllCameraLocation": false, "parent": "5c9d9428e7462d3d989cb69b" } ] } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "title": { "type": "object", "properties": { "zh-TW": { "type": "Study area name in Traditional Chinese." } } } } }, "failures": { "type": "number", "description": "The total of annotations of the study area (include children)." }, "isLockedAllCameraLocation": { "type": "boolean", "description": "該樣區底下是否所有相機位置被鎖定。(不包含子樣區)" }, "children": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Study area name in Traditional Chinese." } } }, "failures": { "type": "number", "description": "The total of annotations of the study area (include children)." }, "isLockedAllCameraLocation": { "type": "boolean", "description": "該樣區底下是否所有相機位置被鎖定。(不包含子樣區)" }, "cameraLocation": { "type": "object", "description": "樣區的其中一個相機位置,供繪製樣區地圖。", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "string", "description": "樣區 ID。" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "retireTime": { "type": "string", "format": "date-time", "description": "撤除日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "geodeticDatum": { "type": "string", "description": "大地基準", "enum": ["WGS84", "TWD97"] }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "verbatimLocality": { "type": "string", "description": "地點" }, "remarks": { "type": "string", "description": "備註" } } }, "parent": { "type": "string" } } } }, "cameraLocation": { "type": "object", "description": "樣區的其中一個相機位置,供繪製樣區地圖。", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "string", "description": "樣區 ID。" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "retireTime": { "type": "string", "format": "date-time", "description": "撤除日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "geodeticDatum": { "type": "string", "description": "大地基準", "enum": ["WGS84", "TWD97"] }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "verbatimLocality": { "type": "string", "description": "地點" }, "remarks": { "type": "string", "description": "備註" } } } } } } ## Add a study area [POST /projects/{projectId}/study-areas] 新增樣區。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Request Create a study area of the project (application/json) + Body { "title": { "zh-TW": "台北" }, "parent": "5c9d9428e7462d3d989cb69b" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Study area name 樣區名稱 in Traditional Chinese." } } }, "parent": { "type": "string", "description": "母樣區 id,新增子樣區時使用。" } } } + Response 200 (applition/json) + Body { "id": "5c949bbbe5d5377f98c81ab0", "title": { "zh-TW": "台北" } } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "本樣區 id。" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Study area name 樣區名稱 in Traditional Chinese." } } } } } ## Add a study area [POST /projects/{projectId}/study-areas/studyAreaId] 修改樣區。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Request Update a study area of the project (application/json) + Body { "title": { "zh-TW": "台北" }, } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Study area name 樣區名稱 in Traditional Chinese." } } }, "parent": { "type": "string", "description": "母樣區 id,新增子樣區時使用。" } } } + Response 200 (applition/json) + Body { "id": "5c949bbbe5d5377f98c81ab0", "title": { "zh-TW": "台北" } } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "本樣區 id。" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Study area name 樣區名稱 in Traditional Chinese." } } } } } ## Add a study area [POST /projects/{projectId}/study-areas/{studyAreaId}] 修改樣區。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Request Update a study area of the project (application/json) + Body { "title": { "zh-TW": "台北" }, } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Study area name 樣區名稱 in Traditional Chinese." } } }, "parent": { "type": "string", "description": "母樣區 id,新增子樣區時使用。" } } } + Response 200 (applition/json) + Body { "id": "5c949bbbe5d5377f98c81ab0", "title": { "zh-TW": "台北" } } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "本樣區 id。" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Study area name 樣區名稱 in Traditional Chinese." } } } } } ## Camera [/projects/{projectId}/cameras] + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. ### List project cameras [GET /projects/{projectId}/cameras{?index,size,sort,name}] 取得專案底下使用的相機 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + index: `0` (number, optional) - The page index. + Default: 0 + size: `100` (number, optional) - The size of the result set (1~100). + Default: 100 + sort: `name` (enum[string], optional) ... + Default: `name` + Members + `name` + Request Get cameras of the project (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 1, "items": [ { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "nickname": "PT02A", "sn": "MX3862A", "vn": "BRN00012", "propertyNumber": "AB12345", "manufacturer": "Browning", "model": "BR5PXD", "state": "維修中", ... } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機編號" }, "nickname": { "type": "string", "description": "自訂相機編號" }, "sn": { "type": "string", "description": "相機序號" }, "vn": { "type": "string", "description": "廠商維護編號" }, "propertyNumber": { "type": "string", "description": "相機財產編號" }, "manufacturer": { "type": "string", "description": "廠牌" }, "model": { "type": "string", "description": "型號" }, "state": { "type": "string", "description": "狀態", "enum": ["維修中", "使用中", "停用中", "已撤除"] }, } } } } } ### Get project camera by cameraId [GET /projects/{projectId}/cameras/{cameraId}] 取得專案下使用的某個相機 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + cameraId: `5c9...` (string) - The camera ID. + Request Get project camera by cameraId (application/json) + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "nickname": "PT02A", "sn": "MX3862A", "vn": "BRN00012", "propertyNumber": "AB12345", "manufacturer": "Browning", "model": "BR5PXD", "state": "維修中", "batteryType": "鹼性電池", "brightness": "自動", "sensitivity": "自動", "videoLength": "600", "continuousShots": 12, ... } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機編號" }, "nickname": { "type": "string", "description": "自訂相機編號" }, "sn": { "type": "string", "description": "相機序號" }, "vn": { "type": "string", "description": "廠商維護編號" }, "propertyNumber": { "type": "string", "description": "相機財產編號" }, "manufacturer": { "type": "string", "description": "廠牌" }, "model": { "type": "string", "description": "型號" }, "state": { "type": "string", "description": "狀態", "enum": ["維修中", "使用中", "停用中", "已撤除"] }, "batteryType": { "type" : "string", "description": "鹼性電池" }, "brightness": { "type": "string", "description": "自動" }, "sensitivity": { "type": "string", "description": "自動" }, "videoLength": { "type": "number", "description": 600 }, "continuousShots": { "type": "number", "description": 12 } } } ### Update project camera by cameraId [PUT /projects/{projectId}/cameras/{cameraId}] 更新專案下的某個相機 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + cameraId: `5c9...` (string) - The camera ID. + Request Update project camera by cameraId (application/json) + Body { "nickname": "PT02A", "batteryType": "鹼性電池", "brightness": "自動", "sensitivity": "自動", "videoLength": "600", "continuousShots": 12, ... } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "nickname": { "type": "string", "description": "自訂相機編號" }, "batteryType": { "type" : "string", "description": "鹼性電池" }, "brightness": { "type": "string", "description": "自動" }, "sensitivity": { "type": "string", "description": "自動" }, "videoLength": { "type": "number", "description": 600 }, "continuousShots": { "type": "number", "description": 12 } } } + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "nickname": "PT02A", "sn": "MX3862A", "vn": "BRN00012", "propertyNumber": "AB12345", "manufacturer": "Browning", "model": "BR5PXD", "state": "維修中", "batteryType": "鹼性電池", "brightness": "自動", "sensitivity": "自動", "videoLength": "600", "continuousShots": 12, ... } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機編號" }, "nickname": { "type": "string", "description": "自訂相機編號" }, "sn": { "type": "string", "description": "相機序號" }, "vn": { "type": "string", "description": "廠商維護編號" }, "propertyNumber": { "type": "string", "description": "相機財產編號" }, "manufacturer": { "type": "string", "description": "廠牌" }, "model": { "type": "string", "description": "型號" }, "state": { "type": "string", "description": "狀態", "enum": ["維修中", "使用中", "停用中", "已撤除"] }, "batteryType": { "type" : "string", "description": "鹼性電池" }, "brightness": { "type": "string", "description": "自動" }, "sensitivity": { "type": "string", "description": "自動" }, "videoLength": { "type": "number", "description": 600 }, "continuousShots": { "type": "number", "description": 12 } } } ### Create project camera by cameraId [POST /projects/{projectId}/cameras] 新增專案下的相機 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + Request Update project camera by cameraId (application/json) + Body { "name": "PT02A", "sn": "MX3862A", "vn": "BRN00012", "propertyNumber": "AB12345", "manufacturer": "Browning", "model": "BR5PXD", "state": "維修中", } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "name": { "type": "string", "description": "相機編號" }, "sn": { "type": "string", "description": "相機序號" }, "vn": { "type": "string", "description": "廠商維護編號" }, "propertyNumber": { "type": "string", "description": "相機財產編號" }, "manufacturer": { "type": "string", "description": "廠牌" }, "model": { "type": "string", "description": "型號" }, "state": { "type": "string", "description": "狀態", "enum": ["維修中", "使用中", "停用中", "已撤除"] }, } } + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "nickname": "PT02A", "sn": "MX3862A", "vn": "BRN00012", "propertyNumber": "AB12345", "manufacturer": "Browning", "model": "BR5PXD", "state": "維修中", "batteryType": "鹼性電池", "brightness": "自動", "sensitivity": "自動", "videoLength": "600", "continuousShots": 12, ... } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機編號" }, "nickname": { "type": "string", "description": "自訂相機編號" }, "sn": { "type": "string", "description": "相機序號" }, "vn": { "type": "string", "description": "廠商維護編號" }, "propertyNumber": { "type": "string", "description": "相機財產編號" }, "manufacturer": { "type": "string", "description": "廠牌" }, "model": { "type": "string", "description": "型號" }, "state": { "type": "string", "description": "狀態", "enum": ["維修中", "使用中", "停用中", "已撤除"] }, "batteryType": { "type" : "string", "description": "鹼性電池" }, "brightness": { "type": "string", "description": "自動" }, "sensitivity": { "type": "string", "description": "自動" }, "videoLength": { "type": "number", "description": 600 }, "continuousShots": { "type": "number", "description": 12 } } } ### Delete a Camera [DELETE /projects/{projectId}/cameras/{cameraId}] 刪除專案下的某個相機 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + cameraId: `5c9...` (string) - The camera ID. + Request Delete project camera by cameraId (application/json) + Response 204 (application/json) ### Delete Cameras [DELETE /projects/{projectId}/cameras] 刪除專案下的相機 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + Request Delete project camera (application/json) + Response 204 (application/json) ## Camera Locations [/projects/{projectId}/camera-locations] + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. ### Retrieve camera locations [GET /projects/{projectId}/camera-locations{?index,size,sort,name}] 檢查相機位置名稱是否已被使用。 同一計畫底下相機位置名稱不可重複,新增或修改相機位置前請先檢查是否有重複。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + index: `0` (number, optional) - The page index. + Default: 0 + size: `100` (number, optional) - The size of the result set (1~100). + Default: 100 + sort: `name` (enum[string], optional) ... + Default: `name` + Members + `name` + name: `PL01A` (string) - 使用相機名稱搜尋 + Request Search camera locations by name (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 1, "items": [ { "id": "5c9f28070d9cee99f8a11a12", "canTrash": false, "failures": 332, "isLocked": true, "lockUser": { "id": "5ce...", "name": "Kelp Chen" "email": "xxx@gmail.com" ... }, "name": "PT02A", "studyArea": "5c9d95acea5c9b4036d97c88", "settingTime": "2018-01-01T00:00:00.000Z", "retireTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "geodeticDatum": "WGS84", "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "verbatimLocality": "傾斜屋對面產道,小池旁", "remarks": "備註" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "string", "description": "樣區 ID。" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "retireTime": { "type": "string", "format": "date-time", "description": "撤除日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "geodeticDatum": { "type": "string", "description": "大地基準", "enum": ["WGS84", "TWD97"] }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "verbatimLocality": { "type": "string", "description": "地點" }, "remarks": { "type": "string", "description": "備註" } } } } } } ### Update camera locations [PUT /projects/{projectId}/camera-locations/{cameraLocationId}] 更新相機位置。 (因為操作相機位置時前端有可能不知道關聯的樣區所以省略指定樣區) - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + cameraLocationId: `5c9f28070d9cee99f8a11a12` (string) - The camera location ID. + Request Update the camera location (application/json) + Body { "name": "PT02A", "settingTime": "2018-01-01T00:00:00.000Z", "retireTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "geodeticDatum": "WGS84", "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "verbatimLocality": "傾斜屋對面產道,小池旁", "remarks": "備註" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "name": { "type": "string", "description": "相機位置名稱" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "retireTime": { "type": "string", "format": "date-time", "description": "撤除日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "geodeticDatum": { "type": "string", "description": "大地基準", "enum": ["WGS84", "TWD97"] }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "verbatimLocality": { "type": "string", "description": "地點" }, "remarks": { "type": "string", "description": "備註" } } } + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "studyArea":{ "id": "5c9d95acea5c9b4036d97c88", "title":{ "zh-TW": "titleX" } }, "settingTime": "2018-01-01T00:00:00.000Z", "retireTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "geodeticDatum": "WGS84", "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "verbatimLocality": "傾斜屋對面產道,小池旁", "remarks": "備註" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "object", "properties": { "id": { "type": "string", "description": "Study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文樣區名稱。" } } } } }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "retireTime": { "type": "string", "format": "date-time", "description": "撤除日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "geodeticDatum": { "type": "string", "description": "大地基準", "enum": ["WGS84", "TWD97"] }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "verbatimLocality": { "type": "string", "description": "地點" }, "remarks": { "type": "string", "description": "備註" } } } ### Delete a camera location [DELETE /projects/{projectId}/camera-locations/{cameraLocationId}] 刪除相機位置。 (因為操作相機位置時前端有可能不知道關聯的樣區所以省略指定樣區) - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects and who is a project manager. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + cameraLocationId: `5c9f28070d9cee99f8a11a12` (string) - The camera location ID. + Request Delete a camera location (application/json) + Response 204 (application/json) ### Lock the camera location [POST /projects/{projectId}/camera-locations/{cameraLocationId}/_lock] 鎖定相機位置,進入編輯模式。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The user is joined the the project. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + cameraLocationId: `5c9f28070d9cee99f8a11a12` (string) - The camera location ID. + Request Lock the camera location (application/json) + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "studyArea": "5c9d95acea5c9b4036d97c88", "settingTime": "2018-01-01T00:00:00.000Z", "retireTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "geodeticDatum": "WGS84", "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "verbatimLocality": "傾斜屋對面產道,小池旁", "remarks": "備註", "isLocked": true, "lockUser": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example.com", "permission": "administrator" } } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "string" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "retireTime": { "type": "string", "format": "date-time", "description": "撤除日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "geodeticDatum": { "type": "string", "description": "大地基準", "enum": ["WGS84", "TWD97"] }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "verbatimLocality": { "type": "string", "description": "地點" }, "remarks": { "type": "string", "description": "備註" }, "isLocked": { "type": "boolean", "description": "是否已鎖定進入編輯模式" }, "lockUser": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "permission": { "type": "string" } } } } } ### Unlock the camera location [POST /projects/{projectId}/camera-locations/{cameraLocationId}/_unlock] 解除鎖定相機位置,離開編輯模式。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The user is joined the the project. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + cameraLocationId: `5c9f28070d9cee99f8a11a12` (string) - The camera location ID. + Request Unlock the camera location (application/json) + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "studyArea": "5c9d95acea5c9b4036d97c88", "settingTime": "2018-01-01T00:00:00.000Z", "retireTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "geodeticDatum": "WGS84", "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "verbatimLocality": "傾斜屋對面產道,小池旁", "remarks": "備註", "isLocked": false } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "string" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "retireTime": { "type": "string", "format": "date-time", "description": "撤除日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "geodeticDatum": { "type": "string", "description": "大地基準", "enum": ["WGS84", "TWD97"] }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "verbatimLocality": { "type": "string", "description": "地點" }, "remarks": { "type": "string", "description": "備註" }, "isLocked": { "type": "boolean", "description": "是否已鎖定進入編輯模式" }, "lockUser": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "permission": { "type": "string" } } } } } ## Camera Location Abnormality [/projects/{projectId}/camera-location-abnormality] + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. ### Camera location abnormality [POST /projects/{projectId}/camera-location-abnormality] 新增相機異常回報。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined and who is a project manager. + Request Create a camera location abnormality report (application/json) + Body { "cameraLocation": "5c9f28070d9cee99f8a11a12", "abnormalityStartDate": "2019-01-01T00:00:00.000Z", "abnormalityEndDate": "2019-01-15T00:00:00.000Z", "abnormalityType": "others", "note": "" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "project": { "type": "String", "description": "專案 ID" }, "cameraLocation": { "type": "string", "description": "相機位置 ID" }, "abnormalityStartDate": { "type": "string", "format": "date-time", "description": "異常資料時間 (開始)" }, "abnormalityEndDate": { "type": "string", "format": "date-time", "description": "異常資料時間 (結束)" }, "abnormalityType": { "type": "string", "description": "異常類型", "enum": ["empty-shots", "no-photo", "camera-theft", "no-battery", "others"] }, "note": { "type": "String", "description": "備註" } } } + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "cameraLocation": "5c9f28070d9cee99f8a11a12", "abnormalityStartDate": "2019-01-01T00:00:00.000Z", "abnormalityEndDate": "2019-01-15T00:00:00.000Z", "cameraLocation": "5c9f28070d9cee99f8a11a12", "abnormalityType": "others", "note": "" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "project": { "type": "string", "description": "專案" }, "cameraLocation": { "type": "string", "description": "相機位置 ID" }, "abnormalityStartDate": { "type": "string", "format": "date-time", "description": "異常資料時間 (開始)" }, "abnormalityEndDate": { "type": "string", "format": "date-time", "description": "異常資料時間 (結束)" }, "abnormalityType": { "type": "string", "description": "異常類型", "enum": ["empty-Shots", "no-Photo", "camera-Theft", "no-Battery", "others"] }, "note": { "type": "string", "description": "備註" } } } ## Camera locations in study areas [/projects/{projectId}/study-areas/{studyAreaId}/camera-locations] + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + studyAreaId: `` (string) - The study area ID. ### Retrieve camera locations in a study area [GET /projects/{projectId}/study-areas/{studyAreaId}/camera-locations{?index,size,sort}] 取得樣區底下啟用的相機位置。 如果指定的樣區是母樣區時會連子樣區的相機位置一起取得。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets affiliated projects. + Parameters + projectId: `5c99e565fa899867c32377cf` (string) - The project ID. + studyAreaId: `5c9d95acea5c9b4036d97c88` (string) - The study area ID. + index: `0` (number, optional) - The page index. + Default: 0 + size: `100` (number, optional) - The size of the result set (1~100). + Default: 100 + sort: `name` (enum[string], optional) ... + Default: `name` + Members + `name` + `-name` + Request Get camera locations of the study area (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 2, "items": [ { "id": "5c9f268cd8605e99862339ff", "name": "pT03B", "studyArea": "5c9d95acea5c9b4036d97c88", "latitude": 25.014051, "longitude": 121.462417, "isLocked": false, "failures": 0, "canTrash": false }, { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "studyArea": "5c9d95acea5c9b4036d97c88", "settingTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "isLocked": true, "lockUser": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example", "permission": "administrator" }, "failures": 0, "canTrash": false } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "string", "description": "樣區 ID。" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" }, "isLocked": { "type": "boolean", "description": "是否已鎖定進入編輯模式" }, "lockUser": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "email": { "type": "string" }, "permission": { "type": "string" } } }, "failures": { "type": "number", "description": "wf 4.17 錯誤提示:供相機位置顯示 annotation 錯誤數量" }, "canTrash": { "type": "boolean", "description": "wf 3.4 計畫管理:供判斷該相機位置是否能刪除" } } } } } } ### Create a camera location in a specified study area [POST /projects/{projectId}/study-areas/{studyAreaId}/camera-locations] 在指定的樣區新增相機位置。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined and who is a project manager. + Request Create a camera location to a study area (application/json) + Body { "name": "PT02A", "settingTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "name": { "type": "string", "description": "相機位置名稱" }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" } } } + Response 200 (application/json) + Body { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "studyArea": { "id": "5c9d95acea5c9b4036d97c88", "title": { "zh-TW": "titleX" } }, "settingTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "altitude": 100, "vegetation": "植被類型" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機位置名稱" }, "studyArea": { "type": "object", "properties": { "id": { "type": "string", "description": "Study area ID." }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文樣區名稱。" } } } } }, "settingTime": { "type": "string", "format": "date-time", "description": "架設日期(ISO-8601)" }, "latitude": { "type": "number", "description": "十進位緯度 (WGS84)" }, "longitude": { "type": "number", "description": "十進位經度 (WGS84)" }, "altitude": { "type": "number", "description": "海拔(公尺)" }, "vegetation": { "type": "string", "description": "植被類型" }, "landCoverType": { "type": "string", "description": "土地覆蓋類型" } } } ## Download example csv [/projects/{projectId}/example.csv] ### Download the example csv file [GET /projects/{projectId}/example.csv] 下載計畫的範例 CSV 檔,直接將瀏覽器網址改成匯出網址後瀏覽器會開始下載。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Parameters + projectId: `5c9af1d2403d37067adadbc5` (string) - 計畫 id。 + Request Download the example csv file (application/json) + Response 200 (text/csv) + Body 樣區,子樣區,相機位置,檔名,日期時間,物種,年齡 title,titleX,PT02A,IMG_0001.jpg,2019-05-06 11:02:40,空拍,成體 # Group Data Fields ## Retrieve data fields[/data-fields] ### Retrieve data fields [GET /data-fields{?index,size,sort,filter}] - The user's permission should be 'administrator' or 'general-account'. + Parameters + index: `0` (number, optional) - The page index. + Default: 0 + size: `100` (number, optional) - The size of the result set (1~100). + Default: 100 + sort: `createTime` (enum[string], optional) ... + Default: `createTime` + Members + `createTime` + filter: `system` (enum[string], optional) ... + Members + `system` + `custom` + Request Get data fields (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 7, "items": [ { "id": "5c9af16a4ee1b606477f9229", "systemCode": "study-area", "title": { "zh-TW": "樣區" }, "widgetType": "select", "description": { "zh-TW": "樣區-子樣區" }, "options": [] }, { "id": "5c9af16a4ee1b606477f922a", "systemCode": "camera-location", "title": { "zh-TW": "相機位置" }, "widgetType": "select", "description": { "zh-TW": "相機位置名稱" }, "options": [] }, { "id": "5c9af16a4ee1b606477f922b", "systemCode": "file-name", "title": { "zh-TW": "檔名" }, "widgetType": "text", "description": { "zh-TW": "01234.jpg" }, "options": [] }, { "id": "5c9af16a4ee1b606477f922c", "systemCode": "time", "title": { "zh-TW": "日期時間" }, "widgetType": "time", "description": { "zh-TW": "YY/MM/DD hh:mm" }, "options": [] }, { "id": "5c9af16a4ee1b606477f922d", "systemCode": "species", "title": { "zh-TW": "物種" }, "widgetType": "select", "description": { "zh-TW": "" }, "options": [] }, { "id": "5c9af16a4ee1b606477f922e", "title": { "zh-TW": "性別" }, "widgetType": "select", "description": { "zh-TW": "公、母" }, "options": [ { "id": "5c9af16a4ee1b606477f9230", "zh-TW": "公" }, { "id": "5c9af16a4ee1b606477f922f", "zh-TW": "母" } ] }, { "id": "5c9af16a4ee1b606477f9235", "title": { "zh-TW": "備註" }, "widgetType": "text", "description": { "zh-TW": "" }, "options": [] } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "systemCode": { "type": "string", "description": "樣區" }, "title": { "type": "object", "properties": { "zh-TW": "string", "description": "繁體中文樣區名稱" } }, "widgetType": { "type": "string", "enum": ["select"] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文相機位置名稱" } } }, "options": { "type": "array" } } } } } } ## Apply for a new data field [/data-fields] ### Apply for a new data field [POST /data-fields] 申請新欄位。 - The user's permission should be 'administrator' or 'general-account'. + Request Create a data field (application/json) + Body { "project": "5c9af1d2403d37067adadbc5", "title": { "zh-TW": "title" }, "widgetType": "select", "description": { "zh-TW": "description" }, "options": [ {"zh-TW": "xx"} ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "project" : { "type": "string", "description": "提出審核時的計畫,僅用於通知時顯示使用者在哪個計畫提出" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單名稱" } } }, "widgetType": { "type": "string", "enum": ["select"] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單說明" } } }, "options": { "type": "array", "item": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } } } + Response 200 (application/json) + Body { "id": "5c9f31037ef1509d50d2911f", "title": { "zh-TW": "title" }, "widgetType": "select", "description": { "zh-TW": "description" }, "options": [ { "id": "5c9f31037ef1509d50d29120", "zh-TW": "xx" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單名稱" } } }, "widgetType": { "type": "string", "enum": ["select"] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單說明" } } }, "options": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } } } ## Approve new data field [/data-fields/{dataFieldId}/_approve] ### Apply for a new data field [POST /data-fields/{dataFieldId}/_approve] 通過申請新欄位。 - The user's permission should be 'administrator'. + Request Approve a data field (application/json) + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "project" : { "type": "string", "description": "提出審核時的計畫,僅用於通知時顯示使用者在哪個計畫提出" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單名稱" } } }, "widgetType": { "type": "string", "enum": ["select"] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單說明" } } }, "options": { "type": "array", "item": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } } } + Response 200 (application/json) + Body { "id": "5c9f31037ef1509d50d2911f", "title": { "zh-TW": "title" }, "widgetType": "select", "description": { "zh-TW": "description" }, "options": [ { "id": "5c9f31037ef1509d50d29120", "zh-TW": "xx" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單名稱" } } }, "widgetType": { "type": "string", "enum": ["select"] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單說明" } } }, "options": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } } } ## Reject new data field [/data-fields/{dataFieldId}/_reject] ### Apply for a new data field [POST /data-fields/{dataFieldId}/_reject] 未通過申請新欄位。 - The user's permission should be 'administrator'. + Request Reject a data field (application/json) + Response 200 (application/json) + Body { "id": "5c9f31037ef1509d50d2911f", "title": { "zh-TW": "title" }, "widgetType": "select", "description": { "zh-TW": "description" }, "options": [ { "id": "5c9f31037ef1509d50d29120", "zh-TW": "xx" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單名稱" } } }, "widgetType": { "type": "string", "enum": ["select"] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文選單說明" } } }, "options": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } } } ## Retrieve data field information [/data-fields/{dataFieldId}] ### Retrieve data field information [GET /data-fields/{dataFieldId}] 取得欄位詳細資料。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + dataFieldId: `5c9af16a4ee1b606477f922e` (number) - The data field ID. + Request Get a data field (application/json) + Response 200 (application/json) + Body { "id": "5c9af16a4ee1b606477f922e", "state": "approved", "title": { "zh-TW": "性別" }, "widgetType": "select", "description": { "zh-TW": "公、母" }, "options": [ { "id": "5c9af16a4ee1b606477f9230", "zh-TW": "公" }, { "id": "5c9af16a4ee1b606477f922f", "zh-TW": "母" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "The data field ID." }, "state": { "type": "string", "description": "The status of this field.", "enum": ["approved", "pending", "rejected"] }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文欄位名稱" } } }, "widgetType": { "type": "string", "enum": ["select", "text", "datePicker"] }, "description": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文欄位說明" } } }, "options": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string", "description": "欄位項目編碼" }, "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } } } # Group Species ## System species [/species] ### Get all species [GET /species{?index,size}] 取得系統所有物種。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + index: 0 (number, optional) - The page index. + Default: 0 + size: 9007199254740991 (number, optional) - The page size (1~9007199254740991). + Default: 9007199254740991 + Request Get all species (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 9007199254740991, "total": 3, "items": [ { "id": "5cd6941d0353661e18a1d370", "title": { "zh-TW": "NA" } }, { "id": "5cd661e332a98b60839c6cac", "title": { "zh-TW": "人" }, "code": "human" }, { "id": "5cd661e332a98b60839c6cad", "title": { "zh-TW": "定時測試" } } ] } # Group Annotations ### Search annotations [GET /annotations{?studyArea,cameraLocations,startTime,endTime,index,size,sort,fields,species,uploadSession}] 搜尋標註。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Parameters + studyArea: `5c9d95acea5c9b4036d97c88` (string, optional) - 使用樣區 id 搜尋標註,回傳結果包含子樣區資料。 + cameraLocations: `5c9f28070d9cee99f8a11a12` (string, optional) - 使用相機位置 id 搜尋標註。<br/>多個相機位置:?cameraLocations=5c9f28070d9cee99f8a11a12&cameraLocations=5c9f28070d9cee99f8a11a13 + startTime: `2017-11-09T03:48:46.000Z` (string, optional) - 開始時間 + endTime: `2017-11-09T03:48:46.000Z` (string, optional) - 結束時間 + index: 0 (number, optional) - The page index. + Default: 0 + size: 100 (number, optional) - The page size (1~1,500). + Default: 100 + sort: `cameraLocation time filename` (enum[string], optional) + Default: `cameraLocation time filename` + Members + `cameraLocation time filename` + `time filename cameraLocation` + fields: `{"5cd661e332a98b60839c6c99": "5cd661e332a98b60839c6c9b"}` (string, optional) - 自訂欄位的搜尋條件 {dataFieldId: value} (JSON) + species: `5cd795a461a221310e546b58` (string, optional) - 使用物種 id 搜尋標註。<br/>多個物種:?species=5c9f28070d9cee99f8a11a12&species=5c9f28070d9cee99f8a11a13 + uploadSession: `5cdd1fdbf65647074718202b` (string, optional) - 使用上傳紀錄 id 搜尋標註。 + Request Get annotations (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 2, "items": [ { "id": "5cbabb2c84bf6a8dc5ccf960", "studyArea": "5c9d95acea5c9b4036d97c88", "cameraLocation": "5c9f28070d9cee99f8a11a12", "failures": [ ], "filename": "IMG_7191.JPG", "time": "2010-07-25T04:27:48.000Z", "species": { "id": "5c9af1d2403d37067adadbc7", "title": { "zh-TW": "測試" }, "index": 1, "code": "test" }, "fields": [ { "dataField": "5c9af16a4ee1b606477f9231", "value": "5c9af16a4ee1b606477f9234" } ] }, { "id": "5cbabad384bf6a8dc5ccf94b", "studyArea": "5c9d95acea5c9b4036d97c88", "cameraLocation": "5c9f28070d9cee99f8a11a12", "failures": [ ], "filename": "IMG_7191.JPG", "file": { "id": "5cbabb0284bf6a8dc5ccf953", "type": "annotation-image", "originalFilename": "IMG_7191.JPG", "filename": "5cbabb0284bf6a8dc5ccf953.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/annotation-images/5cbabb0284bf6a8dc5ccf953.jpg", "thumbnailUrl": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/annotation-thumbnail-images/5cbabb0284bf6a8dc5ccf953.jpg", "size": 3934239 }, "time": "2017-11-09T03:48:46.000Z", "fields": [ ] } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "id": { "type": "string", "description": "Annotation ID." }, "studyArea": { "type": "string", "description": "樣區 id" }, "cameraLocation": { "type": "string", "description": "相機位置 id" }, "failures": { "type": "string", "enum": [ "new-species" ], "description": "物種不在預設中" }, "filename": { "type": "string", "description": "檔名" }, "file": { "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": ["project-cover-image", "annotation-image"] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "thumbnailUrl": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." } } }, "time": { "type": "string", "format": "date-time" }, "species": { "type": "object", "properties": { "id": { "type": "string", "description": "物種 ID" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文物種名稱" } } }, "index": { "type": "integer", "description": "順序" }, "code": { "type": "string", "description": "Machine code for internal referencing." } } }, "fields": { "type": "array", "item": { "type": "object", "properties": { "dataField": { "type": "string", "description": "Data field ID." }, "value": { "type": "string", "description": "Value ID." } } } } } } } } } ## Access annotation [/annotations/{annotationId}] + Parameters + annotationId: `5cbabb2c84bf6a8dc5ccf960` (string) - The annotation ID. ### Get annotation [GET /annotations/{annotationId}] 取得標註。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Request Get an annotation (application/json) + Response 200 (application/json) + Body { "id": "5cbabb2c84bf6a8dc5ccf960", "studyArea": { "id": "5c9d95acea5c9b4036d97c88", "title": { "zh-TW": "titleX" }, "parent": "5c9d9428e7462d3d989cb69b" }, "cameraLocation": { "id": "5c9f28070d9cee99f8a11a12", "studyArea": "5c9d95acea5c9b4036d97c88", "name": "PT02A", "settingTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "isLocked": false }, "failures": [ ], "filename": "IMG_7191.JPG", "file": { "id": "5cbabb0284bf6a8dc5ccf953", "type": "annotation-image", "originalFilename": "IMG_7191.JPG", "filename": "5cbabb0284bf6a8dc5ccf953.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/annotation-images/5cbabb0284bf6a8dc5ccf953.jpg", "size": 3934239 }, "time": "2010-07-25T04:27:48.000Z", "species": { "id": "5c9af1d2403d37067adadbc7", "title": { "zh-TW": "測試" }, "index": 1, "code": "test" }, "fields": [ { "dataField": { "id": "5c9af16a4ee1b606477f9231", "state": "approved", "title": { "zh-TW": "年齡" }, "widgetType": "select", "description": { "zh-TW": "成體、亞成體、幼體" }, "options": [ { "id": "5c9af16a4ee1b606477f9234", "zh-TW": "成體" }, { "id": "5c9af16a4ee1b606477f9233", "zh-TW": "亞成體" }, { "id": "5c9af16a4ee1b606477f9232", "zh-TW": "幼體" } ] }, "value": "5c9af16a4ee1b606477f9234" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "Annotation ID." }, "studyArea": { "type": "object" }, "cameraLocation": { "type": "object" }, "failures": { "type": "string", "enum": [ "new-species" ], "description": "物種不在預設中" }, "filename": { "type": "string", "description": "檔名" }, "file": { "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": [ "project-cover-image", "annotation-image" ] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." } } }, "time": { "type": "string", "format": "date-time" }, "species": { "type": "object", "properties": { "id": { "type": "string", "description": "物種 ID" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文物種名稱" } } }, "index": { "type": "integer", "description": "順序" }, "code": { "type": "string", "description": "Machine code for internal referencing." } } }, "fields": { "type": "array", "item": { "type": "object", "properties": { "dataField": { "type": "object", "properties": { "id": { "type": "string", "description": "Data field ID." }, "state": { "type": "string", "enum": ["approved", "pending", "rejected"] }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文欄位名稱" } } }, "widgetType": { "type": "string", "enum": ["select", "text", "date-picker"] }, "description": { "type": "object", "properties": { "zh-TW": "繁體中文欄位說明。" } }, "options": { "type": "object", "properties": { "id": { "type": "string", "description": "選項編號" }, "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } }, "value": { "type": "string" } } } } } } ### Create an annotation [POST /annotations] 新增標註。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Request Create an annotation (application/json) + Body { "cameraLocation": "5c9f28070d9cee99f8a11a12", "filename": "IMG_7191.JPG", "file": "5cbabb0284bf6a8dc5ccf951", "time": "2010-07-25T04:27:48.000Z", "speciesTitle": "測試", "fields": [ { "dataField": "5c9af16a4ee1b606477f9231", "value": "5c9af16a4ee1b606477f9234" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "cameraLocation": { "type": "string", "description": "相機位置 ID" }, "filename": { "type": "string" }, "file": { "type": "string", "description": "檔案 ID" }, "time": { "type": "string" }, "speciesTitle": { "type": "string", "description": "物種中文標題" }, "fields": { "type": "array", "item": { "type": "object", "properties": { "dataField": { "type": "string", "description": "Data field ID." }, "value": { "type": "string" } } } } } } + Response 200 (application/json) + Body { "id": "5cbabb2c84bf6a8dc5ccf960", "studyArea": { "id": "5c9d95acea5c9b4036d97c88", "title": { "zh-TW": "titleX" }, "parent": "5c9d9428e7462d3d989cb69b" }, "cameraLocation": { "id": "5c9f28070d9cee99f8a11a12", "studyArea": "5c9d95acea5c9b4036d97c88", "name": "PT02A", "settingTime": "2019-01-01T00:00:00.000Z", "latitude": 58.28, "longitude": 121.462417, "altitude": 100, "vegetation": "植被類型", "landCoverType": "土地覆蓋類型", "isLocked": false }, "failures": [ ], "filename": "IMG_7191.JPG", "file": { "id": "5cbabb0284bf6a8dc5ccf953", "type": "annotation-image", "originalFilename": "IMG_7191.JPG", "filename": "5cbabb0284bf6a8dc5ccf953.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/annotation-images/5cbabb0284bf6a8dc5ccf953.jpg", "size": 3934239 }, "time": "2010-07-25T04:27:48.000Z", "species": { "id": "5c9af1d2403d37067adadbc7", "title": { "zh-TW": "測試" }, "index": 1, "code": "test" }, "fields": [ { "dataField": { "id": "5c9af16a4ee1b606477f9231", "state": "approved", "title": { "zh-TW": "年齡" }, "widgetType": "select", "description": { "zh-TW": "成體、亞成體、幼體" }, "options": [ { "id": "5c9af16a4ee1b606477f9234", "zh-TW": "成體" }, { "id": "5c9af16a4ee1b606477f9233", "zh-TW": "亞成體" }, { "id": "5c9af16a4ee1b606477f9232", "zh-TW": "幼體" } ] }, "value": "5c9af16a4ee1b606477f9234" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "Annotation ID." }, "studyArea": { "type": "object" }, "cameraLocation": { "type": "object" }, "failures": { "type": "string", "enum": [ "new-species" ], "description": "物種不在預設中" }, "filename": { "type": "string", "description": "檔名" }, "file": { "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": [ "project-cover-image", "annotation-image" ] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." } } }, "time": { "type": "string", "format": "date-time" }, "species": { "type": "object", "properties": { "id": { "type": "string", "description": "物種 ID" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文物種名稱" } } }, "index": { "type": "integer", "description": "順序" }, "code": { "type": "string", "description": "Machine code for internal referencing." } } }, "fields": { "type": "array", "item": { "type": "object", "properties": { "dataField": { "type": "object", "properties": { "id": { "type": "string", "description": "Data field ID." }, "state": { "type": "string", "enum": ["approved", "pending", "rejected"] }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文欄位名稱" } } }, "widgetType": { "type": "string", "enum": ["select", "text", "date-picker"] }, "description": { "type": "object", "properties": { "zh-TW": "繁體中文欄位說明。" } }, "options": { "type": "object", "properties": { "id": { "type": "string", "description": "選項編號" }, "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } }, "value": { "type": "string" } } } } } } ### Update annotation [PUT /annotations/{annotationId}] 更新標註。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Parameters + annotationId: `5cd25d0100407e2fea3fcf63` (string) - The annotation ID. + Request Update an annotation (application/json) + Body { "speciesTitle": "測試", "fields": [ { "dataField": "5c9af16a4ee1b606477f9231", "value": "5c9af16a4ee1b606477f9234" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "speciesTitle": { "type": "string", "description": "物種中文標題" }, "fields": { "type": "array", "item": { "type": "object", "properties": { "dataField": { "type": "string", "description": "Data field ID." }, "value": { "type": "string", "description": "Value ID." } } } } } } + Response 200 (application/json) + Body { "id": "5cbabb2c84bf6a8dc5ccf960", "studyArea": "5c9d95acea5c9b4036d97c88", "cameraLocation": "5c9f28070d9cee99f8a11a12", "failures": [ ], "filename": "IMG_7191.JPG", "file": { "id": "5cbabb0284bf6a8dc5ccf953", "type": "annotation-image", "originalFilename": "IMG_7191.JPG", "filename": "5cbabb0284bf6a8dc5ccf953.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/annotation-images/5cbabb0284bf6a8dc5ccf953.jpg", "size": 3934239 }, "time": "2010-07-25T04:27:48.000Z", "species": { "id": "5c9af1d2403d37067adadbc7", "title": { "zh-TW": "測試" }, "index": 1, "code": "test" }, "fields": [ { "dataField": { "id": "5c9af16a4ee1b606477f9231", "state": "approved", "title": { "zh-TW": "年齡" }, "widgetType": "select", "description": { "zh-TW": "成體、亞成體、幼體" }, "options": [ { "id": "5c9af16a4ee1b606477f9234", "zh-TW": "成體" }, { "id": "5c9af16a4ee1b606477f9233", "zh-TW": "亞成體" }, { "id": "5c9af16a4ee1b606477f9232", "zh-TW": "幼體" } ] }, "value": "5c9af16a4ee1b606477f9234" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "Annotation ID." }, "studyArea": { "type": "string", "description": "樣區 id" }, "cameraLocation": { "type": "string", "description": "相機位置 id" }, "failures": { "type": "string", "enum": [ "new-species" ], "description": "物種不在預設中" }, "filename": { "type": "string", "description": "檔名" }, "file": { "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": [ "project-cover-image", "annotation-image" ] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." } } }, "time": { "type": "string", "format": "date-time" }, "species": { "type": "object", "properties": { "id": { "type": "string", "description": "物種 ID" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文物種名稱" } } }, "index": { "type": "integer", "description": "順序" }, "code": { "type": "string", "description": "Machine code for internal referencing." } } }, "fields": { "type": "array", "item": { "type": "object", "properties": { "dataField": { "type": "object", "properties": { "id": { "type": "string", "description": "Data field ID." }, "state": { "type": "string", "enum": ["approved", "pending", "rejected"] }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "繁體中文欄位名稱" } } }, "widgetType": { "type": "string", "enum": ["select", "text", "date-picker"] }, "description": { "type": "object", "properties": { "zh-TW": "繁體中文欄位說明。" } }, "options": { "type": "object", "properties": { "id": { "type": "string", "description": "選項編號" }, "zh-TW": { "type": "string", "description": "繁體中文選項名稱" } } } } }, "value": { "type": "string", "description": "Value ID." } } } } } } ### Delete an annotation [DELETE /annotations/{annotationId}] 刪除標註。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Parameters + annotationId: `5cd25d0100407e2fea3fcf63` (string) - The annotation ID. + Request Delete an annotation (application/json) + Response 204 (application/json) ## Annotation revision [/annotations/{annotationId}/revisions] ### Get revisions of the annotation [GET /annotations/{annotationId}/revisions{?index,size,sort}] 取得標註的版本紀錄。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Parameters + annotationId: `5cca59e6466788f1848edac7` (string) - The annotation ID. + index: `0` (number, optional) - The page index. + Default: 0 + size: `5` (number, optional) - The size of the result set. + Default: 5 + sort: `-createTime` (enum[string], optional) ... + Default: `-createTime` + Members + `createTime` + `-createTime` + Request Get revisions of the annotation (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 5, "total": 2, "items": [ { "id": "5cca59f567af9ef185bd5ed6", "user": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example.com", "permission": "administrator" }, "isCurrent": true, "createTime": "2019-05-02T02:46:13.768Z" }, { "id": "5cca594f67af9ef185bd5ed3", "user": { "id": "5c949bbbe5d5377f98c81ab0", "name": "測試", "email": "email@example.com", "permission": "administrator" }, "isCurrent": false, "createTime": "2019-05-02T02:43:27.021Z" } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "id": { "type": "string" }, "user": { "type": "object", "properties": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "Full name of the member." }, "email": { "type": "string", "format": "idn-email" }, "permission": { "type": "string", "enum": ["administrator", "general-account"] } } } }, "isCurrent": { "type": "boolean", "description": "Is this revision current?" }, "createTime": { "type": "string" } } } } } } ### Rollback the annotation with the revision [POST /annotations/{annotationId}/revisions/{revisionId}/_rollback] 回復標註為指定的版本紀錄。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Parameters + annotationId: `5cca59e6466788f1848edac7` (string) - The annotation ID. + revisionId: `5cca59f567af9ef185bd5ed6` (string) - The revision ID. + Request Rollback the annotation with the revision (application/json) + Response 200 (application/json) + Body { "id": "5cca59f567af9ef185bd5ed6", "user": "5c949bbbe5d5377f98c81ab0", "isCurrent": true, "createTime": "2019-05-02T02:46:13.768Z" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "user": { "type": "string" }, "isCurrent": { "type": "boolean", "description": "Is this revision current?" }, "createTime": { "type": "string" } } } ### Update multiple annotations [POST /annotations/{annotationIds}] To be implemented. + response 200 (application/json) ## Export annotations [/annotations.csv] ### Export annotations to .csv [GET /annotations.csv{?studyArea,cameraLocations,startTime,endTime,sort,fields,species}] 匯出標註為 CSV 檔,直接將瀏覽器網址改成匯出網址後瀏覽器會開始下載。 - The user's permission should be 'administrator' or 'general-account'. - The administrator gets all projects. - The general-account gets the project who joined. + Parameters + studyArea: `5c9d95acea5c9b4036d97c88` (string, optional) - 使用樣區 id 搜尋標註,回傳結果包含子樣區資料。 + cameraLocations: `5c9f28070d9cee99f8a11a12` (string, optional) - 使用相機位置 id 搜尋標註。<br/>多個相機位置:?cameraLocations=5c9f28070d9cee99f8a11a12&cameraLocations=5c9f28070d9cee99f8a11a13 + startTime: `2017-11-09T03:48:46.000Z` (string, optional) - 開始時間 + endTime: `2017-11-09T03:48:46.000Z` (string, optional) - 結束時間 + sort: `cameraLocation time filename` (enum[string], optional) + Default: `cameraLocation time filename` + Members + `cameraLocation time filename` + `time filename cameraLocation` + fields: `{"5cd661e332a98b60839c6c99": "5cd661e332a98b60839c6c9b"}` (string, optional) - 自訂欄位的搜尋條件 {dataFieldId: value} (JSON) + species: `5cd795a461a221310e546b58` (string, optional) - 使用物種 id 搜尋標註。<br/>多個物種:?species=5c9f28070d9cee99f8a11a12&species=5c9f28070d9cee99f8a11a13 + Request Export annotations to .csv (application/json) + Response 200 (text/csv) + Body 樣區,子樣區,相機位置,檔名,日期時間,物種,年齡 title,titleX,PT02A,IMG_7191.JPG,2010-07-25 12:27:48,測試,成體 title,titleX,PT02A,IMG_7191.JPG,2017-11-09 11:48:46,, title,titleX,PT02A,IMG_4378.JPG,2019-03-06 10:34:56,, title,titleX,PT02A,IMG_6635.JPG,2019-03-06 10:39:45,, title,titleX,PT02A,IMG_4380.JPG,2019-03-06 10:46:51,, # Group Metrics ## Get retrieval metrics ### By project [GET /projects/{projectId}/month-retrieved{?year}] 取得專案下的回收/辨識狀況 - The user's permission should be 'administrator' or 'general-account'. + Parameters + year: `2019` (number, required) - year to query. + Request Get retrieval metrics by project (application/json) + Response 200 (application/json) + Body [{ "studyArea": "5cd6643c99580e819b7fe123", "data": [ { "month": 1, "dataCount": 2677, "fileCount": 2677, "speciesCount": 2677, "failures": 295, "lastData": "2019-05-12T13:42:53.018Z" }, { "month": 2, "dataCount": 1999, "fileCount": 1999, "speciesCount": 1999, "failures": 204, "lastData": "2019-05-12T13:42:07.614Z" }, { "month": 3, "dataCount": 506, "fileCount": 506, "speciesCount": 506, "failures": 9, "lastData": "2019-05-12T13:37:06.026Z" }, null, null, null, null, null, null, null, null, { "month": 12, "dataCount": 6, "fileCount": 6, "speciesCount": 6, "failures": 0, "lastData": "2019-05-12T13:30:03.099Z" } ] }, { "studyArea": "5cdbc8b05d2c6a43f5a46680", "data": [ { "month": 1, "dataCount": 928, "fileCount": 928, "speciesCount": 928, "failures": 351, "lastData": "2019-05-15T14:09:28.466Z" }, null, null, null, null, null, null, null, null, null, null, { "month": 12, "dataCount": 19, "fileCount": 19, "speciesCount": 19, "failures": 0, "lastData": "2019-05-15T14:02:37.846Z" } ] }] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "properties": { "studyArea": { "type": "string", "description": "studyArea id." }, "data": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "month": { "type": "number" }, "dataCount": { "type": "number" }, "fileCount": { "type": "number" }, "speciesCount": { "type": "number" }, "failures": { "type": "number" }, "lastData": { "type": "date" } } } } } } ### By study area [GET /projects/{projectId}/study-areas/{studyareaId}/month-retrieved{?year}] 取得特定地區的回收/辨識狀況 - The user's permission should be 'administrator' or 'general-account'. + Parameters + year: `2019` (number, required) - year to query. + Request Get retrieval metrics by study areas (application/json) + Response 200 (application/json) + Body [ { "cameraLocation": "5cd7c0c383028cf0c5a5c69c", "data": [ { "month": 1, "dataCount": 206, "fileCount": 206, "speciesCount": 206, "failures": 138, "lastData": "2019-05-12T13:32:30.210Z" }, { "month": 2, "dataCount": 136, "fileCount": 136, "speciesCount": 136, "failures": 90, "lastData": "2019-05-12T13:32:33.829Z" }, { "month": 3, "dataCount": 83, "fileCount": 83, "speciesCount": 83, "failures": 6, "lastData": "2019-05-12T13:32:36.220Z" }, null, null, null, null, null, null, null, null, null ] }, { "cameraLocation": "5cd7c0c083028c6aa8a5c692", "data": [ { "month": 1, "dataCount": 520, "fileCount": 520, "speciesCount": 520, "failures": 6, "lastData": "2019-05-12T13:30:22.029Z" }, { "month": 2, "dataCount": 346, "fileCount": 346, "speciesCount": 346, "failures": 21, "lastData": "2019-05-12T13:30:37.733Z" }, { "month": 3, "dataCount": 23, "fileCount": 23, "speciesCount": 23, "failures": 0, "lastData": "2019-05-12T13:30:38.890Z" }, null, null, null, null, null, null, null, null, { "month": 12, "dataCount": 6, "fileCount": 6, "speciesCount": 6, "failures": 0, "lastData": "2019-05-12T13:30:03.099Z" } ] } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "properties": { "cameraLocation": { "type": "string", "description": "cameraLocation id." }, "data": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "month": { "type": "number" }, "dataCount": { "type": "number" }, "fileCount": { "type": "number" }, "speciesCount": { "type": "number" }, "failures": { "type": "number" }, "lastData": { "type": "date" } } } } } } ### By camera location [GET /projects/{projectId}/camera-locations/{cameraLocationId}/month-retrieved{?year}] 取得單一相機的回收/辨識狀況 - The user's permission should be 'administrator' or 'general-account'. + Parameters + year: `2019` (number, required) - year to query. + Request Get retrieval metrics by camera locations (application/json) + Response 200 (application/json) + Body [ { "cameraLocation": "5cd6648799580eda3c7fe12c", "data": [ { "month": 1, "dataCount": 164, "fileCount": 164, "speciesCount": 164, "failures": 0, "lastData": "2019-05-11T06:53:44.906Z" }, { "month": 2, "dataCount": 770, "fileCount": 770, "speciesCount": 770, "failures": 0, "lastData": "2019-05-11T06:55:35.607Z" }, { "month": 3, "dataCount": 136, "fileCount": 136, "speciesCount": 136, "failures": 0, "lastData": "2019-05-11T06:55:55.508Z" } ] } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "properties": { "cameraLocation": { "type": "string", "description": "cameraLocation id." }, "data": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "month": { "type": "number" }, "dataCount": { "type": "number" }, "fileCount": { "type": "number" }, "speciesCount": { "type": "number" }, "failures": { "type": "number" }, "lastData": { "type": "date" } } } } } } ### Get identified species by project [GET /projects/{projectId}/image-species-group] 取得計畫已辨識的物種資料 - The user's permission should be 'administrator' or 'general-account'. + Parameters + projectId: `5cd6631299580e3eb17fe0f3` (string, required) - project ID. + Request Get identified species by project (application/json) + Response 200 (application/json) + Body { "records": [ { "_id": "5cd7c0100094ee25325380b7", "species": "其他", "count": 3826 }, { "_id": "5cd661e332a98b60839c6cb3", "species": "山羊", "count": 3938 }, { "_id": "5cd661e332a98b60839c6cb6", "species": "白鼻心", "count": 4327 }, { "_id": "5cd661e332a98b60839c6cb4", "species": "野豬", "count": 6765 }, { "_id": "5cd66618582a3ff6ae040591", "species": "鼠", "count": 10258 }, { "_id": "5cd661e332a98b60839c6cb1", "species": "獼猴", "count": 19227 }, { "_id": "5cd661e332a98b60839c6cb2", "species": "鼬獾", "count": 19646 }, { "_id": "5cd66620582a3f0ee504071a", "species": "鳥", "count": 22143 }, { "_id": "5cd661e332a98b60839c6caf", "species": "山羌", "count": 65849 }, { "_id": "5cd661e332a98b60839c6caa", "species": "空拍", "count": 90883 }, { "_id": "5cd661e332a98b60839c6cab", "species": "測試", "count": 95787 } ], "total": 376939, "time": 1558185524783 } # Group Species Metrics Get species metrics of the top 5 identified ones. ## By study area [GET /projects/{projectId}/study-areas/{studyAreaId}/species-time-series{?year}] 計畫前五大已辨識物種按樣區的按月動態 - The user's permission should be 'administrator' or 'general-account'. + Parameters + year: `2019` (number, required) - year to query. + Request Get top 5 species time series by study area (application/json) + Response 200 (application/json) + Body [ { "studyAreaId": "5ceb7925caaeca25bf2d55f1", "studyArea": "羅東處", "metrics": [ { "year": 2015, "month": 1, "metrics": [] }, { "year": 2015, "month": 2, "metrics": [] }, { "year": 2015, "month": 3, "metrics": [] }, { "year": 2015, "month": 4, "metrics": [] }, { "year": 2015, "month": 5, "metrics": [] }, { "year": 2015, "month": 6, "metrics": [] }, { "year": 2015, "month": 7, "metrics": [] }, { "year": 2015, "month": 8, "metrics": [ { "species": "測試", "speciesId": "5cd661e332a98b60839c6cab", "numberOfRecords": 54 }, { "species": "鼬獾", "speciesId": "5cd661e332a98b60839c6cb2", "numberOfRecords": 81 } ] }, { "year": 2015, "month": 9, "metrics": [ { "species": "山羌", "speciesId": "5cd661e332a98b60839c6caf", "numberOfRecords": 1408 }, { "species": "空拍", "speciesId": "5cd661e332a98b60839c6caa", "numberOfRecords": 45 }, { "species": "測試", "speciesId": "5cd661e332a98b60839c6cab", "numberOfRecords": 3055 }, { "species": "獼猴", "speciesId": "5cd661e332a98b60839c6cb1", "numberOfRecords": 201 }, { "species": "鼬獾", "speciesId": "5cd661e332a98b60839c6cb2", "numberOfRecords": 335 } ] }, { "year": 2015, "month": 10, "metrics": [ { "species": "山羌", "speciesId": "5cd661e332a98b60839c6caf", "numberOfRecords": 2497 }, { "species": "獼猴", "speciesId": "5cd661e332a98b60839c6cb1", "numberOfRecords": 423 }, { "species": "鼬獾", "speciesId": "5cd661e332a98b60839c6cb2", "numberOfRecords": 434 }, { "species": "空拍", "speciesId": "5cd661e332a98b60839c6caa", "numberOfRecords": 279 }, { "species": "測試", "speciesId": "5cd661e332a98b60839c6cab", "numberOfRecords": 1944 } ] }, { "year": 2015, "month": 11, "metrics": [ { "species": "空拍", "speciesId": "5cd661e332a98b60839c6caa", "numberOfRecords": 3481 }, { "species": "獼猴", "speciesId": "5cd661e332a98b60839c6cb1", "numberOfRecords": 424 }, { "species": "山羌", "speciesId": "5cd661e332a98b60839c6caf", "numberOfRecords": 2480 }, { "species": "測試", "speciesId": "5cd661e332a98b60839c6cab", "numberOfRecords": 1944 }, { "species": "鼬獾", "speciesId": "5cd661e332a98b60839c6cb2", "numberOfRecords": 239 } ] }, { "year": 2015, "month": 12, "metrics": [ { "species": "山羌", "speciesId": "5cd661e332a98b60839c6caf", "numberOfRecords": 2860 }, { "species": "測試", "speciesId": "5cd661e332a98b60839c6cab", "numberOfRecords": 1910 }, { "species": "獼猴", "speciesId": "5cd661e332a98b60839c6cb1", "numberOfRecords": 471 }, { "species": "鼬獾", "speciesId": "5cd661e332a98b60839c6cb2", "numberOfRecords": 178 }, { "species": "空拍", "speciesId": "5cd661e332a98b60839c6caa", "numberOfRecords": 249 } ] } ] } ] ## By camera location [GET /projects/{projectId}/study-areas/{studyAreaId}/camera-locations/{cameraLocationId}/species-time-series{?year}] 計畫前五大已辨識物種按相機位置的按月動態 - The user's permission should be 'administrator' or 'general-account'. + Parameters + year: `2019` (number, required) - year to query. + Request Get top 5 species time series by camera location (application/json) + Response 200 (application/json) + Body [ { "cameraLocationId": "5ce75c057575450e6d79b84e", "cameraLocation": "WGS84", "metrics": [ { "year": 2015, "month": 1, "metrics": [] }, { "year": 2015, "month": 2, "metrics": [] }, { "year": 2015, "month": 3, "metrics": [] }, { "year": 2015, "month": 4, "metrics": [] }, { "year": 2015, "month": 5, "metrics": [] }, { "year": 2015, "month": 6, "metrics": [] }, { "year": 2015, "month": 7, "metrics": [] }, { "year": 2015, "month": 8, "metrics": [] }, { "year": 2015, "month": 9, "metrics": [] }, { "year": 2015, "month": 10, "metrics": [ { "species": "台灣獼猴", "speciesId": "5ce4f870cee4bc0aab7ba2d4", "numberOfRecords": 2 }, { "species": "no", "speciesId": "5cdc121831ff03804f15a3ef", "numberOfRecords": 6 }, { "species": "水鹿", "speciesId": "5cd661e332a98b60839c6cb0", "numberOfRecords": 3 } ] }, { "year": 2015, "month": 11, "metrics": [ { "species": "no", "speciesId": "5cdc121831ff03804f15a3ef", "numberOfRecords": 30 }, { "species": "水鹿", "speciesId": "5cd661e332a98b60839c6cb0", "numberOfRecords": 46 }, { "species": "黑冠麻鷺", "speciesId": "5cdc121931ff03454415a465", "numberOfRecords": 37 }, { "species": "台灣獼猴", "speciesId": "5ce4f870cee4bc0aab7ba2d4", "numberOfRecords": 13 } ] }, { "year": 2015, "month": 12, "metrics": [ { "species": "台灣獼猴", "speciesId": "5ce4f870cee4bc0aab7ba2d4", "numberOfRecords": 1 }, { "species": "黑冠麻鷺", "speciesId": "5cdc121931ff03454415a465", "numberOfRecords": 6 }, { "species": "no", "speciesId": "5cdc121831ff03804f15a3ef", "numberOfRecords": 3 }, { "species": "水鹿", "speciesId": "5cd661e332a98b60839c6cb0", "numberOfRecords": 7 } ] } ] } ] # Group Calculate ## The calculator [/calculator] ### Calculate OI [GET /calculator/oi{?cameraLocation,species,startTime,endTime,validTimeInterval,eventTimeInterval}] 計算有效照片與目擊事件。 Occurrence index - The user's permission should be 'administrator' or 'general-account'. - The user is joined the the project. + Parameters + cameraLocation: `5cdc1a3718ad11d97c794648` (string) - The camera location id. + species: `5cdc121631ff030c7b15a38c` (string) - The species id. + startTime: `2016-05-04T00:00:00.000Z` (string, optional) - The start time. + endTime: `2016-05-04T00:00:00.000Z` (string, optional) - The end time. + validTimeInterval: `60000` (number) - 有效時間判定間隔。單位:毫秒 + eventTimeInterval: `60000` (number) - 有效時間判定間隔。單位:毫秒 + Request Calculate OI (application/json) + Response 200 (application/json) + Body { "cameraLocationWorkDuration": 130999854000, "validQuantity": 13, "eventQuantity": 13 } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "cameraLocationWorkDuration": { "type": "integer", "description": "相機工作時數。單位:毫秒" }, "validQuantity": { "type": "integer", "description": "有效照片。" }, "eventQuantity": { "type": "integer", "description": "目擊事件。" } } } ### Calculate LTD [GET /calculator/ltd{?cameraLocation,species,startTime,endTime}] 計算初測延遲。 - The user's permission should be 'administrator' or 'general-account'. - The user is joined the the project. + Parameters + cameraLocation: `5cdc1a3718ad11d97c794648` (string) - The camera location id. + species: `5cdc121631ff030c7b15a38c` (string) - The species id. + startTime: `2016-05-04T00:00:00.000Z` (string, optional) - The start time. + endTime: `2016-05-04T00:00:00.000Z` (string, optional) - The end time. + Request Calculate LTD (application/json) + Response 200 (application/json) + Body [ { "time": "2016-05-03T16:00:00.000Z", "duration": null }, { "time": "2016-05-04T16:00:00.000Z", "duration": 67980000 }, { "time": "2016-05-05T16:00:00.000Z", "duration": null }, { "time": "2016-05-06T16:00:00.000Z", "duration": 71520000 } ] + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "time": { "type": "string" }, "duration": { "type": "integer", "description": "單位為 ms,如 71520000ms 代表 19小時又52分鐘。null 代表沒有照片。" } } } } # Group Project Areas ## List project areas [GET /project-areas{?index,size,sort}] 取得地區列表。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + index: `0` (number, optional) - The page index. + Default: 0 + size: `100` (number, optional) - The size of the result set. + Default: 100 + sort: `title.zh-TW` (enum[string], optional) ... + Default: `title.zh-TW` + Members + `title.zh-TW` + `title.en-US` + Request Get project areas (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 22, "items": [ { "id": "5c9af16a4ee1b606477f9242", "title": { "zh-TW": "南投縣", "en-US": "Nantou County" } }, { "id": "5c9af16a4ee1b606477f9239", "title": { "zh-TW": "台中市", "en-US": "Taichung City" } }, { "id": "5c9af16a4ee1b606477f9236", "title": { "zh-TW": "台北市", "en-US": "Taipei City" } } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "description": "Documents.", "item": { "type": "object", "properties": { "id": { "type": "string" }, "title": { "type": "object", "properties": { "zh-TW": { "type": "string", "description": "Title in Traditional Chinese." }, "en-US": { "type": "string", "description": "Title in English." } } } } } } } } # Group Forest Compartment Boundary ## List forest compartment boundary [GET /forest-compartment-boundary{?decimalLongitude,decimalLatitude,size}] 取得林班地範圍。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + decimalLongitude: `121.1960595` (number, required) - Longitude represented in decimal number. + decimalLatitude: `23.7794695` (number, required) - Longitude represented in decimal number. + size: `10` (number, optional) - The size of the response (Note: limit pending). + Request GET forest compartment boundary (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 10, "total": 1, "items": [ { "id": "5c03a64d6efcfc9409780a50", "type": "Feature", "geometry": { "coordinates": [ [ [ 121.1689, 23.80766 ], [ 121.16964, 23.8072 ], [ 121.16996, 23.80717 ], [ 121.16841, 23.80723 ], [ 121.16865, 23.80753 ], [ 121.1689, 23.80766 ] ] ], "type": "Polygon" }, "properties": { "Name": "南投處", "altitudeMode": "clampToGround", "CMPT": "8", "AREA": "15101072.053", "WKNG": "12", "DIST_C": "南投處", "DIST": "04", "Field_1": "南投處", "WKNG_C": "丹大" } } ] } # Group Issues ## Create an issue [POST /issues] 聯絡我們 - 新增問題回報/意見反饋。 + Request Create an issue (application/json) + Body { "type": "issue", "categories": ["system"], "description": "hello", "email": "email@example.com", "attachmentFile": "5ccd2c3feb8a98a70489c322" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "type": { "type": "string", "description": "問題回報, 意見反饋", "enum": ["issue", "suggestion"] }, "categories": { "type": "array", "items": { "type": "string", "description": "系統操作, 帳號相關, 計畫管理, 檔案上傳, 資料編輯, 篩選及下載, 其他問題", "enum": [ "system", "account", "project-management", "file-upload", "data-edit", "search-and-download", "others" ] } }, "description": { "type": "string", "description": "問題描述" }, "email": { "type": "string" }, "attachmentFile": { "type": "string", "description": "附件檔案 id,上傳 `type` 為 `issue-attachment` 檔案。" } } } + Response 200 (application/json) + Body { "id": "5ccfa6d1657c6220127b048b", "type": "issue", "category": ["system"], "description": "hello", "email": "email@example.com", "attachmentFile": { "id": "5ccd2c3feb8a98a70489c322", "type": "issue-attachment", "originalFilename": "IMG_4378.JPG", "filename": "5ccd2c3feb8a98a70489c322.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/issue-attachments/5ccd2c3feb8a98a70489c322.jpg" } } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string" }, "categories": { "type": "array", "items": { "type": "string", "description": "系統操作, 帳號相關, 計畫管理, 檔案上傳, 資料編輯, 篩選及下載, 其他問題", "enum": [ "system", "account", "project-management", "file-upload", "data-edit", "search-and-download", "others" ] } }, "description": { "type": "string" }, "email": { "type": "string" }, "attachmentFile": { "type": "object", "properties": { "id": { "type": "string" }, "url": { "type": "string" } } } } } # Group Files ## Upload a file [POST /files{?type,cameraLocation,lastModified}] 上傳檔案。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + type: `project-cover-image` (enum[string]) - File type/purpose. project-cover-image, annotation-image (上傳單一圖片), annotation-video (上傳單一影片), annotation-csv (上傳單一csv), annotation-zip (上傳包含多張圖片、多個影片,或多個允許的媒體加上 csv 的壓縮檔) + Members + `project-cover-image` + `annotation-image` + `annotation-video` + `annotation-csv` + `annotation-zip` + cameraLocation: `5c9af16a4ee1b606477f922f` (string) - 上傳 annotation 相關檔案時必須包含相機位置 + lastModified: `2018-03-06T02:34:56.000Z` (string) - 上傳單一影片時必須上傳檔案的最後編輯時間 + Request Upload a file (multipart/form-data; boundary=------FormBoundaryShouldDifferAtRuntime) ------FormBoundaryShouldDifferAtRuntime Content-Disposition: form-data; name="file"; filename="" Content-Type: application/octet-stream ------FormBoundaryShouldDifferAtRuntime + Response 200 (application/json) + Body { "id": "5c9afa256c59080852644719", "type": "project-cover-image", "originalFilename": "432x324c.jpg", "filename": "5c9afa256c59080852644719.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/project-covers/5c9afa256c59080852644719.jpg", "size": 26172, "uploadSession": "5ca996477242134e2593331d" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": ["project-cover-image", "annotation-image", "annotation-video", "annotation-csv", "annotation-zip"] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." }, "uploadSession": { "type": "string", "description": "The upload session ID of this file." } } } ## Upload a file for a particular annotation [POST /annotations/{annotationId}/file{?type,lastModified}] 針對標註上傳檔案。 不會更新標註的檔名及時間。 - The user's permission should be 'administrator' or 'general-account'. + Parameters + annotationId: `5cde3856ee6c2c0edbd4b1d4` (string) - The annotation id. + type: `annotation-image` (enum[string]) - File type/purpose. annotation-image (上傳單一圖片), annotation-video (上傳單一影片) + Members + `annotation-image` + `annotation-video` + lastModified: `2018-03-06T02:34:56.000Z` (string) - 上傳單一影片時必須上傳檔案的最後編輯時間 + Request Upload a file for the annotation (multipart/form-data; boundary=------FormBoundaryShouldDifferAtRuntime) ------FormBoundaryShouldDifferAtRuntime Content-Disposition: form-data; name="file"; filename="" Content-Type: application/octet-stream ------FormBoundaryShouldDifferAtRuntime + Response 200 (application/json) + Body { "id": "5c9afa256c59080852644719", "type": "project-cover-image", "originalFilename": "432x324c.jpg", "filename": "5c9afa256c59080852644719.jpg", "url": "https://s3-ap-northeast-1.amazonaws.com/camera-trap-api-dev/project-covers/5c9afa256c59080852644719.jpg", "size": 26172, "uploadSession": "5ca996477242134e2593331d" } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "id": { "type": "string", "description": "The file ID." }, "type": { "type": "string", "description": "檔案類別", "enum": ["annotation-image", "annotation-video"] }, "originalFilename": { "type": "string", "description": "原始檔名" }, "filename": { "type": "string", "description": "儲存於 S3 的檔名" }, "url": { "type": "string", "format": "uri" }, "size": { "type": "integer", "description": "File size in byte." }, "uploadSession": { "type": "string", "description": "The upload session ID of this file." } } } #Group Cameras ## List Cameras [GET /cameras{?index,size,sort,manufacturer,model,sn,vn}] 取得相機 - The user's permission should be 'administrator' or 'general-account'. + Parameters + index: `0` (number, optional) - The page index. + Default: 0 + size: `100` (number, optional) - The size of the result set (1~100). + Default: 100 + sort: `name` (enum[string], optional) + Default: `name` + Members + `name` + manufacturer: `Browning` (string, optional) - 使用廠牌搜尋條件 + model: `BR5PXD` (string, optional) - 使用型號搜尋 + sn: `MX3862A` (string, optional) - 搜尋相機序號 + vn: `BRN00012` (string, optional) - 搜尋廠商維護編號 + Request List Cameras (application/json) + Response 200 (application/json) + Body { "index": 0, "size": 100, "total": 1, "items": [ { "id": "5c9f28070d9cee99f8a11a12", "name": "PT02A", "sn": "MX3862A", "vn": "BRN00012", "propertyNumber": "AB12345", "manufacturer": "Browning", "model": "BR5PXD", "state": "維修中", } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "index": { "type": "integer", "description": "The page index." }, "size": { "type": "integer", "description": "The page size." }, "total": { "type": "integer", "description": "Total of all documents." }, "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機編號" }, "sn": { "type": "string", "description": "相機序號" }, "vn": { "type": "string", "description": "廠商維護編號" }, "propertyNumber": { "type": "string", "description": "相機財產編號" }, "manufacturer": { "type": "string", "description": "廠牌" }, "model": { "type": "string", "description": "型號" }, "state": { "type": "string", "description": "狀態", "enum": ["維修中", "使用中", "停用中", "已撤除"] }, } } } } } #Group Camera Manufacturers ## List Camera Manufacturers [GET /cameras-manufacturers{?name}] 取得相機廠牌 - The user's permission should be 'administrator' or 'general-account'. + Parameters + name: `Browning` (string, optional) - 使用 name 搜尋 + Request List Camera Manufacturers (application/json) + Response 200 (application/json) + Body { "items": [ { "id": "5c9f28070d9cee99f8a11a12", "name": "Browning", "dataCount": "100", } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機廠商名稱" }, "dataCount": { "type": "number", "description": "此廠商有多少個" }, } } } } } #Group Camera Models ## List Camera Models [GET /cameras-models{?name}] 取得相機廠牌 - The user's permission should be 'administrator' or 'general-account'. + Parameters + name: `BR5PXD` (string, optional) - 使用 name 搜尋 + Request List Camera Models (application/json) + Response 200 (application/json) + Body { "items": [ { "id": "5c9f28070d9cee99f8a11a12", "name": "BR5PXD", "dataCount": "100", } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機型號名稱" }, "dataCount": { "type": "number", "description": "此型號有多少個" }, } } } } } #Group Camera Serial Numbers ## List Camera Serial Numbers [GET /cameras-sn{?name}] 取得相機廠牌 - The user's permission should be 'administrator' or 'general-account'. + Parameters + name: `MX3862A` (string, optional) - 使用 name 搜尋 + Request List Camera Models (application/json) + Response 200 (application/json) + Body { "items": [ { "id": "5c9f28070d9cee99f8a11a12", "name": "MX3862A", "dataCount": "100", } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機序號名稱" }, "dataCount": { "type": "number", "description": "此序號有多少個" }, } } } } } #Group Camera Vendor maintenance Numbers ## List Camera Vendor maintenance numbers [GET /cameras-vn{?name}] 取得相機廠牌 - The user's permission should be 'administrator' or 'general-account'. + Parameters + name: `BRN00012` (string, optional) - 使用 name 搜尋 + Request List Camera Models (application/json) + Response 200 (application/json) + Body { "items": [ { "id": "5c9f28070d9cee99f8a11a12", "name": "BRN00012", "dataCount": "100", } ] } + Schema { "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "items": { "type": "array", "item": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string", "description": "相機廠商維護編號名稱" }, "dataCount": { "type": "number", "description": "此編號有多少個" }, } } } } }