EaseBaidu
  • 概述
  • 开始
    • 安装
  • 熊掌号
    • 入门
    • 服务端
    • 网页授权
    • 消息
    • 消息群发
    • 模板消息
    • 用户
    • 用户标签
    • 菜单管理
    • 主页管理
    • 数据统计
    • 素材管理
    • 临时素材
    • 客服消息
    • JSSDK
  • 熊掌号TP
    • 入门
    • 服务端
    • 代授权
  • 智能小程序
    • 入门
    • 消息模板
    • 消息解密
    • 熊掌号登录
  • 智能小程序TP
    • 入门
    • 代授权
    • 小程序登录
    • 基础信息
    • 图片上传
    • 服务器
    • 包管理
Powered by GitBook
On this page

Was this helpful?

  1. 熊掌号TP

入门

熊掌号TP

获取熊掌号tp实例:

use EaseBaidu\Factory;

$config = [
    'debug' => 1, // 发布前填写或者修改的环境
    'client_id' => 'xxx',
    'secret' => 'xxx',
    'token' => 'xxx',
    'aes_key' => 'xxx',
    'log' => [
        'name' => 'EaseBearTp',
        'level' => 'debug',
        'file' => __DIR__ . '/logs/bear.log',
    ],
];

$bearTP = Factory::bearTP($config);

获取预授权页 URL:

$bearTP->getPreAuthorizationUrl(string $callbackUrl);

根据授权码code,换取授权熊掌号的接口调用凭据:

$bearTP->handleAuthorize(string $authorization_code);

获取授权熊掌号信息:

$bear = $bearTP->bear(string $client_id, string $refresh_token);
$bear->getAuthorizer();
PreviousJSSDKNext服务端

Last updated 6 years ago

Was this helpful?