Download the PHP package qaamgo/onlineconvert-api-sdk without Composer
On this page you can find all versions of the php package qaamgo/onlineconvert-api-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Rated 4.00 based on 1 reviews
Informations about the package onlineconvert-api-sdk
[!WARNING]
⚠️ This SDK is deprecated
qaamgo/onlineconvert-api-sdkis no longer maintained. Please migrate to the new API2Convert PHP SDK → https://github.com/QaamGo/api2convert-php (Packagist:api2convert/sdk).
Migrating to the new SDK
Install the new package:
Convert a file — what used to be a multi-step job flow (create job → add input → set conversion → start → poll → download) is now a single call:
See the new SDK's README for the full API: https://github.com/QaamGo/api2convert-php
Online Convert API version 2 PHP SDK
This SDK provides a code base to interact with the API version 2 of api2convert.com
Requirements
- PHP 8.3 or later
guzzlehttp/guzzle
Installation
[!WARNING] This package is abandoned. New integrations should use
api2convert/sdkinstead — see Migrating to the new SDK above.
The recommended way to install is through Composer.
Getting started
Configuration
Sending a full job
Downloading the Converted Files
You can download the converted files using the following code snippet:
Advanced usage
The class \OnlineConvert\Api::class has some shortcut methods that links it to the endpoints classes (EG: \OnlineConvert\Api::postFullJob()), but from the class you can call the real endpoint and their methods.
Also, you can create endpoint classes one by one if you like. For this, check \OnlineConvert\Endpoint\Abstracted::__construct()
IMPORTANT: The class \OnlineConvert\Endpoint\JobsEndpoint can be used to send both synchronous and asynchronuos jobs; check \OnlineConvert\Endpoint\JobsEndpoint::setAsync()
You can also set up different headers into the client, and do some process using the token of a job.
Manage exceptions
If you catch \OnlineConvert\Exception\OnlineConvertSdkException::class, you automatically catch all exception in this SDK
Getting url to upload file
- Send a job request
-
Take the following keys from a job: server and id. You can use \OnlineConvert\Api or \OnlineConvert\Endpoint\JobsEndpoint to get the job information. You will get something like:
-
Now with this information you can make this call:
- Also these token can be useful for some operations that you might want to share with your users
Uploading files directly to the Online-Convert.com servers via AJAX
Real life case: I want to send our user files directly to the API, because sending them to my app first and then to the API costs too much time.
Considerations: Normally, this will save us process time, space on the hard drive and improve user experience, but it's advised to have a fallback alternative that works without using JS.
The following example is using JQuery.
IMPORTANT: The upload MUST be done one by one. Thus, you need one form per file.
HTML CODE
JS
License
Apache-2.0 — see LICENSE.