Download the PHP package happyr/linkedin-api-client without Composer

On this page you can find all versions of the php package happyr/linkedin-api-client. 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 linkedin-api-client

LinkedIn API client in PHP

Latest Version Build Status SensioLabsInsight Code Coverage Quality Score Total Downloads

A PHP library to handle authentication and communication with LinkedIn API. The library/SDK helps you to get an access token and when authenticated it helps you to send API requests. You will not get everything for free though... You have to read the LinkedIn documentation to understand how you should query the API.

To get an overview what this library actually is doing for you. Take a look at the authentication page from the API docs.

Features

Here is a list of features that might convince you to choose this LinkedIn client over some of our competitors'.

Installation

TL;DR

This library does not have a dependency on Guzzle or any other library that sends HTTP requests. We use the awesome HTTPlug to achieve the decoupling. We want you to choose what library to use for sending HTTP requests. Consult this list of packages that support php-http/client-implementation find clients to use. For more information about virtual packages please refer to HTTPlug. Example:

You do also need to install a PSR-7 implementation and a factory to create PSR-7 messages (PSR-17 whenever that is released). You could use Guzzles PSR-7 implementation and factories from php-http:

Now you may install the library by running the following:

If you are updating form a previous version make sure to read the upgrade documentation.

Finding the HTTP client (optional)

The LinkedIn client need to know what library you are using to send HTTP messages. You could provide an instance of HttpClient and MessageFactory or you could fallback on auto discovery. Below is an example on where you provide a Guzzle6 instance.

Usage

In order to use this API client (or any other LinkedIn clients) you have to register your application with LinkedIn to receive an API key. Once you've registered your LinkedIn app, you will be provided with an API Key and Secret Key.

LinkedIn login

This example below is showing how to login with LinkedIn.

How to post on LinkedIn wall

The example below shows how you can post on a users wall. The access token is fetched from the database.

You may of course do the same in xml. Use the following options array.

Configuration

The api options

The third parameter of LinkedIn::api is an array with options. Below is a table of array keys that you may use.

Option name Description
body The body of a HTTP request. Put your xml string here.
format Set this to 'json', 'xml' or 'simple_xml' to override the default value.
headers This is HTTP headers to the request
json This is an array with json data that will be encoded to a json string. Using this option you do need to specify a format.
response_data_type To override the response format for one request
query This is an array with query parameters

Changing request format

The default format when communicating with LinkedIn API is json. You can let the API do json_encode for you. The following code shows you how.

When using array('json'=>$body) as option the format will always be json. You can change the request format in three ways.

Understanding response data type

The data type returned from LinkedIn::api can be configured. You may use the forth construtor argument, the LinkedIn::setResponseDataType or as an option for LinkedIn::api

Below is a table that specifies what the possible return data types are when you call LinkedIn::api.

Type Description
array An assosiative array. This can only be used with the json format.
simple_xml A SimpleXMLElement. See PHP manual. This can only be used with the xml format.
psr7 A PSR7 response.
stream A file stream.
string A plain old string.

Use different Session classes

You might want to use an other storage than the default SessionStorage. If you are using Laravel you are more likely to inject the IlluminateSessionStorage.

You can inject any class implementing DataStorageInterface. You can also inject different UrlGenerator classes.

Using different scopes

If you want to define special scopes when you authenticate the user you should specify them when you are generating the login url. If you don't specify scopes LinkedIn will use the default scopes that you have configured for the app.

Framework integration

If you want an easier integration with a framwork you may want to check out these repositories:


All versions of linkedin-api-client with dependencies

PHP Build Version
Package Version
Requires php Version ^5.5 || ^7.0
php-http/client-implementation Version ^1.0
php-http/httplug Version ^1.0
php-http/message-factory Version ^1.0
php-http/discovery Version ^1.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 happyr/linkedin-api-client contains the following files

Loading the files please wait ....