PHP code example of findbrok / php-watson-api-bridge
1. Go to this page and download the library: Download findbrok/php-watson-api-bridge 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/ */
findbrok / php-watson-api-bridge example snippets
use FindBrok\WatsonBridge\Bridge;
// Create a new bridge Object.
$bridge = new Bridge('username', 'password', 'baseUrl');
// Simple get request.
$queryParams = ['foo' => 'bar'];
$response = $bridge->get('uri', $queryParams);
// Simple post request.
$dataToPost = ['foo' => 'bar'];
$response = $bridge->post('uri', $dataToPost, 'json');
$stack = app()->make(BridgeStack::class);
$stack->mountBridge('myPIBridge', 'default', 'personality_insights');
$stack->mountBridge('myTABridge', 'default', 'tradeoff_analytics');
// Now use the Bridges stored in the Stack.
$response = $stack->conjure('myPIBridge')->post('/v3/profile', $dataToPost);
bash
$ composer
app.php
app.php
watson-bridge.php
put
watson-bridge.php
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.