Skip to content

ncucc/ncucc-coreapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

NCUCC CoreAPI Client

ncucc-coreapi is a PHP HTTP client

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"
}