This is unofficial TrueVault PHP client library that enables developers to implement a rich set of server-side functionality for accessing TrueVault's API.
- PHP 5
- Curl PHP extension
- Json PHP extension
require_once("lib/truevault.php");
define("TRUEVAULT_VAULT_ID", "12345678-1234-1234-1234-123456789012");
define("TRUEVAULT_API_KEY", "12345678-1234-1234-1234-123456789012");
define("TRUEVAULT_ACCOUNT_ID", "12345678-1234-1234-1234-123456789012");
$trueVault = new TrueVault(array(
"apiKey" => TRUEVAULT_API_KEY,
"accountId" => TRUEVAULT_ACCOUNT_ID
));
// get all vaults
// $trueVault->findAllVaults();
$schemas = $trueVault->schemas(TRUEVAULT_VAULT_ID);
$documents = $trueVault->documents(TRUEVAULT_VAULT_ID);
Document methods
$response = $documents->create(array("name" => "Don Joe"));
$documentId = $response["document_id"];
$documents->get($documentId);
$documents->update($documentId, array("name" => "Don John"));
$documents->delete($documentId);
$documents->search(array("page" => 1, "per_page"=> 3,"filter" => array("name" => array("type" => "not", "value" => "Susan"));
Schema methods
$schema = $schemas->create(array("name" => "name", "fields" => array(array("name" => "name", "index" => true, "type" => "string"))));
$schemaId = $schema["id"];
$schemas->get($schemaId);
$schemas->update($schemaId, array("name" => "user", "fields" => array(array("name" => "name", "index" => true, "type" => "string"))));
$schemas->get($schemaId);
$schemas->findAll();
$schemas->delete($schemaId);
TrueVault REST API Documentation
- Add BLOB support