i18n/zh-TW/pcloud/SKILL.md
全面的 pCloud 雲端儲存 API 整合與 SDK 使用指南。適用於建構與 pCloud 互動的應用程式:(1) 檔案上傳/下載/管理、(2) 資料夾操作、(3) OAuth 2.0 認證、(4) 檔案/資料夾分享與公開連結、(5) 媒體串流(影片/音訊/HLS)、(6) 壓縮封存(zip/解壓縮)、(7) 縮圖、(8) 垃圾桶管理、(9) 檔案版本、(10) 收藏集、(11) 上傳連結,或 (12) 使用任何 pCloud SDK(JavaScript、PHP、Java、Swift、C)。
npx skillsauth add tai-ch0802/skills-bundle pcloudInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
pCloud 是一個雲端儲存服務,提供 REST 風格的 HTTP JSON API 和二進位協議。主要功能:
[!IMPORTANT] pCloud 運營兩個資料中心。根據使用者的資料位置使用正確的主機名稱。
| 位置 | API 主機名稱 | OAuth 主機名稱 |
|------|-------------|----------------|
| 美國(locationid=1) | api.pcloud.com | my.pcloud.com |
| 歐洲(locationid=2) | eapi.pcloud.com | e.pcloud.com |
OAuth 授權後,重新導向 URL 會包含 locationid 和 hostname 參數,指示該使用者應使用哪個 API 端點。務必儲存並使用每個使用者對應的正確主機名稱。
起始頁面:https://my.pcloud.com/oauth2/authorize(美國)或 https://e.pcloud.com/oauth2/authorize(歐洲)
兩種流程:
授權碼流程(伺服器應用) — 透過重新導向返回 code → 使用 oauth2_token 交換 access_token
GET https://my.pcloud.com/oauth2/authorize?
client_id=APP_ID&
response_type=code&
redirect_uri=REDIRECT_URI&
state=RANDOM
重新導向返回:?code=XXXXX&locationid=1&hostname=api.pcloud.com
然後使用 code + client_secret 呼叫 oauth2_token 取得 bearer token。
隱式流程(純客戶端/行動應用) — 直接在重新導向片段中返回 access_token
GET https://my.pcloud.com/oauth2/authorize?
client_id=APP_ID&
response_type=token&
redirect_uri=REDIRECT_URI
重新導向返回:#access_token=XXXXX&token_type=bearer&locationid=1&hostname=api.pcloud.com
在每個 API 呼叫中使用 Authorization 標頭傳遞 access_token:
GET https://api.pcloud.com/listfolder?folderid=0
Authorization: Bearer ACCESS_TOKEN
警告:請勿將 token 作為 URL 參數(
?auth=...)或放在multipart/form-data欄位中傳遞。如果未使用標頭傳遞 token,pCloud API 可能會靜默拒絕請求或回傳2000: Log in failed。
getdigest 取得摘要userinfo,帶 getauth=1&logout=1&username=EMAIL&digest=DIGEST&passworddigest=SHA1(PASSWORD+SHA1(USERNAME_LOWERCASE)+DIGEST)&authexpire=SECONDSauth 令牌所有方法接受 GET 和 POST。基底 URL:https://api.pcloud.com/METHOD_NAME
# GET 請求
curl -s -H "Authorization: Bearer TOKEN" "https://api.pcloud.com/listfolder?folderid=0"
# POST 請求
curl -s -X POST "https://api.pcloud.com/listfolder" \
-H "Authorization: Bearer TOKEN" \
-d "folderid=0"
// 成功
{ "result": 0, ... }
// 錯誤
{ "result": 2000, "error": "Log in required." }
使用 POST 搭配 multipart/form-data。參數必須在檔案之前:
curl -s -X POST "https://api.pcloud.com/uploadfile" \
-H "Authorization: Bearer TOKEN" \
-F "folderid=0" \
-F "file=@/path/to/file.jpg"
可在單一請求中上傳多個檔案。設定 renameifexists=1 以避免覆寫。
這些可選參數適用於所有方法(在個別方法文件中省略):
authexpire — 令牌到期秒數(登入時)authinactiveexpire — 閒置 N 秒後到期device — 裝置識別字串folderid(整數)或 path(字串)。根目錄始終為 folderid=0fileid(整數)或 path(字串)folderid/fileid 和 path 都可接受;若兩者都提供,folderid/fileid 優先每個檔案/資料夾都會回傳中繼資料物件:
{
"name": "file.jpg",
"isfolder": false,
"fileid": 1729212,
"parentfolderid": 0,
"size": 73269,
"contenttype": "image/jpeg",
"category": 1,
"created": "Wed, 02 Oct 2013 14:29:11 +0000",
"modified": "Wed, 02 Oct 2013 14:29:11 +0000",
"hash": 10681749967730527559,
"isshared": false,
"ismine": true,
"thumb": true,
"icon": "image"
}
分類:0=未分類、1=圖片、2=影片、3=音訊、4=文件、5=封存檔
curl -s -H "Authorization: Bearer TOKEN" "https://api.pcloud.com/listfolder?folderid=0&recursive=1"
curl -s -H "Authorization: Bearer TOKEN" -F "folderid=0" -F "[email protected]" \
https://api.pcloud.com/uploadfile
curl -s -H "Authorization: Bearer TOKEN" "https://api.pcloud.com/getfilelink?fileid=123"
# 回傳:{ "hosts": ["c123.pcloud.com"], "path": "/cfZka..." }
# 下載 URL:https://c123.pcloud.com/cfZka...
curl -s -H "Authorization: Bearer TOKEN" "https://api.pcloud.com/sharefolder?folderid=123&[email protected]&permissions=edit"
curl -s -H "Authorization: Bearer TOKEN" "https://api.pcloud.com/getfilepublink?fileid=123"
按需載入這些參考資料:
development
Unified testing skill — TDD workflow, unit/integration patterns, E2E/Playwright strategies. Replaces tdd-workflow + testing-patterns + webapp-testing.
testing
Security-first skill vetting for AI agents. Use before installing any skill from ClawdHub, GitHub, or other sources. Checks for red flags, permission scope, and suspicious patterns.
development
Spec-Driven Development (SDD): A structured workflow (Requirement -> Analysis -> Implementation) enforcing explicit documentation before coding.
development
Methodologies for System Analysis (SA), focusing on technical architecture, data flow modeling, and API design.