emocharnik/instsdk

This is test SDK for the Instagram API in PHP

dev-master 2017-11-04 14:18 UTC

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

  1. First of all you have to create your API client on official Instagram developer page
  2. Then you have to create your own configrutation file. Library requires 3 basic fields: apiKey, apiSecret, callbackUrl
  3. 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() and createAccessToken($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/
  4. Now received access token you can use in other resources. To get them call InstagramAppFactory::createResources(array $config, $token).
  5. You can easily extend library with your own resources. If want to do so extend a InstagramApp and Request classes.
  6. For more detailed information how to use library look for examples