User API

使用者能編輯自己的 account、name、email 和 password

PUT hostname/api/users/:id/setting

Path Parameters

Name
Type
Description

id

String

要編輯的使用者ID

Request Body

Name
Type
Description

account*

String

帳號

checkPassword*

String

確認密碼

password*

String

密碼

name*

String

暱稱/名稱

email*

String

電子郵件

{
    "status": "success",
    "message": "修改成功",
    "data": {
        "name": "user1123",
        "account": "us23r11223",
        "email": "us2r1@example.com"
    }
}

取得當前登入者個人資料

GET hostname/api/current_user

獲取前十名followers較多的使用者

GET hostname/api/users/top

登入使用者

POST hostname/api/login

Request Body

Name
Type
Description

account*

String

使用者帳號(登入用的)

password*

String

密碼

註冊使用者

POST hostname/api/users

Request Body

Name
Type
Description

name*

String

使用者暱稱/使用者名稱

account*

String

使用者帳號(登入用的)

email*

String

電子郵件

password*

String

密碼

checkPassword*

String

確認密碼

獲取指定使用者的個人資料

GET hostname/api/users/:id

Path Parameters

Name
Type
Description

id*

String

使用者ID

獲取使用者寫過的所有推文

GET hostname/api/users/:id/tweets

Path Parameters

Name
Type
Description

id*

String

使用者ID

獲取對應使用者所回覆的推文(包含回覆內容,會標記哪些推文是目前使用者喜歡和回覆)

GET hostname/api/users/:id/replied_tweets

Path Parameters

Name
Type
Description

id*

String

使用者ID

獲取對應使用者所喜歡的所有推文(標記目前推文是否被登入者喜歡或者回覆過)

GET hostname/api/users/:id/likes

Path Parameters

Name
Type
Description

id*

String

使用者ID

看見某使用者跟隨中的人(會標記哪些使用者是目前使用者所追隨的)

GET hostname/api/users/:id/followings

Path Parameters

Name
Type
Description

id*

String

使用者ID

看見某使用者的跟隨者(會標記哪些使用者是目前使用者所追隨的)

GET hostname/api/users/:id/followers

Path Parameters

Name
Type
Description

id*

String

更新個人資料表單(可上傳圖片、封面、更新自我介紹/暱稱)

PUT hostname/api/users/:id

Path Parameters

Name
Type
Description

id*

String

使用者ID

Request Body

Name
Type
Description

introduction

String

自我介紹

avatar

String

頭像(檔案位置)

cover

String

封面(檔案位置)

name*

String

暱稱/名稱

Last updated