VERSION
VERSION
Version of the client class
Client class is the main class you will interface with
get(string $path, array $params = array()) : \Webmakersteve\Instagram\Response
Helper function to do a GET request. Accessible to public in case an endpoint is not implemented as a method abstraction.
string | $path | The path that will be entered into the URL filter. |
array | $params | The params to be entered into the URL. |
post(string $path, array $params = array()) : \Webmakersteve\Instagram\Response
Helper function to do a POST request. Accessible to public in case an endpoint is not implemented as a method abstraction.
string | $path | The path that will be entered into the URL filter. |
array | $params | The params to be entered into the request body. |
put(string $path, array $params = array()) : \Webmakersteve\Instagram\Response
Helper function to do a PUT request. Accessible to public in case an endpoint is not implemented as a method abstraction.
string | $path | The path that will be entered into the URL filter. |
array | $params | The params to be entered into the request body. |
__construct(array $options = array()) : \Webmakersteve\Instagram\Client
Constructor function. Takes client ID, secret, and redirect URI to establish the class. Can take other options
array | $options | Options to create the client with. Requires 'client_id', 'client_secret', and 'redirect_uri' to properly work. |
setAccessToken( $access_token) : \Webmakersteve\Instagram\Client
Helper function to set the Instagram access token. Accessible publicly to allow it to be set after the OAuth flow
$access_token |
getOAuthToken(string $code, boolean $access_code_only = false) : \Webmakersteve\Instagram\Response|string
Converts an access code into an access token through the API
string | $code | Code passed through a query parameter by the API |
boolean | $access_code_only | Whether to return the entire object or just the access code. |
Returns a Response object or a string based on the second parameter
getUser(string|integer $id = 'self') : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Helper function to get user data from the API
string|integer | $id | 'self' as an ID returns the info about the current user. Otherwise, an ID returns data about that user. |
searchUser(string|integer $name, integer $limit = null) : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Helper function to get search user data from the API
string|integer | $name | The name as a query to search. |
integer | $limit | The limit of results to return |
getUserMedia(string|integer $id = 'self', integer $limit = null, integer $min = false, integer $max = false) : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Helper function to get posts by a given user.
string|integer | $id | 'self' as an ID returns the posts by the current user. Otherwise, an ID returns posts by that user. |
integer | $limit | Max number of users to return. Otherwise defaults to the default limit. |
integer | $min | The min ID of users to return. Useful for pagination. |
integer | $max | The max ID of users to return. Useful for pagination. |
getUserLiked(integer $limit = null, integer $max = false) : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Helper function to get liked users of the logged in user
integer | $limit | Max number of users to return. Otherwise defaults to the default limit. |
integer | $max | The max ID of users to return. Useful for pagination |
getUserFeed(integer $limit = null) : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Helper function to get the currently logged in user's feed.
integer | $limit | Max number of users to return. Otherwise defaults to the default limit. |
searchTags(string $q) : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Searches for currently used Instagram tags.
string | $q | The query to search |
getTag(string $tag) : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Gets information about a given tag.
string | $tag | The tag string. Can be returned from the searchTags method |
getTaggedMedia(string $tag, integer $limit = null, integer $min = false, integer $max = false) : \Webmakersteve\Instagram|\Webmakersteve\Instagram\Response
Get posts tagged with a given hashtag.
string | $tag | A hashtag. The # will be trimmed. |
integer | $limit | Max number of users to return. Otherwise defaults to the default limit. |
integer | $min | The min ID of posts to return. Useful for pagination. |
integer | $max | The max ID of posts to return. Useful for pagination. |
buildInstagramURL(string $path, array $params = false, boolean $raw = false, string $method = self::METHOD_GET) : string
Creates the Instagram URL from the path. Adds access token automatically unless $raw is specified.
string | $path | String of the path with no prefixing characters, e.g. 'users/self' |
array | $params | Parameters to put into the URL. Prioritizes parameter replacement into the URL, and after that will add them as a query string. |
boolean | $raw | Determines whether the URL should be returned RAW. That is, without the access token and auth params. |
string | $method | Should be assigned to one of the method constants. Determines whether params should be placed as a query string. |
parseResponse( $response) : \Webmakersteve\Instagram\Response
Reads response information and returns the format best suited to the body. Usually JSON
$response |
doRequest(string $path, string $method = self::METHOD_GET, array $params = array()) : \Webmakersteve\Instagram\Response
Does the request and returns the Guzzle response
string | $path | The path to be entered into the URL filter. |
string | $method | The method constant to be compared against to determine where the parameters go |
array | $params | The parameters to be sent with the request. |