linuzilla / ncucc-coreapi
NCUCC 核心API客户端
v1.0.2
2017-06-13 03:22 UTC
Requires
- guzzlehttp/guzzle: ^6.2
This package is not auto-updated.
Last update: 2024-09-24 17:06:26 UTC
README
ncucc-coreapi 是一个PHP HTTP客户端
php composer.phar require linuzilla/ncucc-coreapi
<?php require __DIR__ . '/vendor/autoload.php'; use NCUCC\CoreAPI\Client; use NCUCC\CoreAPI\APIException; $config_file = "config.json"; $config = json_decode(file_get_contents($config_file)); $coreapi = new Client($config); try { $coreapi->some_api_function(); } catch (NCUCC\CoreAPI\APIException $e) { echo 'Caught exception: ', $e->getMessage(), "\n"; }
{
"base": "// API base URL",
"appkey": "your app key",
"magickey": "your magic key",
"secret": "secret",
"publicKey": "public key in pem format",
"token": "access token",
"apiMetaFile": "api meta file"
}