Download the PHP package aman-rawat/linkedin-api-php-client without Composer

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

LinkedIn API Client with OAuth 2 authorization written on PHP

Build Status Code Climate Packagist GitHub license

See index.php to get started.

Installation

You will need at least PHP 7.3. We match officially supported versions of PHP.

Use composer package manager to install the lastest version of the package:

Or add this package as dependency to composer.json.

If you have never used Composer, you should start here and install composer.

Get Started

Before you will get started, play visit to LinkedIn API Documentation. This will save you a lot of time and prevent some silly questions.

To start working with LinkedIn API, you will need to get application client id and secret.

Go to LinkedIn Developers portal and create new application in section My Apps. Save ClientId and ClientSecret, you will use them later.

Bootstrapping autoloader and instantiating a client

Getting local redirect URL

To start linking process you have to setup redirect url. You can set your own or use current one. SDK provides you a getRedirectUrl() helper for your convenience:

We recommend you to have it stored during the linking session because you will need to use it when you will be getting access token.

Setting local redirect URL

Set a custom redirect url use:

Getting LinkedIn redirect URL

In order of performing OAUTH 2.0 flow, you should get LinkedIn login URL. During this procedure you have to define scope of requested permissions. Use Scope enum class to get scope names. To get redirect url to LinkedIn, use the following approach:

Now you can take user to LinkedIn. You can use link or rely on Location HTTP header.

Getting Access Token

To get access token use (don't forget to set redirect url)

This method returns object of LinkedIn\AccessToken class. You can store this token in the file like this:

This way of storing tokens is not recommended due to security concerns and used for demonstration purpose. Please, ensure that tokens are stored securely.

Setting Access Token

You can use method setAccessToken() for the LinkedIn\Client class to set token stored as string. You have to pass instance of LinkedIn\AccessToken to this method.

Performing API calls

All API calls can be called through simple method:

There are 3 helper methods:

Examples

Perform api call to get profile information
List companies where you are an admin
Share content on a personal profile

Make sure that image URL is available from the Internet (don't use localhost in the image url).

Get Company page profile
Share content on a LinkedIn business page
Setup custom API request headers

Change different headers sent to LinkedIn API.

Change default API root

Some private API access there.

~Image Upload~

I assume you have to be LinkedIn partner or something like that.

Try to upload image to LinkedIn. See Rich Media Shares (returns "Not enough permissions to access media resource" for me).

Contributing

Please, open PR with your changes linked to an GitHub issue. You code must follow PSR standards and have PHPUnit tests.

License

MIT


All versions of linkedin-api-php-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-curl Version *
guzzlehttp/guzzle Version ^6.3
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 aman-rawat/linkedin-api-php-client contains the following files

Loading the files please wait ....