bookin / broscript
BroScript php api sdk
dev-master
2016-09-21 20:37 UTC
Requires
- php: >=5.4.0
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- apimatic/jsonmapper: ~1.0.0
- mashape/unirest-php: ~3.0.1
This package is not auto-updated.
Last update: 2024-12-21 21:52:37 UTC
README
The following section explains how to use the BroScript library in a new project.
How to Test
Unit tests in this SDK can be run using PHPUnit.
- First install the dependencies using composer including the
require-dev
dependencies. - Run
vendor\bin\phpunit --verbose
from commandline to execute tests. If you have installed PHPUnit globally, run tests usingphpunit --verbose
instead.
You can change the PHPUnit test configuration in the phpunit.xml
file.
Initialization
Authentication and Initialization
In order to setup authentication and initialization of the API client, you need the following information.
API client can be initialized as following.
// Configuration parameters and credentials $userKey = "userKey"; // User Key $scriptKey = "scriptKey"; // Script Key //The singleton instance of the ``` APIController ``` class can be accessed from the API Client. $client = BroScriptClient::getInstance($userKey, $scriptKey);
Class Reference
List of Controllers
cleanHistory
TODO: Add a method description
function cleanHistory($chatId = NULL)
Parameters:
Example Usage:
$chatId = 'chat_id'; $result = $client->cleanHistory($chatId);
templates
Get array with templates
function templates()
Example Usage:
$result = $client->templates();
answers
Get answer
function answers( $chatId = NULL, $contact = NULL, $external = NULL, $stopIsNull = false, $repeatIsNull = false)
Parameters:
Example Usage:
$chatId = 'chat_id'; $contact = array('contact'); $external = array('external'); $stopIsNull = false; $repeatIsNull = false; $result = $client->answers($chatId, $contact, $external, $stopIsNull, $repeatIsNull);