Difference between revisions of "PHP client - OpenKM 5.1"
From OpenKM Documentation
(→Authentication) |
|||
Line 3: | Line 3: | ||
<source lang="php"> | <source lang="php"> | ||
<?php | <?php | ||
+ | // Register WSDL | ||
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl'); | $OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl'); | ||
+ | |||
+ | // Login | ||
$token = $OKMAuth->login('okmAdmin','admin'); | $token = $OKMAuth->login('okmAdmin','admin'); | ||
echo "Token: ".$token; | echo "Token: ".$token; | ||
+ | |||
+ | // Logout | ||
$OKMAuth->logout($token); | $OKMAuth->logout($token); | ||
?> | ?> | ||
</source> | </source> | ||
− | |||
== List documents == | == List documents == |
Revision as of 15:41, 8 March 2010
Authentication
<?php
// Register WSDL
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl');
// Login
$token = $OKMAuth->login('okmAdmin','admin');
echo "Token: ".$token;
// Logout
$OKMAuth->logout($token);
?>
List documents
<?php
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl');
$token = $OKMAuth->login('okmAdmin','admin');
echo "Token: ".$token;
$OKMAuth->logout($token);
?>
Create document
<?php
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl');
$token = $OKMAuth->login('okmAdmin','admin');
echo "Token: ".$token;
$OKMAuth->logout($token);
?>
List folders
<?php
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl');
$token = $OKMAuth->login('okmAdmin','admin');
echo "Token: ".$token;
$OKMAuth->logout($token);
?>
Create folder
<?php
$OKMAuth = new SoapClient('http://localhost:8080/OpenKM/OKMAuth?wsdl');
$token = $OKMAuth->login('okmAdmin','admin');
echo "Token: ".$token;
$OKMAuth->logout($token);
?>