Skip to content

Thêm Yandex Channel

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

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

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

Step 1: Tạo Yandex OAuth App

  1. Mở trang tạo Yandex OAuth app:
text
https://oauth.yandex.com/client/new
  1. Nếu bị redirect sang sign in, hãy sign in bằng Yandex account trước.
  2. Tạo app mới.
  3. Đặt tên app dễ nhận biết, ví dụ imgbed-yandex.
  4. Tìm phần callback hoặc redirect URL settings.
  5. Nhập:
text
https://your-domain.com/api/oauth/yandex/callback

Step 2: Xác nhận Permissions

Với ImgBed Yandex integration hiện tại, giữ bốn permissions này trong Yandex.Disk REST API:

PermissionPurpose
cloud_api:disk.app_folderCho phép ImgBed lưu files trong app folder
cloud_api:disk.readĐọc files và download links
cloud_api:disk.writeUpload files, tạo folders và xóa files
Access to information about Yandex.DiskĐọc disk quota và used space

Nếu cũng thấy các permissions này trong Yandex ID API, chúng là optional:

Permission TextRecommendation
Access to username, first name and surname, genderOptional
Access to email addressOptional

Các tính năng upload, download, deletion và quota chủ yếu phụ thuộc vào bốn permissions Yandex.Disk REST API ở trên.

Configure Yandex Disk permissions

Step 3: Copy App Credentials

Sau khi app được tạo, copy:

Yandex FieldImgBed Field
Client IDClient ID
Client SecretClient Secret

Record Client ID and Secret

Step 4: Điền Yandex Channel

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

ImgBed FieldNhập gì
Channel nameTên dễ nhận biết, ví dụ Main Yandex
Client IDYandex app Client ID
Client SecretYandex app Client Secret
Refresh TokenTạm thời để trống
Root directoryOptional. Mặc định là imgbed.

Edit channel config

Step 5: Lấy Refresh Token

  1. Trong ImgBed, nhấn Get Token.
  2. Sign in vào Yandex 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 refresh token after authorization

Step 6: Save Channel

Sau khi điền đủ fields, save channel.

Quick Flow

text
Mở Yandex OAuth Console
-> Tạo app
-> Thêm https://your-domain.com/api/oauth/yandex/callback
-> Xác nhận Yandex Disk permissions
-> Copy Client ID và Client Secret
-> Điền Client ID / Client Secret vào ImgBed
-> Nhấn Get Token
-> Copy Refresh Token từ callback page
-> Paste lại vào ImgBed và save

References

  1. Register a Yandex app: https://yandex.com/dev/id/doc/en/register-client
  2. Get an authorization code through URL: https://yandex.com/dev/id/doc/en/codes/code-url
  3. Yandex OAuth token endpoint: https://yandex.com/dev/id/doc/en/tokens/token

Released as user documentation for CloudFlare ImgBed.