Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eusonlito/skydriveapi
Microsoft SkyDrive PHP API
https://github.com/eusonlito/skydriveapi
Last synced: 6 days ago
JSON representation
Microsoft SkyDrive PHP API
- Host: GitHub
- URL: https://github.com/eusonlito/skydriveapi
- Owner: eusonlito
- License: apache-2.0
- Created: 2013-12-13T15:27:35.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-03-20T00:14:58.000Z (over 9 years ago)
- Last Synced: 2024-10-18T04:23:48.127Z (26 days ago)
- Language: PHP
- Size: 163 KB
- Stars: 2
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SkyDriveAPI
Microsoft SkyDrive PHP API.
Remeber to create your authorized application in https://account.live.com/developers/applications
Once created, configure this API with the Client ID and Client Secret values.
If you are using a multi-subdomain environment, configure your application with first level domain, for example:
http://user1.mydomain.com/, http://user2.mydomain.com/, ... > Redirect URI = http://mydomain.com/
## LOAD
```php
include 'SkyDriveAPI.php';try {
$SkyDrive = new SkyDriveAPI\SkyDriveAPI([
'client_id' => 'XXXXX',
'client_secret' => 'XXXXXXXX'
]);
} catch (Exception $e) {
die(
''.$e->getMessage().'
'.
'You can to try to authenticate again here
'
);
}
```## FUNCTIONS
### me()
```php
# Get current account info
$account = $SkyDrive->me();
```### me('quota')
```php
# Get quota info
$quota = $SkyDrive->me('quota');
```### me('permissions')
```php
# Get permissions info
$permissions = $SkyDrive->me('permissions');
```### folderContents($folder_id)
```php
# Get folder contents
# Returns array with 'location', 'folders' and 'files' list
$contents = $SkyDrive->folderContents($folder_id);
```### createFolder($folder_id, $name)
```php
# Create a new folder
$folder = $SkyDrive->createFolder($folder_id, $name);
```### uploadFile($local_file_path, $name, $folder_id)
```php
# Upload file (returns array info with new file information)
$file = $SkyDrive->uploadFile(__FILE__, uniqid().'.txt', $folder_id);
```### downloadFile($file_id)
```php
# Download file (returns file contents)
$contents = $SkyDrive->downloadFile($file_id);
```### delete($file_id | $folder_id)
```php
# Delete file / folder
$SkyDrive->delete($file_id);
```### copy($file_id)
```php
# Copy file into another folder
$SkyDrive->copy($file_id, $folder_id);
```### move($file_id | $folder_id)
```php
# Move file / folder into another folder
$SkyDrive->move($file_id, $folder_id);
```I will add more features :)