PHP code example of bahuma / xing-php-sdk

1. Go to this page and download the library: Download bahuma/xing-php-sdk 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/ */

    

bahuma / xing-php-sdk example snippets

 sh
    $ curl -sS https://getcomposer.org/installer | php
    
 javascript
    {
        "-sdk": "dev-master"
        }
    }
    
 php
   $config = [
     'consumer_key'    => CONSUMER_KEY,
     'consumer_secret' => CONSUMER_SECRET,
     'token'           => '',
     'token_secret'    => '',
   ];

   $xingSdk = new XingSDK($config);
   
 php
   $result = $xing_api->getRequestToken("http://dev.bahuma.io/xing2?page=redirect");
   
 php
      $config = [
        'consumer_key'    => CONSUMER_KEY,
        'consumer_secret' => CONSUMER_SECRET,
        'token'           => $the_temporary_saved_request_token,
        'token_secret'    => $the_temporary_saved_request_token_secret,
      ];

      $xingSdk = new XingSDK($config);
      
 php
   $result = $xing_api->getAccessToken($_GET['oauth_verifier']);
   
 php
   $config = array(
     'consumer_key'    => 'abc123456789xyz',
     'consumer_secret' => 'abc123456789xyz',
     'token'           => $access_token_from_my_database,
     'token_secret'    => $access_token_secret_from_my_database,
   );
   
 php
   $xingSdk = new XingSDK($config);
   
 php
   $xingClient = $xingSDK->getClient();
   
 php
   // "users/me" is the endpoint of the Xing-API. See https://dev.xing.com/docs/resources
   $response = $xingClient->get('users/me');
   
 php
   $beautiful_response = XingSDK::decodeResponse($response);
   print_r($beautiful_response);