Download the PHP package bahuma/xing-php-sdk without Composer

On this page you can find all versions of the php package bahuma/xing-php-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package xing-php-sdk

Xing PHP SDK

This is a PHP Wrapper for the Xing API based on guzzle 6. It simplifies the process of authenticating and requesting permission.

Installation

The best way to install Xing SDK is through composer:

The best way to install php-sdk-for-XING is through composer:

  1. Download the composer.phar executable or use the installer.

  2. add the following to your composer.json

    or just run

  3. Run Composer: php composer.phar install

And you should be done.

Example

You can find an advanced example in the file sample.php.

I recommend open this file and then read on.

Obtaining an Access Token

To get an access token you first have to register your application. Head over to https://dev.xing.com and register yourself for a Xing application to get the consumer key/secret which you have to use with this package.

Then you have to call the following functions in this order:

  1. getRequestToken

    Insert your consumer_key and your consumer_secret into the config array.

    Leave the token and token_secret blank.

    Then create a new XingSdk Object with this config.

    Then call the function with an url where the users are being redirected to after accepting the permissions. This URL is the callback-url.

    The function returns an array with three values.

    Save request_token and request_token_secret temporary. You'll need them in the next step.

    Redirect the user to the authorize_url. This is the page where the user clicks "accept".

  2. getAccessToken

    This function should be executed at the callback-url.

    Insert your consumer_key and your consumer_secret into the config array.

    Insert the request_token and request_token_secret from the previous field into the config array.

    Then create a new XingSdk Object with this config.

    Then call the function using the value of the GET-Parameter oauth_verifier, which has been set by XING.

    The function returns an array containing the access_token and the access_token_secret for the user, which has logged in. Save these values in your database or somewhere else where you can access them later.

Making calls to the XING-API

Now that you have obtained an access token, you can call the API. For example let's get the profile details of the user, which has logged in.

  1. Insert your consumer_key and your consumer_secret into the config array. Insert the access_token and access_token_secret from the user, which you have saved in your database,into the config array.

  2. Create a new XingSDK Object.

  3. Get the Guzzle Client from the XingSDK Object.

  4. Make the request.

  5. Bonus: Get the request in a usable format.

And that's it.

For help how to use other request methods (GET/POST/PUT/DELETE/PATCH) or send content with your request, see the Guzzle Documentation.


All versions of xing-php-sdk with dependencies

PHP Build Version
Package Version
Requires guzzlehttp/guzzle Version ^6.1
guzzlehttp/oauth-subscriber Version ^0.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package bahuma/xing-php-sdk contains the following files

Loading the files please wait ....