# 取得交友TAB列表 API 目前 forum 採用 RESTful 的風格來撰寫 api,所有 HTTP STATUS CODE 不等於 200 時皆為錯誤 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ## 回應 外層固定格式 | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | code | string | 資料列表 | | message | string | 訊息 | | error | boolean | 一頁幾筆 | | [data](#data) | Object | API回應資料 | ### API ``` POST /api/user_friendship/data ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 必填 | | list_type | 是 | seen:誰看過我 ;near:學校附近 ; 最近上線: online(不用分頁),online_random(不用分頁) ,online_profile(原舊版online 需要分頁參數) ) | | page | 否 | 第幾頁 | | page_size | 否 | 一頁要取幾筆(不傳的話預設為 30) | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | [list](#list) | array | 資料列表 | | count | integer | 總筆數 | | page_size | integer | 一頁幾筆 | | curr_page | integer | 目前在第幾頁 | | total_page | integer | 共有幾頁 | | is_vip | boolean | 是否是VIP true / false | | is_finish_friendship | boolean | 是否完成交友設定 true / false | | count | integer | list數量 | ### list | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | user_id | string | 使用者 id | | zuvio_id | string | irs user id | | sex_code | string | 性別: M 男 F 女 | | tag | string | 個人標籤(前三個) | | online_status | integer | 1:上線中,0:未上線 | | nickname | string | 自己的暱稱 | | sub_department_name_str | string | 學校和系所名稱 | | user_icon | string | 頭像 | | user_background_icon | string | 使用者背景圖 | | updated_at | string | 更新日期 | ### 回應範例 http 200 ``` { "code": 0, "message": "sucess", "error": false, "data": { "list": [ { "user_id": "8", "zuvio_id": "341529", "sex_code": "M", "tag": "不知道#打疫苗#玩玩而已", "online_status": "0", "nickname": "新來的菜蟲", "user_name": "新來的菜蟲", "sub_department_name_str": "暨南大學", "sub_department_name": null, "university_name": "暨南大學", "user_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/F_E30A01.png", "user_background_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/", "updated_at": "2017-06-26 17:27:36" }, { "user_id": "3", "zuvio_id": "341534", "sex_code": "M", "tag": "太麻煩了吧#vtuber #打疫苗", "online_status": "0", "nickname": "新來的菜蟲", "user_name": "新來的菜蟲", "sub_department_name_str": "東吳大學", "sub_department_name": null, "university_name": "東吳大學", "user_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/F_E30A01.png", "user_background_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/", "updated_at": "2017-06-26 17:27:36" }, { "user_id": "1232", "zuvio_id": "1259804", "sex_code": "F", "tag": "#電影#獨立新女性#喜歡待在家", "online_status": "0", "nickname": "b010", "user_name": "新來的菜蟲", "sub_department_name_str": "尚未选单位 | 其它", "sub_department_name": "其它", "university_name": "尚未选单位", "user_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/F_E00A00.png", "user_background_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/B01F01.png", "updated_at": "2022-05-02 10:20:41" } ], "count": 1232, "list_type": "near", "is_vip": true, "is_finish_friendship": true, "user_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/F_E00A00.png", "user_background_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/B01F01.png", "curr_page": 1, "total_page": 411, "page_size": 3 } } ``` ### 回應範例(VIP用戶,學校附近,空資料) 回應範例 http 200 ``` { "code": 0, "message": "哎呀!目前線上沒有同學 :( 滑個論壇再回來看看吧 ", "error": false, "data": { "list": [], "count": 0, "list_type": "near", "is_vip": true, "is_finish_friendship": true, "curr_page": 1, "total_page": 0, "page_size": 20 } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 設定性別搜尋偏好 用戶設定交友性別搜尋偏好 ### API ``` POST /api/user_friendship/filter_sex_code ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | | sex_code | 是 | M:男性,F:女性,BOTH:兩者皆可 | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true / false | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 用戶所屬方案內容查詢 用戶目前方案資料查詢 ### API ``` GET /api/user_friendship/vip_plan ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | ### 回應 data list | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | plan_id | integer | 方案代碼 | | plan_name | string | 方案名稱 | | ticket_constant | integer | 方案設定的配對次數 | | ticket_number | string | 次數 | | amount | string | 金額(小數點第二位) | | plan_status | boolean | true:使用中,false:未使用 | | extra_data | string | 其他備註 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "user_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/M_E00A00.png", "user_background_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/B01F01.png", "ticket_number": "-1", "ticket_constant": 0, "is_vip": false, "list": [ { "plan_id": 1, "unit_name": "每個月", "amount_per_unit": "NT$390.00", "plan_note": "", "ticket_constant": 10, "plan_discount": "", "plan_name": "1個月", "plan_code": "VIP1", "amount": "NT$390.00", "plan_status": false, "extra_data": "" }, { "plan_id": 2, "unit_name": "每個月", "amount_per_unit": "NT$248.33", "plan_note": "熱門選擇", "ticket_constant": 20, "plan_discount": "折扣 36%", "plan_name": "6個月", "plan_code": "VIP6", "amount": "NT$1490.00", "plan_status": false, "extra_data": "" }, { "plan_id": 3, "unit_name": "每個月", "amount_per_unit": "NT$165.83", "plan_note": "最超值", "ticket_constant": 100, "plan_discount": "折扣 57%", "plan_name": "12個月", "plan_code": "VIP12", "amount": "NT$1990.00", "plan_status": false, "extra_data": "" } ] } } ``` ### 回應範例 http 400 ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 用戶所屬方案內容設定 用戶目前方案資料設定 ### API ``` POST /api/user_friendship/vip_plan ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | | plan_code | 是 | 方案代碼 | | transaction_id | 是 | 交易代碼 | | transaction_date | 是 | 交易日期 | | original_transaction_id | 否 | 原始交易ID | | original_transaction_date | 是 | 原始交易日期 | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true / false | | is_repeat | boolean |是否重複 true / false | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true, "is_repeat": false } } ``` ### 回應範例 交易重覆(original_transaction_id) http 200 ``` { "code": 0, "message": "交易重覆", "error": false, "data": { "status": false, "is_vip": true, "is_repeat": true, "list": { "original_transaction_date": "2023/7/21 17:37", "original_transaction_id": "2000000373402154", "user_id": "1235", "plan_id": "99999", "amount": "123", "extra_data": "3333", "plan_code": "VIP6", "transaction_date": "2023/8/16 16:52", "transaction_id": "2000000391199154" } } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 用戶設定照片-更新照片資訊(新版本,與上傳圖片合併一起) 用戶設定照片-更新照片資訊,更新完後只會回傳一筆 ### API ``` POST /api/user_friendship/user_photos ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | | photo_index | 是 | 照片順序 | | image_type | 是 | 圖片類型 png / jpeg / jpg / gif | | image | 是 |base64圖片編碼| ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true / false | | is_finish_friendship | boolean | 是否完成交友設定 true / false | | list[].id | string | 照片id | | list[].user_id | string | 用戶user_id | | list[].photo_url | string | 照片路徑(雲端檔案路徑) | | list[].photo_index | integer | 照片順序 | | list[].review_status | integer |0:未審核,1:審核成功,2:審核失敗 | | list[].created_at | string | 建立時間 | | list[].updated_at | string | 更新時間 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true, "is_finish_friendship": true, "list": [ { "id": 10, "user_id": 1236, "review_status": 0, "photo_index": 0, "photo_url": "", "created_at": "2023-08-11 15:12:43", "updated_at": "2023-08-11 15:12:43" } ] } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400101, "message": "參數驗證錯誤:photo_index => white_list:1/2/3/4/5/6, value=888", "error": true, "hostname": "c2a65813a231" } ``` # 用戶設定照片-取得所有照片列表 用戶設定照片-取得所有照片列表 ### API ``` GET /api/user_friendship/user_photos ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true / false | | is_finish_friendship | boolean | 是否完成交友設定 true / false | | list[].id | string | 照片id | | list[].user_id | string | 用戶user_id | | list[].photo_url | string | 照片路徑(雲端檔案路徑) | | list[].photo_index | integer | 照片順序 | | list[].review_status | integer |0:未審核,1:審核成功,2:審核失敗 | | list[].created_at | string | 建立時間 | | list[].updated_at | string | 更新時間 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "is_finish_friendship": true, "list": [ { "id": 3, "user_id": 1254, "review_status": 0, "photo_index": 1, "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-08-11 15:11:15" }, { "id": "3", "user_id": "1254", "photo_index": "1", "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "review_status": "0", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-08-11 15:11:15" }, { "id": 4, "user_id": 1254, "review_status": 0, "photo_index": 2, "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-08-11 15:11:15" }, { "id": "4", "user_id": "1254", "photo_index": "2", "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "review_status": "0", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-08-11 15:11:15" } ] } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400101, "message": "參數驗證錯誤:photo_index => white_list:1/2/3/4/5/6, value=888", "error": true, "hostname": "c2a65813a231" } ``` # 用戶照片-刪除 刪除用戶照片 ### API ``` DELETE /api/user_friendship/user_photos/{id} ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | id | 是 | 刪除照片id | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true 成功/ false失敗 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 建立聊天頻道 ### API ``` POST /api/channel ``` ### 參數新增 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | is_wave | 否 | 是否為打招呼 0:否,1:是 ,2:超級打招呼 ,預設為0 # 傳送聊天訊息 (私聊、隨聊) 文件連結: https://qt.zuvio.com.tw/doc/chicken/chat/message.html ### 參數新增 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | is_wave | 否 | 是否為打招呼 0:否,1:是 ,2:超級打招呼 3:其它 ,預設為3 | # 取得私訊頻道列表 API 取得私訊頻道列表 https://qt.zuvio.com.tw/doc/chicken/chat/channels.html ### API ``` GET /api/channel ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | | last_channel_ts | 否 | 時間分隔點 (若有傳,將無視 page) | | last_channel_id | 否 |頻道重複時的分隔點 | | page | 否 | 第幾頁 | | page_size | 否 | 一頁要取幾筆(不傳的話預設為 1000) | | is_friend | 否 | 1: 好友訊息, 0:陌生訊息,3:兩者皆有(預設3 兼容舊版) ### 回應 請參考這份文件 https://qt.zuvio.com.tw/doc/chicken/chat/channels.html # 用戶資料查詢 /api/intro 用戶資料查詢-六張照片&按鈕狀態 (新增參數 與回應參數資料) https://qt.zuvio.com.tw/doc/chicken/intro/get_intros.html ### API ``` GET /api/intro/{target_user_id} ``` ### 網址參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | target_user_id | 是 | 使用者id | | send_status | 否 | 用戶按鈕狀態 1:傳訊息,2:已發送,3:打招呼 (假資料使用) | | is_vip | 否 | 用戶是否為VIP (假資料使用) | ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | is_finish_friendship | boolean | 是否完成交友設定 true / false | | user_icon_review_status | integer |用戶大頭照 0:未審核,1:審核成功,2:審核失敗 | | send_status | integer | 用戶按鈕狀態 1:傳訊息,2:已發送,3:打招呼 | | filter_sex_code | string | M:男性,F:女性,BOTH:兩者皆可 | | is_vip | boolean | 是否是VIP true / false | | last_super_num | integer |超級打招呼剩餘次數 | | user_photos | array | 用戶照片資料 | | user_photos[].id | integer | 照片ID | | user_photos[].user_id | integer | 用戶ID | | user_photos[].photo_index | integer | 照片順序 | | user_photos[].photo_url | string | 照片路徑 | | user_photos[].created_at | string | 建立時間 | | user_photos[].updated_at | string | 更新時間 | | user_photos[].review_status | integer |0:未審核,1:審核成功,2:審核失敗 | ### 回應範例 http 200 ``` { "user": { "id": "1254", "sex_code": "F", "adj_code": "E00", "animal_code": "A00", "skin_code": "", "background_code": "B01", "foreground_code": "F01", "background_icon": "B01F01.png", "icon": "F_E00A00.png", "university_id": "291", "university_name": "健行科大", "school_level_id": "1", "sub_department_name": "土木工程(學)系", "zuvio_id": "1259818", "chat_status": "yes", "system_name": "irs", "zuvio_email": "b016@com.tw", "match_sex_code": null, "campaign_match_sex_code": null, "campaign_multi_match": "0", "friend_tip_enabled": "1", "nickname": "b016", "user_interests": "YES", "user_filter": 1, "permission": "0", "user_name": "新來的菜蟲", "user_icon_review_status" :1, "user_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/F_E00A00.png", "user_background_icon": "https://s3.hicloud.net.tw/forum.public/public/system/icon/B01F01.png", "animal_name": "菜蟲", "animal_description": "", "background_name": "綠幕背景", "background_description": "開天闢地時,什麼都沒有", "is_tip_filter": false }, "user_photos": [ { "id": 1, "user_id": 1254, "photo_index": 1, "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-07-24 10:22:27" }, { "id": 2, "user_id": 1254, "photo_index": 2, "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-07-24 10:22:27" }, { "id": 3, "user_id": 1254, "photo_index": 3, "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-07-24 10:22:27" }, { "id": 4, "user_id": 1254, "photo_index": 4, "photo_url": "https://s3.hicloud.net.tw/zuvio.public/public/files/profile/irs_1690793634ee23b1a28fcd47899887e3c3f2550b5a627cf965.png", "created_at": "2023-07-24 10:22:26", "updated_at": "2023-07-24 10:22:27" } ], "intros": [ { "type": "medal", "type_name": "個人事蹟", "permission": "private", "medals": [] }, { "type": "topic", "type_name": "主題", "permission": "public", "tags": [] }, { "type": "relation", "type_name": "交流傾向", "permission": "public", "tags": [ { "id": "2", "name": "沒有", "is_selected": true } ] }, { "type": "love", "type_name": "戀愛傾向", "permission": "public", "tags": [ { "id": "3", "name": "試試看", "is_selected": true }, { "id": "7", "name": "不要媽寶", "is_selected": true } ] }, { "type": "actor", "type_name": "大學角色", "permission": "public", "tags": [ { "id": "4", "name": "耍廢", "is_selected": true }, { "id": "5", "name": "搞笑", "is_selected": true }, { "id": "6", "name": "吃早餐", "is_selected": true } ] }, { "type": "article", "type_name": "發過的文章", "permission": "public", "article_count": 16 } ], "send_status": 1, "is_skin_button_new": false, "is_background_button_new": false } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400101, "message": "必要參數未傳:user_id", "error": true, "hostname": "c2a65813a231" } ``` # 用戶檢舉或封鎖-取得檢舉列表資料 用戶檢舉或封鎖列表 ### API ``` GET /api/chat/getBlockReasonsList ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | data | array | 資料列表 | | data[].id | string | id | | data[].need_text | boolean | 是否需要文字 true / false | | data[].reason_type | string |ban:封鎖,report:檢舉 | | data[].tag | string | 封鎖或檢舉理由 | | data[].title | string | 標題 | | data[].description | string | 描述 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": [ { "id": "10", "tag": "block_user", "reason_type": "ban", "need_text": false, "title": "封鎖這個用戶", "description": "封鎖後你們將無法再看見彼此與對話" }, { "id": "11", "tag": "info", "reason_type": "report", "need_text": false, "title": "不雅的照片或自介", "description": "您的意見回饋能幫助我們瞭解是否出現不適當的內容" }, { "id": "12", "tag": "scam", "reason_type": "report", "need_text": false, "title": "疑似詐騙集團", "description": "您的意見回饋能幫助我們瞭解是否出現不適當的內容" }, { "id": "13", "tag": "fake", "reason_type": "report", "need_text": false, "title": "假冒他人資料", "description": "您的意見回饋能幫助我們瞭解是否出現不適當的內容" }, { "id": "14", "tag": "other_info", "reason_type": "report", "need_text": true, "title": "其他", "description": "告訴我們他做了什麼?" } ] } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 用戶檢舉或封鎖-實作API 用戶檢舉或封鎖-實作API ### API ``` POST /api/chat/friendship_block ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶ID | | target_id | 是 |被封鎖的用戶ID | | action | 是 | block(舊版封鎖加檢舉), cancel(解除封鎖), ban(封鎖), report(檢舉) | | block_reason_id | 是 | 封鎖原因 ID (檢舉需要填) | | report_text | 否 | 封鎖原因 (其他) | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true 成功/ false失敗 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 用戶檢舉或封鎖-取得封鎖或檢舉理由 用戶檢舉或封鎖-取得封鎖或檢舉理由 ### API ``` GET /api/chat/friendship_blockReasons ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | target_id | 是 | 被封鎖/檢舉用戶ID | | user_id | 是 | 用戶 | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | id | string | id | | need_text | boolean | 是否需要文字 true / false | | reason_type | string |ban:封鎖,report:檢舉 | |tag | string | 封鎖或檢舉理由 | | title | string | 標題 | | description | string | 描述 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "id": 2, "channel_id": "54", "user_id": 1236, "target_id": 598, "block_reason_id": 10, "block_from": "forum", "reason_type": "ban", "report_text": "test", "bucket_id": null, "created_at": "2023-08-22 20:47:11", "judged_at": null, "is_banned": "1" } } ``` ### 回應查無資料 ``` { "code": 400403, "message": "permission error", "error": true, "hostname": "c2a65813a231" } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 取得用戶配對次數 取得用戶配對次數 ### API ``` GET /api/user_friendship/ticket_number ``` ### 參數(無) ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | ticket_number | number | -1~10 ,配對次數 (-1:無限次) | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "ticket_number": "-1" } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 設定用戶年齡狀態 用戶年齡狀態 ### API ``` POST /api/user_friendship/age_status ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | | age_status | 是 | 0:不知道 1:滿18歲 2:未滿18歲 | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true / false | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true } } ``` ### 回應範例 http 400 錯誤代碼 https://qt.zuvio.com.tw/doc/chicken/base/error_code.html ``` { "code": 400401, "message": "api token error or expired", "error": true, "hostname": "zuvio-forum-test" } ``` # 解鎖陌生訊息頻道API 解鎖陌生訊息頻道 ### API ``` POST /api/user_friendship/stranger_key_number ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | | target_id | 是 | 對方id | | channel_id | 是 | 頻道ID | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | status | boolean | true / false | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true } } ``` # 取得陌生訊息鎖匙數量 取得陌生訊息鎖匙數量API ### API ``` GET /api/user_friendship/stranger_key_number ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | stranger_key_number | int | 陌生訊息解鎖數量 999:無限次, -1:用完了 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "stranger_key_number": 3 } } ``` # 陌生訊息顯示參數 陌生訊息是否顯示 https://qt.zuvio.com.tw/doc/chicken/chat/channels.html ### API ``` GET {{server}}/api/channel/{channel_id}/message ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | user_id | 是 | 用戶user_id | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | is_show | boolean | true 顯示 / false 不顯示 | # 取得個人被點擊數量 取得個人被點擊數量API ### API ``` GET /api/user_friendship/profile_click ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | ### 回應 data | 欄位 | 型態 | 描述 | | --------------- | :---: | :-------------------------------- | | click_count | int | 個人被點擊數量 | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "click_count": 0 } } ``` # 重設個人被點擊數量 重設個人被點擊數量API ### API ``` POST /api/user_friendship/reset_profile_click ``` ### 參數 | 欄位 | 必填 | 描述 | | --------------- | :---: | :-------------------------------- | | api_token | 是 | api_token | | user_id | 是 | 用戶user_id | ### 回應範例 http 200 ``` { "code": 0, "message": "success", "error": false, "data": { "status": true } } ```