emocharnik / instsdk
This is test SDK for the Instagram API in PHP
dev-master
2017-11-04 14:18 UTC
Requires
- php: >=7.1
- ext-curl: *
- php-curl-class/php-curl-class: ^7.3
Requires (Dev)
- myclabs/deep-copy: ^1.7
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2024-04-10 06:17:08 UTC
README
General info
This is SDK which can help you easily manipulate with Instagram API.
There are implemented 4 sections to communicate with some endpoint of social network: Auth, Likes, Media and Users.
Installation
This is only very beginning of this package, so if you want to install it run
composer require emocharnik/instsdk "dev-master"
Requirements
- PHP: >= 7.1
- ext-curl: "*",
- php-curl-class/php-curl-class: "^7.3"
Basic Usage
- First of all you have to create your API client on official Instagram developer page
- Then you have to create your own configrutation file. Library requires 3 basic fields:
apiKey
,apiSecret
,callbackUrl
- Then you need to create access token to communicate with Instagram API. To do it call
InstagramAppFactory::getAuthResource(array $config)
. You will get authorization resource with to general methods:getLoginUrl()
andcreateAccessToken($authorizationCode)
. The last one will return data about the user and its access token. Example how to create access token Note: more info how it works you can get there: https://www.instagram.com/developer/authentication/ - Now received access token you can use in other resources. To get them call
InstagramAppFactory::createResources(array $config, $token)
. - You can easily extend library with your own resources. If want to do so extend a
InstagramApp
andRequest
classes. - For more detailed information how to use library look for examples