admin/business/asset/weworkapi/api/examples/JsApiTest.php

32 lines
634 B
PHP

<?php /*
* Copyright (C) 2017 All rights reserved.
*
* @File JsApiTest.php
* @Brief
* @Author abelzhu, abelzhu@tencent.com
* @Version 1.0
* @Date 2017-12-26
*
*/
include_once("../src/CorpAPI.class.php");
include_once("../src/ServiceCorpAPI.class.php");
include_once("../src/ServiceProviderAPI.class.php");
//
$config = require('./config.php');
//
$api = new CorpAPI($config['CORP_ID'], $config['APP_SECRET']);
try {
//
$ticket = $api->TicketGet();
echo $ticket . "\n";
//
$ticket = $api->JsApiTicketGet();
echo $ticket . "\n";
} catch (Exception $e) {
echo $e->getMessage() . "\n";
}