PHPackages                             bahuma/xing-php-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. bahuma/xing-php-sdk

AbandonedArchivedLibrary[API Development](/categories/api)

bahuma/xing-php-sdk
===================

A PHP wrapper for the XING api

v0.0.1(10y ago)2879Apache 2.0PHP

Since Dec 20Pushed 10y ago1 watchersCompare

[ Source](https://github.com/bahuma/xing-php-sdk)[ Packagist](https://packagist.org/packages/bahuma/xing-php-sdk)[ Docs](https://github.com/bahuma/xing-php-sdk)[ RSS](/packages/bahuma-xing-php-sdk/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

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
------------

[](#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`](https://getcomposer.org/composer.phar) executable or use the installer.

    ```
    $ curl -sS https://getcomposer.org/installer | php
    ```
2. add the following to your composer.json

    ```
    {
        "require": {
        	"bahuma/xing-php-sdk": "dev-master"
        }
    }
    ```

    or just run

    ```
    $ composer require bahuma/xing-php-sdk
    ```
3. Run Composer: `php composer.phar install`

And you should be done.

Example
-------

[](#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
-------------------------

[](#obtaining-an-access-token)

To get an access token you first have to register your application. Head over to  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.

    ```
    $config = [
      'consumer_key'    => CONSUMER_KEY,
      'consumer_secret' => CONSUMER_SECRET,
      'token'           => '',
      'token_secret'    => '',
    ];

    $xingSdk = new XingSDK($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.

    ```
    $result = $xing_api->getRequestToken("http://dev.bahuma.io/xing2?page=redirect");
    ```

    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.

    ```
    $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);
    ```

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

    ```
    $result = $xing_api->getAccessToken($_GET['oauth_verifier']);
    ```

    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
----------------------------

[](#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.

    ```
    $config = array(
      'consumer_key'    => 'abc123456789xyz',
      'consumer_secret' => 'abc123456789xyz',
      'token'           => $access_token_from_my_database,
      'token_secret'    => $access_token_secret_from_my_database,
    );
    ```
2. Create a new XingSDK Object.

    ```
    $xingSdk = new XingSDK($config);
    ```
3. Get the Guzzle Client from the XingSDK Object.

    ```
    $xingClient = $xingSDK->getClient();
    ```
4. Make the request.

    ```
    // "users/me" is the endpoint of the Xing-API. See https://dev.xing.com/docs/resources
    $response = $xingClient->get('users/me');
    ```
5. Bonus: Get the request in a usable format.

    ```
    $beautiful_response = XingSDK::decodeResponse($response);
    print_r($beautiful_response);
    ```

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](http://docs.guzzlephp.org/).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3844d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7a6981f86767d0b4e5760bbff88d49e519d56613f489cf2a8bf8821d1cc6627?d=identicon)[bahuma20](/maintainers/bahuma20)

---

Top Contributors

[![bahuma20](https://avatars.githubusercontent.com/u/5746121?v=4)](https://github.com/bahuma20 "bahuma20 (5 commits)")

---

Tags

composerlibrary

### Embed Badge

![Health badge](/badges/bahuma-xing-php-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/bahuma-xing-php-sdk/health.svg)](https://phpackages.com/packages/bahuma-xing-php-sdk)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3661.2M46](/packages/tencentcloud-tencentcloud-sdk-php)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

563.5M11](/packages/checkout-checkout-sdk-php)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

252.5k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2478.1k](/packages/filescom-files-php-sdk)[aimeos/prisma

A powerful PHP package for integrating media related Large Language Models (LLMs) into your applications

1942.4k4](/packages/aimeos-prisma)[volcengine/volcengine-php-sdk

117.6k](/packages/volcengine-volcengine-php-sdk)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
