'LinkedIn' class declaration.
This class provides generalized LinkedIn oauth functionality.
Synopsis
class LinkedIn
{
- // constants
- const _API_OAUTH_REALM = 'http://api.linkedin.com';
- const _API_OAUTH_VERSION = '1.0';
- const _DEFAULT_RESPONSE_FORMAT = 'xml';
- const _GET_RESPONSE = 'lResponse';
- const _GET_TYPE = 'lType';
- const _INV_SUBJECT = 'Invitation to connect';
- const _INV_BODY_LENGTH = 200;
- const _METHOD_TOKENS = 'POST';
- const _NETWORK_LENGTH = 1000;
- const _NETWORK_HTML = '<a>';
- const _RESPONSE_JSON = 'JSON';
- const _RESPONSE_JSONP = 'JSONP';
- const _RESPONSE_XML = 'XML';
- const _SHARE_COMMENT_LENGTH = 700;
- const _SHARE_CONTENT_TITLE_LENGTH = 200;
- const _SHARE_CONTENT_DESC_LENGTH = 400;
- const _URL_ACCESS = 'https://api.linkedin.com/uas/oauth/accessToken';
- const _URL_API = 'https://api.linkedin.com';
- const _URL_AUTH = 'https://www.linkedin.com/uas/oauth/authenticate?oauth_token=';
- const _URL_REQUEST = 'https://api.linkedin.com/uas/oauth/requestToken';
- const _URL_REVOKE = 'https://api.linkedin.com/uas/oauth/invalidateToken';
- const _VERSION = '3.2.0';
- // members
- protected $callback;
- protected $token = NULL;
- protected $application_key;
- protected $response_format = self::_DEFAULT_RESPONSE_FORMAT;
- public $last_request_headers;
- // methods
- public obj __construct()
- public void __destruct()
- public array bookmarkJob()
- public array bookmarkedJobs()
- private boolean checkResponse()
- public array closeJob()
- public array comment()
- public array comments()
- public array company()
- public array companyProducts()
- public array connections()
- public array createPost()
- public array deletePost()
- public array editJob()
- protected array fetch()
- public array flagPost()
- public array followCompany()
- public array followPost()
- public array followedCompanies()
- public str getApplicationKey()
- public str getApplicationSecret()
- public str getCallbackUrl()
- public str getResponseFormat()
- public array getToken()
- public array getTokenAccess()
- public array group()
- public array groupMemberships()
- public array groupPost()
- public array groupPostComments()
- public array groupPosts()
- public array groupSettings()
- public array invite()
- public static bool isId()
- public static bool isThrottled()
- public array job()
- public array joinGroup()
- public void lastRequestHeader()
- public void lastRequestUrl()
- public array leaveGroup()
- public array like()
- public array likePost()
- public array likes()
- public array message()
- public array postJob()
- public array profile()
- public array raw()
- public array removeSuggestedGroup()
- public array renewJob()
- public array retrieveTokenAccess()
- public array retrieveTokenRequest()
- public array revoke()
- public array search()
- public array searchCompanies()
- public array searchJobs()
- public array searchPeople()
- public void setApplicationKey()
- public void setApplicationSecret()
- public void setCallbackUrl()
- public array setGroupSettings()
- public void setResponseFormat()
- public array setToken()
- public array setTokenAccess()
- public array share()
- public array statistics()
- public array suggestedCompanies()
- public array suggestedGroups()
- public array suggestedJobs()
- public array unbookmarkJob()
- public array unfollowCompany()
- public array unlike()
- public array updateNetwork()
- public array updates()
- public static bool xmlToArray()
Constants
Name | Value |
---|---|
_API_OAUTH_REALM | 'http://api.linkedin.com' |
_API_OAUTH_VERSION | '1.0' |
_DEFAULT_RESPONSE_FORMAT | 'xml' |
_GET_RESPONSE | 'lResponse' |
_GET_TYPE | 'lType' |
_INV_SUBJECT | 'Invitation to connect' |
_INV_BODY_LENGTH | 200 |
_METHOD_TOKENS | 'POST' |
_NETWORK_LENGTH | 1000 |
_NETWORK_HTML | '<a>' |
_RESPONSE_JSON | 'JSON' |
_RESPONSE_JSONP | 'JSONP' |
_RESPONSE_XML | 'XML' |
_SHARE_COMMENT_LENGTH | 700 |
_SHARE_CONTENT_TITLE_LENGTH | 200 |
_SHARE_CONTENT_DESC_LENGTH | 400 |
_URL_ACCESS | 'https://api.linkedin.com/uas/oauth/accessToken' |
_URL_API | 'https://api.linkedin.com' |
_URL_AUTH | 'https://www.linkedin.com/uas/oauth/authenticate?oauth_token=' |
_URL_REQUEST | 'https://api.linkedin.com/uas/oauth/requestToken' |
_URL_REVOKE | 'https://api.linkedin.com/uas/oauth/invalidateToken' |
_VERSION | '3.2.0' |
Members
protected
- $application_key
- $callback
- $response_format
- $token
public
- $last_request_headers
Methods
private
- checkResponse() — Used to check whether a response LinkedIn object has the required http_code or not and returns an appropriate LinkedIn object.
protected
- fetch() — General data send/request method.
public
- __construct() — Create a LinkedIn object, used for OAuth-based authentication and communication with the LinkedIn API.
- __destruct() — The class destructor.
- bookmarkJob() — Bookmark a job.
- bookmarkedJobs() — Get list of jobs you have bookmarked.
- closeJob() — Close a job.
- comment() — Share comment posting method.
- comments() — Share comment retrieval.
- company() — Company profile retrieval function.
- companyProducts() — Company products and their associated recommendations.
- connections() — Connection retrieval function.
- createPost() — This creates a post in the specified group with the specified title and specified summary.
- deletePost() — This deletes the specified post if you are the owner or moderator that post.
- editJob() — Edit a job.
- flagPost() — This flags a specified post as specified by type.
- followCompany() — Follow a company.
- followPost() — Follows/Unfollows the specified post.
- followedCompanies() — Get list of companies you follow.
- getApplicationKey() — Get the application_key property.
- getApplicationSecret() — Get the application_secret property.
- getCallbackUrl() — Get the callback property.
- getResponseFormat() — Get the response_format property.
- getToken() — Get the token_access property.
- getTokenAccess() — [DEPRECATED] Get the token_access property.
- group() — Get information about a specific group.
- groupMemberships() — This returns all the groups the user is a member of.
- groupPost() — This gets a specified post made within a group.
- groupPostComments() — This returns all the comments made on the specified post within a group.
- groupPosts() — This returns all the posts within a group.
- groupSettings() — This returns the group settings of the specified group
- invite() — Send connection invitations.
- isId() — LinkedIn ID validation.
- isThrottled() — Throttling check.
- job() — Job posting detail info retrieval function.
- joinGroup() — Join the specified group, per:
- lastRequestHeader() — Returns the last request header from the previous call to the LinkedIn API.
- lastRequestUrl() — Returns the last request url from the previous call to the LinkedIn API.
- leaveGroup() — Leave the specified group, per:.
- like() — Like another user's network update, per:
- likePost() — Likes/unlikes the specified post, per:
- likes() — Retrieve network update likes.
- message() — Connection messaging method.
- postJob() — Job posting method.
- profile() — General profile retrieval function.
- raw() — Manual API call method, allowing for support for un-implemented API functionality to be supported.
- removeSuggestedGroup() — This removes the specified group from the group suggestions, per:
- renewJob() — Renew a job.
- retrieveTokenAccess() — Access token retrieval.
- retrieveTokenRequest() — Request token retrieval.
- revoke() — User authorization revocation.
- search() — [DEPRECATED] General people search function.
- searchCompanies() — Company search.
- searchJobs() — Jobs search.
- searchPeople() — General people search function.
- setApplicationKey() — Set the application_key property.
- setApplicationSecret() — Set the application_secret property.
- setCallbackUrl() — Set the callback property.
- setGroupSettings() — This sets the group settings of the specified group.
- setResponseFormat() — Set the response_format property.
- setToken() — Set the token property.
- setTokenAccess() — [DEPRECATED] Set the token_access property.
- statistics() — Network statistics.
- suggestedCompanies() — Companies you may want to follow.
- suggestedGroups() — Retrieves suggested groups for the user, per:
- suggestedJobs() — Jobs you may be interested in.
- unbookmarkJob() — Unbookmark a job.
- unfollowCompany() — Unfollow a company.
- unlike() — Unlike a network update.
- updateNetwork() — Post network update.
- updates() — General network update retrieval function.
- xmlToArray() — Converts passed XML data to an array.