novofon/user-api-v1
最新稳定版本:v2.0.3
Composer 安装命令:
composer require novofon/user-api-v1
包简介
PHP class for Novofon API
关键字:
README 文档
README
An official PHP class for work with Novofon API.
Allows to work with all API methods (including VoIP, PBX, CallBack etc).
Requirements:
- PHP >= 5.5.0
- cURL
- TLS v1.2
How to use?
An official documentation on Novofon API is here.
Keys for authorization are in personal account.
Installation
Via Сomposer
composer require "novofon/user-api-v1"
or just add this line to your composer.json file:
"novofon/user-api-v1"
Via Git
git clone git@github.com:novofon/user-api-v1.git
\Novofon_API\Api call code example
<?php include_once '/PATH/TO/vendor/autoload.php'; $api = new \Novofon_API\Api(KEY, SECRET); try{ $result = $api->getSipStatus('YOURSIP'); echo $result->sip.' status: '.($result->is_online ? 'online' : 'offline'); } catch (\Novofon_API\ApiException $e) { echo 'Error: '.$e->getMessage(); }
All other examples you can see in the "example file".
\Novofon_API\Client call code example
<?php include_once '/PATH/TO/lib/Client.php'; $params = array( 'id' => 'YOURSIP', 'status' => 'on' ); $api = new \Novofon_API\Client(YOUR_KEY, YOUR_SECRET); /* $api->call('METHOD', 'PARAMS_ARRAY', 'REQUEST_TYPE', 'FORMAT', 'IS_AUTH'); where: - METHOD - a method API, started from /v1/ and ended by '/'; - PARAMS_ARRAY - an array of parameters to a method; - REQUEST_TYPE: GET (default), POST, PUT, DELETE; - FORMAT: json (default), xml; - IS_AUTH: true (default), false - is method under authentication or not. */ $answer = $api->call('/v1/sip/', $params); $answerObject = json_decode($answer);
All other examples you can see in the "examples" folder.
统计信息
- 总下载量: 6.57k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-18