praemunio / sdk
PHP client for the Praemunio public API
v1.0.1
2026-11-24 11:31 UTC
Requires
- php: ^8.1
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.3 || ^8.0
- guzzlehttp/psr7: ^1.7 || ^2.0 || ^3.0
- psr/http-client: ^1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.5
- phpunit/phpunit: ^8.0 || ^9.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-24 13:18:38 UTC
README
Client officiel pour l'API Praemunio — PHP
📦 Installation
composer require praemunio/sdk
Ou ajoutez à votre composer.json :
{
"require": {
"praemunio/sdk": "^1.0"
}
}
Puis exécutez :
composer install
🚀 Quick Start (5 minutes)
1. Obtenir vos clés API
Récupérez vos clés depuis le dashboard Praemunio :
- Public Key :
pk_test_...(sandbox) oupk_live_...(production) - Secret Key :
sk_test_...(sandbox) ousk_live_...(production)
2. Initialiser le client
<?php require_once __DIR__ . '/vendor/autoload.php'; use OpenAPI\Client\PraemunioClient; // Mode sandbox (tests) $client = PraemunioClient::sandbox('pk_test_xxx', 'sk_test_xxx'); // Mode production // $client = PraemunioClient::live('pk_live_xxx', 'sk_live_xxx');
3. S'authentifier
$client->authenticate(); echo "Access token: " . $client->getAccessToken() . "\n"; echo "Refresh token: " . $client->getRefreshToken() . "\n";
4. Premier appel API
$api = $client->createApi(); // Lister les workspaces $result = $api->workspacesDriveGet(); print_r($result);
5. Exemple complet
<?php require_once __DIR__ . '/vendor/autoload.php'; use OpenAPI\Client\PraemunioClient; $client = PraemunioClient::sandbox('pk_test_xxx', 'sk_test_xxx'); // Authentification $client->authenticate(); echo "Authentifié avec succès !\n"; // Premier appel API $api = $client->createApi(); $workspaces = $api->workspacesDriveGet(); echo "Workspaces: " . json_encode($workspaces) . "\n";
🔐 Authentification
Le SDK gère automatiquement l'authentification et le refresh des tokens :
// Authentification initiale $client->authenticate(); // Le token est renouvelé automatiquement lors des appels API // Vous pouvez aussi forcer le refresh : $client->refresh();
🌍 Environnements
| Environnement | URL | Utilisation |
|---|---|---|
| Sandbox | https://sandbox-api.praemunio.org/api/v1 |
Tests et développement |
| Live | https://api.praemunio.org/api/v1 |
Production |
// Sandbox (par défaut) $client = PraemunioClient::sandbox($publicKey, $secretKey); // Production $client = PraemunioClient::live($publicKey, $secretKey);
📚 Documentation complète
📋 Endpoints principaux
| Méthode | Endpoint | Description |
|---|---|---|
POST |
/auth/auth-token |
Authentification |
GET |
/workspaces/drive |
Lister les workspaces |
POST |
/teams/create |
Créer une équipe |
GET |
/folders/{id} |
Détails d'un dossier |
POST |
/documents/archive |
Archiver un document |
🤝 Support
- 📖 Documentation
- 🐛 Signaler un bug
- 💬 Discord