PHP code example of sdkfabric / notion

1. Go to this page and download the library: Download sdkfabric/notion 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/ */

    

sdkfabric / notion example snippets




nt = new \SdkFabric\Notion\Client::build('[access_token]');

// Returns a paginated list of Users for the workspace.
$response = $client->user()->getAll('Notion-Version', 'start_cursor', 1);

// Retrieves a User using the ID specified.
$response = $client->user()->get('Notion-Version', 'user_id');

// Retrieves a database object — information that describes the structure and columns of a database — for a provided database ID.
$response = $client->database()->get('Notion-Version', 'database_id');

// Retrieves a Page object using the ID specified.
$response = $client->page()->get('page_id');

// Creates a new page that is a child of an existing page or database.
$response = $client->page()->create(new Page());