1. Go to this page and download the library: Download tigusigalpa/manus-ai-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/ */
tigusigalpa / manus-ai-php example snippets
use Tigusigalpa\ManusAI\ManusAIClient;
$client = new ManusAIClient($_ENV['MANUS_AI_API_KEY']);
$task = $client->createTask('Write a concise release note for this PHP package.', [
'agent_profile' => 'standard',
'title' => 'Release note',
]);
printf("Created %s: %s\n", $task['task_id'], $task['task_url']);
$client = new ManusAIClient('your-api-key');
$client = new ManusAIClient('', bearerToken: 'oauth-access-token');
use Tigusigalpa\ManusAI\Helpers\WebhookHandler;
$payload = WebhookHandler::parsePayload($request->getContent());
if (WebhookHandler::isTaskCompleted($payload)) {
$attachments = WebhookHandler::getAttachments($payload);
}
if (WebhookHandler::isTaskAskingForInput($payload)) {
// Obtain the event ID from task.listMessages and call confirmAction().
}
use Tigusigalpa\ManusAI\Contracts\ManusAIClientInterface;
use Tigusigalpa\ManusAI\Laravel\ManusAI;
// Dependency injection
function createReleaseNote(ManusAIClientInterface $manus): array
{
return $manus->createTask('Write a release note.');
}
// Or the facade
$task = ManusAI::createTask('Write a release note.');