Skip to content

Adding a Yandex Channel

What You Need First

RequirementWhy You Need It
A Yandex accountUsed to sign in and authorize Yandex Disk
A Yandex OAuth appUsed to generate the Client ID and Client Secret
Your ImgBed domainUsed for the OAuth redirect URI
Available Yandex Disk storageUsed as the actual file storage location

Setup Steps

Step 1: Create a Yandex OAuth App

  1. Open the Yandex OAuth app creation page:
text
https://oauth.yandex.com/client/new
  1. If you are redirected to sign in, sign in with your Yandex account first.
  2. Create a new app.
  3. Give the app a recognizable name, such as imgbed-yandex.
  4. Find the callback or redirect URL settings.
  5. Enter:
text
https://your-domain.com/api/oauth/yandex/callback

Step 2: Confirm Permissions

For the current ImgBed Yandex integration, keep these four permissions under Yandex.Disk REST API:

PermissionPurpose
cloud_api:disk.app_folderAllows ImgBed to store files in the app folder
cloud_api:disk.readReads files and download links
cloud_api:disk.writeUploads files, creates folders, and deletes files
Access to information about Yandex.DiskReads disk quota and used space

If you also see these permissions under Yandex ID API, they are optional:

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

Core upload, download, deletion, and quota features mainly depend on the four Yandex.Disk REST API permissions above.

Configure Yandex Disk permissions

Step 3: Copy App Credentials

After the app is created, copy:

Yandex FieldImgBed Field
Client IDClient ID
Client SecretClient Secret

Record Client ID and Secret

Step 4: Fill in the Yandex Channel

In Upload Settings, choose Yandex and fill in:

ImgBed FieldWhat To Enter
Channel nameA recognizable name, such as Main Yandex
Client IDThe Yandex app Client ID
Client SecretThe Yandex app Client Secret
Refresh TokenLeave it empty for now
Root directoryOptional. Defaults to imgbed.

Edit channel config

Step 5: Get the Refresh Token

  1. In ImgBed, click Get Token.
  2. Sign in to the Yandex account you want to connect.
  3. Approve the authorization prompt.
  4. The callback page will show a Refresh Token.
  5. Copy it.
  6. Return to ImgBed and paste it into the Refresh Token field.

Copy refresh token after authorization

Step 6: Save the Channel

After all fields are filled in, save the channel.

Quick Flow

text
Open Yandex OAuth Console
-> Create an app
-> Add https://your-domain.com/api/oauth/yandex/callback
-> Confirm Yandex Disk permissions
-> Copy Client ID and Client Secret
-> Fill Client ID / Client Secret into ImgBed
-> Click Get Token
-> Copy the Refresh Token from the callback page
-> Paste it back into ImgBed and 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.