PHP SDK
Install and use the RankVectors PHP SDK
Installation
composer require rankvectors/rankvectors-php
Quick Start
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = RankVectors\Configuration::getDefaultConfiguration();
$config->setApiKey('Authorization', 'YOUR_API_KEY');
$apiInstance = new RankVectors\Api\ProjectsApi(null, $config);
$createProjectRequest = new RankVectors\Model\CreateProjectRequest([
'name' => 'My Website',
'domain' => 'https://example.com',
'preferred_sdk' => 'php',
]);
try {
$project = $apiInstance->createProject($createProjectRequest);
echo "Project created: " . $project->getId();
} catch (Exception $e) {
echo 'Exception: ', $e->getMessage(), "\n";
}
More Examples
See the API Reference for complete API documentation.