PHP code example of zengjj / uc-client
1. Go to this page and download the library: Download zengjj/uc-client library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zengjj / uc-client example snippets
$uc_api = new ApiIndex(['base_url' => C('uc_api_url'), 'app_key' => C('uc_app_key')]);
$result['app_token'] = $uc_api->getAppToken(C('uc_app_secret'));
$uc_api = new ApiIndex(['base_url' => C('uc_api_url'), 'app_key' => C('uc_app_key')]);
$result['user_token'] = $uc_api->getUserToken($phone, $password);
$uc_api = new ApiIndex(['base_url' => C('uc_api_url'), 'app_key' => C('uc_app_key')]);
$appInfo = $uc_api->appGenerate($phone, $password, $name, (new UcWeb())->currentHost(), AppParams::TYPE_KDDS, $desc);
$app_key = (new ApiApp(['base_url' => C('uc_api_url')]))->checkToken(I('app_token'));
if (strcmp($app_key, C('uc_app_key')) !== 0) {
return ajaxFail($app_key);
}
$api_app = new ApiApp(['base_url' => C('uc_api_url')]);
$work_corp_list = $api_app->workCorpList(I('app_token'));
$api_app = new ApiApp(['base_url' => C('uc_api_url')]);
$result = $api_app->jgDelAlias($app_token, $alias);
$api_app = new ApiApp(['base_url' => C('uc_api_url')]);
$result = $api_app->jgPush($app_token, $content, $alias, $jg_key, $jg_secret =, $registration_id);
$api_app = new ApiApp(['base_url' => C('uc_api_url')]);
$result = $api_app->sendNoticeMsg($app_token, $phone, NoticeMsg::MSG_UNIVERSAL_STRUCTURE);
$api_app = new ApiApp(['base_url' => C('uc_api_url')]);
$result = $api_app->sendWorkCorpMsg($app_token, $phone, $object = NoticeMsg::MSG_WORK_CORP_OBJECT_TEXT, $properties = NoticeMsg::MSG_WORK_CORP_PROPERTIES_TEXT, $work_corp_id = 0, $internal = NoticeMsg::APP_INTERNAL_YES);