BaseClient
in package
Tags
Table of Contents
- $expansions : string
- Twitter Expansions (comma delimited)
- $listFields : string
- Twitter List Fields (comma delimited)
- $mediaFields : string
- Twitter Media Fields (comma delimited)
- $placeFields : string
- Twitter Place Fields (comma delimited)
- $pollFields : string
- Twitter Poll Fields (comma delimited)
- $spaceFields : string
- Twitter Space Fields (comma delimited)
- $tweetFields : string
- Twitter Tweet Fields (comma delimited)
- $userFields : string
- Twitter User Fields (comma delimited)
- $accessKey : string
- Twitter User OAuth Access Key
- $accessSecret : string
- Twitter User OAuth Access Secret
- $apiKey : string
- Twitter Developer API Key
- $apiSecret : string
- Twitter Developer API Secret
- $baseUrl : string
- Twitter API Base URL
- $bearerToken : string
- Twitter Developer Bearer Token
- $client : Client
- Guzzle Client
- $clientId : string
- Twitter Project Client ID
- $clientSecret : string
- Twitter Project Client Secret
- __construct() : mixed
- The Client Class Constructor
- delete() : TwitterResponse
- Make a DELETE request to the Twitter API.
- get() : TwitterResponse
- Make a GET request to the Twitter API.
- getAccessToken() : array<string|int, mixed>
- getAuthorizeUrl() : string
- getRequestToken() : array<string|int, mixed>
- post() : TwitterResponse
- Make a POST request to the Twitter API.
- put() : TwitterResponse
- Make a PUT request to the Twitter API.
Properties
$expansions
Twitter Expansions (comma delimited)
public
string
$expansions
Tags
$listFields
Twitter List Fields (comma delimited)
public
string
$listFields
Tags
$mediaFields
Twitter Media Fields (comma delimited)
public
string
$mediaFields
Tags
$placeFields
Twitter Place Fields (comma delimited)
public
string
$placeFields
Tags
$pollFields
Twitter Poll Fields (comma delimited)
public
string
$pollFields
Tags
$spaceFields
Twitter Space Fields (comma delimited)
public
string
$spaceFields
Tags
$tweetFields
Twitter Tweet Fields (comma delimited)
public
string
$tweetFields
Tags
$userFields
Twitter User Fields (comma delimited)
public
string
$userFields
Tags
$accessKey
Twitter User OAuth Access Key
private
string
$accessKey
Tags
$accessSecret
Twitter User OAuth Access Secret
private
string
$accessSecret
Tags
$apiKey
Twitter Developer API Key
private
string
$apiKey
Tags
$apiSecret
Twitter Developer API Secret
private
string
$apiSecret
Tags
$baseUrl
Twitter API Base URL
private
string
$baseUrl
Tags
$bearerToken
Twitter Developer Bearer Token
private
string
$bearerToken
Tags
$client
Guzzle Client
private
Client
$client
Tags
$clientId
Twitter Project Client ID
private
string
$clientId
Tags
$clientSecret
Twitter Project Client Secret
private
string
$clientSecret
Tags
Methods
__construct()
The Client Class Constructor
public
__construct([string|null $apiKey = null ][, string|null $apiSecret = null ][, string|null $accessToken = null ][, string|null $accessSecret = null ][, string|null $bearerToken = null ]) : mixed
The client can be initialized with a combination of API keys, depending on the endpoint. Most get requests only require a bearer token, but some require a user access token. Should only be called privately from scoped clients.
Parameters
- $apiKey : string|null = null
- $apiSecret : string|null = null
- $accessToken : string|null = null
- $accessSecret : string|null = null
- $bearerToken : string|null = null
Tags
Return values
mixed —delete()
Make a DELETE request to the Twitter API.
public
delete(string $endpoint, array<string|int, mixed> $data) : TwitterResponse
Parameters
- $endpoint : string
- $data : array<string|int, mixed>
Tags
Return values
TwitterResponse —get()
Make a GET request to the Twitter API.
public
get(string $endpoint[, array<string|int, mixed>|null $params = null ]) : TwitterResponse
Parameters
- $endpoint : string
- $params : array<string|int, mixed>|null = null
Tags
Return values
TwitterResponse —getAccessToken()
public
getAccessToken(string $oauthToken, string $oauthSecret, string $oauthVerifier) : array<string|int, mixed>
Parameters
- $oauthToken : string
- $oauthSecret : string
- $oauthVerifier : string
Tags
Return values
array<string|int, mixed> —getAuthorizeUrl()
public
getAuthorizeUrl(array<string|int, mixed> $requestToken) : string
Parameters
- $requestToken : array<string|int, mixed>
Tags
Return values
string —getRequestToken()
public
getRequestToken(string $oauthCallback) : array<string|int, mixed>
Parameters
- $oauthCallback : string
Tags
Return values
array<string|int, mixed> —post()
Make a POST request to the Twitter API.
public
post(string $endpoint[, array<string|int, mixed>|null $data = null ]) : TwitterResponse
Parameters
- $endpoint : string
- $data : array<string|int, mixed>|null = null
Tags
Return values
TwitterResponse —put()
Make a PUT request to the Twitter API.
public
put(string $endpoint[, array<string|int, mixed>|null $data = null ]) : TwitterResponse
Parameters
- $endpoint : string
- $data : array<string|int, mixed>|null = null