1. Go to this page and download the library: Download nexagon/flow-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$flow = new Flow\FlowClient("api-key-goes-here", "http://localhost:8000/");
// or
$flow->setApiEndpoint("http://sometest-endpoint.test");
$flow = new Flow\FlowClient("api-key-goes-here");
$stream = fopen("path/to/file.png", "r");
$mimetype = mime_content_type("path/to/file.png");
[$file,] = $flow->files->createAndUpload($stream, "file.png", $mimetype);
// Consume the file on order lines or other resources
$order_line_data = [
"files" => [$file->id],
... // Any other
$flow = new Flow\FlowClient("api-key-goes-here");
$stream = ...;
$name = ...;
$mimetype = ...;
[$file, ] = $flow->files->addFileVersion($stream, $name, $mimetype);
// You have access to all version
foreach ($file->versions as &$version) {
if ($version->latest) {
print_r("Im the latest version ($version->last_modified)! Download me here: $version->url");
}
}
$flow = new Flow\FlowClient("api-key-goes-here");
[$order, $request] = $flow->orders->retrieve(1);
echo $request->getStatusCode();
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.