1. Go to this page and download the library: Download nmirceac/api-client-tools 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/ */
// you can create the payload from a file path
$filePayloadFromPath=\App\Api\Project::createFileFromPath('/path/to/file.extension');
// or from a request
$filePayloadFromRequest=\App\Api\Extension::createFileFromRequest(request(), 'file');
// you can also optionally specify the individual file role or order
$anotherFilePayload==\App\Api\Project::createFileFromPath('/path/to/another.file', 'guide', 1);
// you can then just upload the files to the proper endpoing
\App\Api\Endpoint::attachFile($id, ['files'=>[$filePayloadFromPath, $filePayloadFromRequest, $anotherFilePayload]]);
// you can also create the file from string and populate your own metadata
\App\Api\Endpoint::createFilePayload($metadata, $fileContents);
$metadata should contain at least name, mime, extension and size
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.