PHP 인터페이스 Happyr\LinkedIn\LinkedInInterface

저자: Tobias Nyholm ([email protected])
파일 보기 프로젝트 열기: happyr/linkedin-api-client

공개 메소드들

메소드 설명
api ( string $method, string $resource, array $options = [] ) : mixed Make an API call. Read about what calls that are possible here: https://developer.linkedin.com/docs/rest-api.
clearStorage ( ) Clear the data storage. This will forget everything about the user and authentication process.
get ( string $resource, array $options = [] ) : mixed See docs for LinkedIn::api().
getAccessToken ( ) : Happyr\LinkedIn\AccessToken | null Returns an access token. If we do not have one in memory, try to fetch one from a *code* in the $_REQUEST.
getError ( ) : Happyr\LinkedIn\Exception\LoginError | null Returns a LoginError or null.
getLastResponse ( ) : Psr\Http\Message\ResponseInterface | null Get the last response. This will always return a PSR-7 response no matter of the data type used.
getLoginUrl ( array $options = [] ) : string Get a login URL where the user can put his/hers LinkedIn credentials and authorize the application.
hasError ( ) : boolean If the user has canceled the login we will return with an error.
isAuthenticated ( ) : boolean Is the current user authenticated?
post ( string $resource, array $options = [] ) : mixed See docs for LinkedIn::api().
setAccessToken ( string | Happyr\LinkedIn\AccessToken $accessToken ) If you have stored a previous access token in a storage (database) you could set it here. After setting an access token you have to make sure to verify it is still valid by running LinkedIn::isAuthenticated.
setFormat ( string $format ) Set the default format to use when sending requests.
setHttpClient ( Http\Client\HttpClient $client ) Set a http client.
setHttpMessageFactory ( Http\Message\MessageFactory $factory ) Set a http message factory.
setResponseDataType ( string $responseDataType ) Set the default data type to be returned as a response.
setStorage ( Happyr\LinkedIn\Storage\DataStorageInterface $storage ) Set a data storage.
setUrlGenerator ( Happyr\LinkedIn\Http\UrlGeneratorInterface $urlGenerator ) Set a URL generator.

메소드 상세

api() 공개 메소드

Example: $linkedIn->api('GET', '/v1/people/~:(id,firstName,lastName,headline)'); The options: - body: the body of the request - format: the format you are using to send the request - headers: array with headers to use - response_data_type: the data type to get back - query: query parameters to the request
public api ( string $method, string $resource, array $options = [] ) : mixed
$method string This is the HTTP verb
$resource string everything after the domain in the URL.
$options array See the readme for option description.
리턴 mixed this depends on the response_data_type parameter.

clearStorage() 공개 메소드

Clear the data storage. This will forget everything about the user and authentication process.
public clearStorage ( )

get() 공개 메소드

See docs for LinkedIn::api().
public get ( string $resource, array $options = [] ) : mixed
$resource string
$options array
리턴 mixed

getAccessToken() 공개 메소드

Returns an access token. If we do not have one in memory, try to fetch one from a *code* in the $_REQUEST.
public getAccessToken ( ) : Happyr\LinkedIn\AccessToken | null
리턴 Happyr\LinkedIn\AccessToken | null The access token of null if the access token is not found

getError() 공개 메소드

Returns a LoginError or null.
public getError ( ) : Happyr\LinkedIn\Exception\LoginError | null
리턴 Happyr\LinkedIn\Exception\LoginError | null

getLastResponse() 공개 메소드

Get the last response. This will always return a PSR-7 response no matter of the data type used.
public getLastResponse ( ) : Psr\Http\Message\ResponseInterface | null
리턴 Psr\Http\Message\ResponseInterface | null

getLoginUrl() 공개 메소드

The options: - redirect_uri: the url to go to after a successful login - scope: comma (or space) separated list of requested extended permissions
public getLoginUrl ( array $options = [] ) : string
$options array Provide custom parameters
리턴 string The URL for the login flow

hasError() 공개 메소드

If the user has canceled the login we will return with an error.
public hasError ( ) : boolean
리턴 boolean

isAuthenticated() 공개 메소드

Is the current user authenticated?
public isAuthenticated ( ) : boolean
리턴 boolean

post() 공개 메소드

See docs for LinkedIn::api().
public post ( string $resource, array $options = [] ) : mixed
$resource string
$options array
리턴 mixed

setAccessToken() 공개 메소드

If you have stored a previous access token in a storage (database) you could set it here. After setting an access token you have to make sure to verify it is still valid by running LinkedIn::isAuthenticated.
public setAccessToken ( string | Happyr\LinkedIn\AccessToken $accessToken )
$accessToken string | Happyr\LinkedIn\AccessToken

setFormat() 공개 메소드

Set the default format to use when sending requests.
public setFormat ( string $format )
$format string

setHttpClient() 공개 메소드

Set a http client.
public setHttpClient ( Http\Client\HttpClient $client )
$client Http\Client\HttpClient

setHttpMessageFactory() 공개 메소드

Set a http message factory.
public setHttpMessageFactory ( Http\Message\MessageFactory $factory )
$factory Http\Message\MessageFactory

setResponseDataType() 공개 메소드

Set the default data type to be returned as a response.
public setResponseDataType ( string $responseDataType )
$responseDataType string

setStorage() 공개 메소드

Set a data storage.
public setStorage ( Happyr\LinkedIn\Storage\DataStorageInterface $storage )
$storage Happyr\LinkedIn\Storage\DataStorageInterface

setUrlGenerator() 공개 메소드

Set a URL generator.
public setUrlGenerator ( Happyr\LinkedIn\Http\UrlGeneratorInterface $urlGenerator )
$urlGenerator Happyr\LinkedIn\Http\UrlGeneratorInterface