PHP code example of kylewlawrence / infinity-api-client-php

1. Go to this page and download the library: Download kylewlawrence/infinity-api-client-php 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/ */

    

kylewlawrence / infinity-api-client-php example snippets

 php
// load Composer
nfinity\Api\HttpClient as InfinityAPI;

$workspace = 1234; // replace this with your Infinity workspace ID
$bearer     = "6wiIBWbGkBMo1mRDMuVwkw1EPsNkeUj95PIz2akv"; // replace this with your Infinity Personal Access/Bearer token

$client = new InfinityAPI($workspace);
$client->setAuth('bearer', ['bearer' => $bearer]);
 php
// Get all boards
$boards = $client->boards()->getAll();
print_r($boards);

// Create a new board
$newBoard = $client->boards()->create([
    'name' => 'Blah Blah',                          
    'description' => 'Bler bleman blope',                     
    'user_ids' => [1234, 1235, 12346],      
]);
print_r($newBoard);

// Update an item
$client->boards('PWefUeHA8Pd')->items('364019f5-0198-407b-931a-4f8ea51ecc28')->update(',[
    'folder_id' => 'U7MjUC5jNpM'
]);

// Delete an item value
$client->boards('PWefUeHA8Pd')->items(''364019f5-0198-407b-931a-4f8ea51ecc28'')->values()->delete('8b9fee67-600c-499f-ab19-04bd9092be4e');

// Get all workspaces
$workspaces = $client->workspaces()->getAll();
print_r($workspaces);
 php
$boards = $this->client->boards('PWefUeHA8Pd')->items()->getAll(['after' => '8b9fee67-600c-499f-ab19-04bd9092be4e', 'sort_by' => 'created_at', 'limit' => 100]);