Skip to content

Yandex.ru Files Upload and Information using Yandex API v1

License

Notifications You must be signed in to change notification settings

xiopt/yandex-upload-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yandex Disk Api Client

This library is built to deal with Yandex Disk API.

Installation

composer require ainzz/yandex-upload-api

Usage

First you need to create an alias

use ainzz\Disk;
  • Get an Id from Yandex then use that id to create an object from the class
$disk = new Disk('Your Id');
  • Now you need to obtain a token from Yandex. To get the url where you can obtain the token call getLoginToken method.
$disk->getLoginToken();
  • The method call above, will return the url where you can get the token. The url will redirect you to the call back url specified while creating Yandex Disk API app. In your call back file you can call the following method. It will return the token.
Disk::handleCallback();
  • Having obtained to token, you need to set it.
$disk->setToken('your_token');
  • Now, you are ready to use all methods. For example:
$disk->aboutDisk();

You can also:

  • Upload files to your Yandex disk.
$disk->uploadFile('your_file');
  • Download files from your Yandex disk
$disk->downloadOwnFile('file_path');
  • Download files to your Yandex disk.
$disk->downloadOthersFile('url','whatever_you_want_to_name_it');
  • Save public files from Yandex disk to your Yandex disk.
$disk->saveToDisk('url');

-- And many more, see offical documentation

About

Yandex.ru Files Upload and Information using Yandex API v1

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages