PHP code example of oneofftech / k-link-registry-client

1. Go to this page and download the library: Download oneofftech/k-link-registry-client library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

oneofftech / k-link-registry-client example snippets




 trailing slash for the KRegistry endpoint
// Specify the URL without the `/api/x.y` part.
$endpoint = 'https://test.klink.asia/kregistry';

$configurator = (new HttpClientConfigurator())->setEndpoint($endpoint);
$apiClient = ApiClient::fromConfigurator($configurator);

try {
    $application = $apiClient->application()->getApplication('appSecret', 'appUrl');
    var_dump($application->getEmail());
    var_dump($application->getPermissions());



    $application = $apiClient->application()->getApplication('appSecret', 'appUrl');
    var_dump($application->hasPermission('data-add'));