Skip to content

Thêm Dropbox Channel

Cần chuẩn bị trước

RequirementVì sao cần
Dropbox accountDùng để sign in và authorize app
Dropbox appDùng để generate App KeyApp Secret
ImgBed domain của bạnDùng cho OAuth redirect URI
Available Dropbox storageDùng làm nơi lưu file thực tế

Các bước thiết lập

Step 1: Tạo Dropbox App

  1. Mở Dropbox App Console:
text
https://www.dropbox.com/developers/apps
  1. Tạo app mới.
  2. Với access type, chọn:
text
App folder
  1. Đặt tên app dễ nhận biết, ví dụ imgbed-app.
  2. Mở app details page sau khi tạo xong.

Recommended access type:

Access TypeRecommendation
App folderRecommended. Phù hợp với cách ImgBed lưu files.
Full DropboxKhông recommended. ImgBed không cần access toàn bộ account.

Create Dropbox app

Step 2: Thêm Redirect URI

Trong Dropbox app details page, tìm OAuth hoặc Redirect URI settings và thêm:

text
https://your-domain.com/api/oauth/dropbox/callback

Nếu dùng admin panel từ nhiều domain, thêm từng callback URL tương ứng.

Configure redirect URI

Step 3: Configure App Permissions

Mở tab Permissions và enable ít nhất các scopes này:

ScopeRequiredPurpose
account_info.readRequiredĐọc account và quota information
files.metadata.readRequiredĐọc file và folder metadata để check path
files.metadata.writeRequiredTạo folders và ghi metadata
files.content.writeRequiredUpload files. Thiếu scope này sẽ gây lỗi required scope 'files.content.write'.
files.content.readRecommendedCho phép download, preview và temporary file links

Sau khi chọn scopes, nhấn Submit ở cuối page.

Add permissions

Important:

SituationCần làm gì
Bạn đổi scopesChạy lại token authorization flow và lấy Refresh Token mới.
Bạn chưa reauthorizeToken cũ sẽ không có permissions mới, nên uploads vẫn có thể fail.

Step 4: Copy App Credentials

Lưu hai giá trị này từ Dropbox app page:

Dropbox FieldImgBed Field
App keyApp Key
App secretApp Secret

Step 5: Điền Dropbox Channel

Trong Upload Settings, chọn Dropbox và điền:

ImgBed FieldNhập gì
Channel nameTên dễ nhận biết, ví dụ Main Dropbox
App KeyDropbox App key
App SecretDropbox App secret
Refresh TokenTạm thời để trống
Root directoryOptional. Mặc định là imgbed.
NoteOptional

Get token

Step 6: Lấy Refresh Token

  1. Trong ImgBed, nhấn Get Token.
  2. Sign in vào Dropbox account bạn muốn kết nối.
  3. Approve authorization prompt.
  4. Callback page sẽ hiển thị Refresh Token.
  5. Copy token đó.
  6. Quay lại ImgBed và paste vào field Refresh Token.

Copy token

Cách kiểm tra

CheckExpected Result
Channel cardDropbox channel xuất hiện sau khi save.
Channel switchChannel có thể enabled.
Token savedDetail page hiển thị Refresh Token đã được lưu.
Upload testTest image xuất hiện trong Dropbox app folder.

Nếu bật quota limits, nhấn quota query. Sau khi query thành công, channel card sẽ hiển thị used space, total space và last update time.

Quota query success

Troubleshooting

ProblemFix
ImgBed báo configuration incompleteKiểm tra App Key, App SecretRefresh Token đã điền đủ chưa.
Authorization thành công nhưng không thấy Refresh TokenNhấn Get Token lại và đảm bảo offline authorization flow được dùng.
Upload fail với required scope 'files.content.write'Enable files.content.write, nhấn Submit, rồi lấy Refresh Token mới.
Callback failXác nhận redirect URI là https://your-domain.com/api/oauth/dropbox/callback.
Không tìm thấy filesXác nhận Dropbox app được tạo ở mode App folder.

Quick Flow

text
Mở Dropbox App Console
-> Tạo app
-> Chọn App folder access
-> Thêm https://your-domain.com/api/oauth/dropbox/callback
-> Enable account_info.read / files.metadata.read / files.metadata.write / files.content.write
-> Có thể enable thêm files.content.read
-> Nhấn Submit
-> Copy App Key và App Secret
-> Điền vào ImgBed
-> Nhấn Get Token
-> Copy Refresh Token từ callback page
-> Paste lại vào ImgBed và save

References

  1. Dropbox App Console: https://www.dropbox.com/developers/apps
  2. Dropbox OAuth Guide: https://developers.dropbox.com/oauth-guide
  3. Dropbox Developer Guide: https://www.dropbox.com/developers/reference/developer-guide

Released as user documentation for CloudFlare ImgBed.