Download the PHP package sbrimon/streamtape-php-client without Composer
On this page you can find all versions of the php package sbrimon/streamtape-php-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sbrimon/streamtape-php-client
More information about sbrimon/streamtape-php-client
Files in sbrimon/streamtape-php-client
Package streamtape-php-client
Short Description A PHP client for the Streamtape API.
License MIT
Informations about the package streamtape-php-client
Streamtape PHP Client
A simple PHP client for interacting with the Streamtape API. This client allows you to manage files, retrieve account information, and perform other operations easily via an object-oriented interface.
Features
- Retrieve Account Information
- Upload
- Remote Upload
- Remove Remote Upload
- Check Remote Upload Status
- File Info
- List Folder/Files
- Create Folder
- Rename Folder
- Delete Folder
- Rename File
- Move File
- Delete File
- Lists Running Conversions
- Lists Failed Conversions
- Get Thumbnail Image
Installation
You can install this library either by using Composer or by manually downloading the files.
1. Using Composer (recommended)
If you are using Composer, you can add this repository to your composer.json:
2. Manual Installation
If you prefer to manually install, download the Streamtape.php file and include it in your project like this:
Usage
Initialization
To use the client, you need to initialize the Streamtape class with your Streamtape credentials: your login and API key.
Get Account Information
You can retrieve your account information (such as email) by calling the AccountInfo() method.
Upload
To upload a file, use the Upload() method. You can pass a file, and optionally specify the folder, file name, and SHA256 hash.
Remote Upload
To add a remote upload, use the RemoteUpload() method by providing a remote URL and optional parameters like folder, custom name, and headers.
Remove Remote Upload
To remove a remote upload (or all), call the RemoveRemoteUpload() method and pass the remote upload ID or 'all' to delete all.
Check Remote Upload Status
To check the status of a remote upload, use the RemoteUploadStatus() method by providing the remote upload ID.
Get File Information
To retrieve file information, use the FileInfo() method with the file ID.
List Files
You can list files in a specific folder using the ListFiles() method.
Create New Folder
To create a new folder, use the NewFolder() method and specify the folder name (and optionally the parent folder ID).
Rename Folder
To rename an existing folder, use the RenameFolder() method by providing the folder ID and the new folder name.
Delete Folder
To delete a folder, use the DeleteFolder() method by providing the folder ID.
Rename File
To rename a file, use the RenameFile() method and provide the file ID and new file name.
Move File
You can move a file to a different folder with the MoveFile() method, by providing the file ID and the target folder ID.
Delete File
To delete a file, use the DeleteFile() method with the file ID.
Lists Running Conversions
You can retrieve a list of running conversions using the RunningConverts() method.
Lists Failed Conversions
To list all failed conversions, use the FailedConverts() method.
Get Thumbnail Image
To retrieve a thumbnail image for a specific file, use the Thumbnail() method and provide the file ID.
Available Methods
0. json() or toArray()
- those method return you json or array type data. you can use whichever you want to use
-
Example
-
$streamtape->ListFiles()->toArray(); //this will return array data. $streamtape->ListFiles()->json(); //this will return json data.
-
1. AccountInfo()
- Parameters: None
2. FileInfo($fileId)
- Parameters:
$fileId(required): The file ID to retrieve information for.
3. ListFiles($folder = null)
- Parameters:
$folder(optional): Folder ID to list files from. If not provided, lists files from the root.
4. NewFolder($name, $pid = null)
- Parameters:
$name(required): The name of the new folder to be created.$pid(optional): Parent folder ID (if creating inside another folder).
5. RenameFolder($folder, $name)
- Parameters:
$folder(required): The folder ID to rename.$name(required): The new name for the folder.
6. DeleteFolder($folder)
- Parameters:
$folder(required): The folder ID to delete.
7. RenameFile($file, $name)
- Parameters:
$file(required): The file ID to rename.$name(required): The new name for the file.
8. MoveFile($file, $folder)
- Parameters:
$file(required): The file ID to move.$folder(required): The folder ID to move the file to.
9. DeleteFile($file)
- Parameters:
$file(required): The file ID to delete.
10. RunningConverts()
- Parameters: None
11. FailedConverts()
- Parameters: None
12. Thumbnail($file)
- Parameters:
$file(required): The file ID to get the thumbnail for.
13. RemoteUpload($url, $folder = null, $name = null, $headers = null)
- Parameters:
$url(required): The remote URL to upload.$folder(optional): The folder ID to upload the file to.$name(optional): A custom name for the uploaded file.$headers(optional): Additional HTTP headers for the request.
14. RemoveRemoteUpload($id)
- Parameters:
$id(required): The remote upload ID to remove. Pass 'all' to remove all remote uploads.
15. RemoteUploadStatus($id)
- Parameters:
$id(required): The remote upload ID to check the status of.
16. Upload($videoFile, $fileName = null, $folder = null, $sha256 = null, $httponly = null)
- Parameters:
$videoFile(required): The file to upload (passed in a$_FILESarray).$fileName(optional): The desired file name on Streamtape.$folder(optional): The folder ID to upload the file to.$sha256(optional): The SHA256 hash of the file to upload.$httponly(optional): Whether or not to make the file available via HTTP only.
For additional API methods, refer to the Streamtape API documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Key Points:
- The installation section explains how to install via Composer or manually.
- The usage section covers initializing the client, getting account info, listing files, retrieving file info, and handling errors.
- The example usage section shows a real-world example.
- The methods section lists the available API methods you can use.
This README provides a complete and user-friendly guide for anyone who wants to use my PHP Streamtape client!