-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_record_by_id.php
More file actions
34 lines (24 loc) · 713 Bytes
/
get_record_by_id.php
File metadata and controls
34 lines (24 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
declare(strict_types=1);
use Novadaemon\Skyflow\Vault\Client;
use Novadaemon\Skyflow\ServiceAccount\Token;
require __DIR__.'/../vendor/autoload.php';
$tokenProvider = function (string $token): string {
if (Token::isExpired($token)) {
$token = Token::generateBearerToken('<YOUR_CREDENTIALS_FILE_PATH>');
return $token['accessToken'];
}
return $token;
};
$client = new Client(
vaultID: '<YOUR_VAULT_ID>',
vaultUrl: '<YOUR_VAULT_URL>',
tokenProvider: $tokenProvider
);
$response = $client->getRecordById(
table: '<TABLE_NAME>',
id: '<SKYFLOW_RECORD_ID>',
tokenization: true,
fields: ['<FIELD_NAME>', '<FIELD_NAME>']
);
var_dump($response);