PHP code example of connectholland / tulip-api-client

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

    

connectholland / tulip-api-client example snippets




$client = new ConnectHolland\TulipAPI\Client('https://api.example.com', '1.1');

// Calls https://api.example.com/api/1.1/contact/detail with id=1
$response = $client->callService('contact', 'detail', array('id' => 1));




$client = new ConnectHolland\TulipAPI\Client('https://api.example.com', '1.1');

// Calls https://api.example.com/api/1.1/contact/save
$response = $client->callService('contact', 'save', array(
    'firstname' => 'John',
    'lastname' => 'Doe',
    'email' => '[email protected]',
));




$client = new ConnectHolland\TulipAPI\Client('https://api.example.com', '1.1');

// Calls https://api.example.com/api/1.1/contact/save
$response = $client->callService('contact', 'save', array(
    'id' => 1,
    'firstname' => 'Jane',
    'lastname' => 'Doe',
    'email' => '[email protected]',
));




$client = new ConnectHolland\TulipAPI\Client('https://api.example.com', '1.1');

// Calls https://api.example.com/api/1.1/contact/save
$response = $client->callService('contact', 'save',
    array(
        'id' => 1,
        'firstname' => 'Jane',
        'lastname' => 'Doe',
        'email' => '[email protected]',
    ),
    array(
        'photo' => fopen('/path/to/files/photo.jpg', 'r'),
    )
);