For detailed usage please see examples for each method.
- Get All Projects
- Add Project
- Get Trial Project
- Get a Specific Project
- Update the Project - partial update
- Delete a Specific Project
- Delete Specific Project Videos
- Apply Template Preset on the Project
- Duplicate the Project
- Render the Project
- Get rendering status
- Generate Lego Screens Previews
- Cancel Lego Preview
- Get Project Preview URLs
Retrieves all projects based on search query.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$projects = $renderforestClient->getAllProjects(
3, // limit
1, // offset
true, // include API projects
'ASC', // order
'date', // order by
'quick' // search
);
- In the result the
renderedQualities
property is optional and present if the project is in renders queue (ongoing rend). - All the properties of
getAllProjects
function are optional.
Creates a project by given template id
.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$projectId = $renderforestClient->addProject(701); // template id
- Also, project-data is created with the following list of initial properties: templateId, title, duration, equalizer, isLego, extendableScreens, fps, projectVersion, screens, muteSfx, currentScreenId, projectColors (optional), themeVariableName (optional), themeVariableValue (optional).
- The "muteSfx" is false initially.
- If template is lego ("isLego": true), then no initial screen is added and "screens" defaults to []. Otherwise, at least one screen is present.
- The "currentScreenId" is the id of the first screen for non-lego templates & null for lego templates.
- The "projectColors" is optional and gets value if the template has default colors. Both lego & non-lego templates might have default colors.
- Both "themeVariableName" & "themeVariableValue" are optional and are added (both) if template has theme. Both lego & non-lego templates might have a theme.
This endpoint retrieves a trial project. Designed to allow the user to make a project (trial - without saving) before getting logged in to get an overall idea. The data can be used later to create real project (create project, update project-data with this data).
No authorization is required for this endpoint.
<?php
require '../../vendor/autoload.php';
$trialProject = \Renderforest\ApiClient::getTrialProject(701);
Gets a specific project by project id
.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$project = $renderforestClient->getProject(16970309);
See get specific project example
Updates the project (partial update).
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$projectId = $renderforestClient->updateProject(
16296675,
'new custom title', // new custom title
);
- Updated fields are
custom title
.
See update project partial example
Deletes a specific project by project id
.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$affectedRows = $renderforestClient->deleteSpecificProject(15747948);
See delete specific project example
Deletes specific project videos. The quality parameter is optional.
IMPORTANT: If you want to delete only a single quality video, you have to specify quality parameter, otherwise all quality videos of the project will be deleted.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$affectedRows = $renderforestClient->deleteSpecificProjectVideos(
16296971,
\Renderforest\Project\RenderQuality\Entity\RenderQuality::RENDER_QUALITY_360
);
See delete specific project videos example
Applies template preset on the project.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$projectId = $renderforestClient->applyTemplatePresetOnProject(
16297523,
294
);
See apply template preset on the project example
Duplicates the project by project id
.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$newProjectId = $renderforestClient->duplicateProject(16296675);
Renders the project with given quality. The possible values for the quality are: 0, 360, 720, and 1080. The watermark parameter is optional, must be in '.png' file format and have canvas size of 1920 x 1080 pixels, url length must not exceed 250 characters.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$queueId = $renderforestClient->renderProject(
16970309,
\Renderforest\Project\RenderQuality\Entity\RenderQuality::RENDER_QUALITY_360,
'https://example.com/watermark.png'
);
- The possible values of the quality are: 0, 360, 720, and 1080.
(Coming soon)
Generates previews for lego screens of a project.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$projectId = 12345; // Replace with your actual project ID
$params = [
'quality' => 0, // 0, 360, 720, 1080
'screenIds' => [1, 2, 3], // Replace with actual screen IDs
];
$previewUrl = $renderforestClient->generateLegoScreensPreviews($projectId, $params);
- The
quality
parameter is an integer:- 0 for video with watermark
- 720 for video without watermark
- The
screenIds
parameter is an array of screen IDs for which you want to generate previews.
See generate lego screens previews example
Cancels the lego preview for specified queue IDs of a project.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$projectId = 12345; // Replace with your actual project ID
$queueIds = [67890, 67891]; // Replace with actual queue IDs
try {
$result = $renderforestClient->cancelLegoPreview($projectId, $queueIds);
echo "Cancel Lego Preview Result: " . print_r($result, true) . PHP_EOL;
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
echo "Error: " . $e->getMessage() . PHP_EOL;
}
Retrieves preview URLs for a specific project.
<?php
require '../../vendor/autoload.php';
$renderforestClient = new \Renderforest\ApiClient(
'your-api-key',
'your-client-id'
);
$projectId = 12345; // Replace with your actual project ID
$params = [
'quality' => 720,
];
try {
$previewUrls = $renderforestClient->getProjectPreviewUrls($projectId, $params);
echo "Project Preview URLs: " . PHP_EOL;
print_r($previewUrls);
} catch (\GuzzleHttp\Exception\GuzzleException $e) {
echo "Error: " . $e->getMessage() . PHP_EOL;
}