---
# System prepended metadata

title: 潛水日誌手動新增
tags: [日誌]

---

# 潛水日誌手動新增

**API 修改紀錄**
|版本|日期|備註|
| ------------ |------------ |------------ |
| v1 |2024/03/19| 發佈 |
|<font color="#f00"> v1.1 |<font color="#f00">2024/04/25| <font color="#f00">加上自訂名稱與圖片


**潛水日誌手動新增**

帶入 [潛水日誌_明細](https://hackmd.io/wRZdL-q2QJmUEPNZ1q5Adg) 的資料後編輯
    
使用 [圖片上傳API](https://hackmd.io/Lq4vMNGvQkGKmkWzR32jJg) 把回傳的資料push到image array 
刪除直接變更image array 後儲存

#### 網址
https://{domain}/api/v1/member-dive-log/store

#### Http Method
POST

#### HTTP Header
accept-language : language code
apikey : apk key

#### HTTP Request Body 傳入參數

|欄位名稱|必填|型態|欄位|備註|
| ------------ | :-----------: |:-----------: |------------ |------------ |
|device_id|Y|int |手錶id
|serial_number|Y|string |手錶序號
|log_name|N|string |日誌自訂名稱
|dive_date|Y|string |潛水日期
|start_time|Y|string |開始時間
|end_time|Y|string |結束時間
|dive_mode_id|Y|int |潛水類型id
|max_depth|N|string |最大深度
|avg_depth|N|string |平均深度
|dive_time|N|string |潛水時間
|dive_place|N|string |潛水地點
|low_temp|N|string |最低水溫
|temperature|N|string |氣溫
|visibility|N|string |能見度
|weather|N|int |天氣id
|wind|N|int |風id
|water_flow|N|int |水流id
|wave|N|int |浪況id
|O2|N|string |O2%
|PO2|N|string |PO2
|capacity|N|string |氣瓶容量
|pressure|N|string |氣瓶壓力
|counterweight|N|string |配重
|buddy|N|string |潛伴
|feel|N|int |感受id
|remark|N|string |備註
|image|N|array |圖片列表
    
#### HTTP Response 回傳參數

|Name|Type|說明|
| ------------ | ------------ |------------ |



#### Request Header Authoriztion
```json
{
    "accept-language" : "en",     //or 'zh_tw'
    "apikey" : "api key string"
}
```

#### Json Example
Request Json
```json

{
    "device_id": 1,
    "serial_number": "2131231233",
    "dive_mode_id": 0,
    "max_depth": "55.83",
    "avg_depth": "27.62",
    "dive_time": "00:01:50",
    "dive_place": "潛水地點",
    "low_temp": "255",
    "temperature": "25",
    "visibility": "0",
    "O2": null,
    "PO2": "5",
    "capacity": null,
    "pressure": null,
    "counterweight": null,
    "buddy": "",
    "remark": "",
    "dive_date": "2024-02-27",
    "start_time": "19:55",
    "end_time": "19:57",
    "weather": 1,
    "wind": 1,
    "water_flow": 1,
    "wave": 1,
    "feel": 1,
    "image": [
        {
            "id": 1,
            "response": "https://url"
        }
    ]
}
```



Response Json Success
```json

{
    "status": true,
    "code": 200,
    "message": "Update Data Success"
}
```

Response Json Error
