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

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

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

maztech/instagram-php-graph-sdk

最新稳定版本:v1.0.3

Composer 安装命令:

composer require maztech/instagram-php-graph-sdk

包简介

Instagram SDK for PHP

README 文档

README

Latest Version Software License Build Status Total Downloads Coverage Status Quality Score

This repository contains the open source PHP SDK that allows you to access the Facebook Platform from your PHP app.

Disclamer: This SDK using Instagram Graph API and encourage to use "Instagram Basic Display API".

Requirement

  • PHP >=5.4.1
  • Guzzle 5.x
  • PHPunit 4.x
  • mockery 0.8

Installation

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

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

Usage

<?php
require_once __DIR__ . '/vendor/autoload.php'; // change path as needed

$ig = new \Maztech\Instagram([
  'app_id' => '{app-id}',
  'app_secret' => '{app-secret}'
]);

// Use one of the helper classes to get a Instagram\Authentication\AccessToken entity.
$helper = $ig->getRedirectLoginHelper();

// instagram login - https://api.instagram.com/oauth/authorize?app_id={$clientId}&redirect_uri={$redirecUri}&scope=user_profile,user_media&response_type=code
$helper->getLoginUrl(); // get authorization url

// instagram callback
$helper->getAccessToken(); // get access token from code

try {
    $queryParams = http_build_query([
        'access_token' => '{access-token}'
    ]);
    $response = $ig->get('/me?{$queryParams}');
} catch(\Instagram\Exceptions\InstagramResponseException $e) {
  // When Graph returns an error
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(\Instagram\Exceptions\InstagramSDKException $e) {
  // When validation fails or other local issues
  echo 'Instagram SDK returned an error: ' . $e->getMessage();
  exit;
}

This SDK was referred at Facebook Developer site here

Copyright & License

PHP SDK for Instagram Graph API is Copyright (c) 2022 Mohd Azmin if not otherwise stated. The code is distributed under the terms of the MIT License.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-03-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固