承接 doctorconceptual/php-instagram-graph-sdk 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

doctorconceptual/php-instagram-graph-sdk

最新稳定版本:v2.0

Composer 安装命令:

composer require doctorconceptual/php-instagram-graph-sdk

包简介

PHP SDK for Instagram Graph API

README 文档

README

This is a basic SDK for using Instagram Graph API. I basically wrote this SDK when I found that Instagram is going to shutdown their legacy API and encourage to use "Instagram Basic Display API" instead.

Copyright & License

PHP SDK for Instagram Graph API is Copyright (c) 2020 Muhammad Talal if not otherwise stated. The code is distributed under the terms of the MIT License. For the full license text see the LICENSE file.

Versions & Requirements

1.0.0, PHP >=5.4.1

Installation

The preferred installation method is via composer. You can add the library as a dependency via:

$ composer require doctorconceptual/php-instagram-graph-sdk

Usage

Creating an Instance

<?php

use Instagram\Instagram;

// when you create an app for Instagram Basic Display API, 
// you can get client_id, client_secret & redirect_uri from there
// Here is how you can get started:
// https://developers.facebook.com/docs/instagram-basic-display-api/getting-started

$igAPI = new Instagram($clientID, $clientSecret, redirectURI);

Fetching a token

$authURL = $igAPI->get_authorize_url();
header("Location: {$authURL}");

// after authorization, it should return to the same URL
$code = $_GET['code'];
$token = $igAPI->get_access_token($code);

// Now that a short-lived token is retrieved, you can
// exchange it with a long-live token
$igAPI->set_access_token($token->access_token);
$token = $this->instagram->get_long_lived_token();
// $token now has a long-lived token which has a life of 60 days
// per Instagram API documentation

Get an Instagram User

$igAPI = new Instagram($clientID, $clientSecret);
$igAPI->set_access_token($access_token); // set the previously fetched token
$instagramUserID = 123456; // a valid Instagram user id, this is returned along with the token when fetching token
$user = get_user($instagramUserID);

The other endpoints could be used in a similar fashion

统计信息

  • 总下载量: 40.62k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 11
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 11
  • Watchers: 1
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固