studentconnect/api-client

该包已被弃用,不再维护。未建议替代包。

StudentConnect API 客户端库

v0.9 2017-02-14 15:44 UTC

This package is not auto-updated.

Last update: 2020-01-22 02:03:59 UTC


README

这是 StudentConnect API 的官方 PHP 客户端 StudentConnect API

安装

composer require studentconnect/api-client

示例代码

<?php 

use StudentConnect\API\Client\Client;
use StudentConnect\API\Client\Exceptions\ClientException;

try{

    $Client = new Client('https://api.endpoint', '{app_key}', '{app_secret}');
    $Client->authorize();
    
    $uri = $Client->tokenizeURI( $Client->generateSignInURI() );
    
    echo ( '<a href="'. $uri .'">Sign In with StudentConnect &rarr;</a>' );

}
catch(ClientException $e){
    throw new App\ApplicationException( $e->getMessage(), $e->getStatus(), $e );
}

快速入门

如果您手头有 Web 服务器,只需将主机根目录设置为 /quickstart/web.php 并查看指南。
文档可在此处找到: docs.studentconnectapi.com