dev-master
9999999-devBroScript php api sdk
MIT
The Requires
- php >=5.4.0
- ext-curl *
- ext-json *
- ext-mbstring *
- mashape/unirest-php ~3.0.1
- apimatic/jsonmapper ~1.0.0
api sdk broscript
Wallogit.com
2017 © Pedro Peláez
BroScript php api sdk
The following section explains how to use the BroScript library in a new project., (*1)
Unit tests in this SDK can be run using PHPUnit., (*2)
require-dev dependencies.vendor\bin\phpunit --verbose from commandline to execute tests. If you have
installed PHPUnit globally, run tests using phpunit --verbose instead.You can change the PHPUnit test configuration in the phpunit.xml file., (*3)
In order to setup authentication and initialization of the API client, you need the following information., (*4)
| Parameter | Description |
|---|---|
| userKey | User Key |
| scriptKey | Script Key |
API client can be initialized as following., (*5)
// 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);
cleanHistoryTODO: Add a method description, (*6)
function cleanHistory($chatId = NULL)
| Parameter | Tags | Description |
|---|---|---|
| chatId | Optional |
chat id |
$chatId = 'chat_id'; $result = $client->cleanHistory($chatId);
templatesGet array with templates, (*7)
function templates()
$result = $client->templates();
answersGet answer, (*8)
function answers(
$chatId = NULL,
$contact = NULL,
$external = NULL,
$stopIsNull = false,
$repeatIsNull = false)
| Parameter | Tags | Description |
|---|---|---|
| chatId | Optional |
Chat id |
| contact |
Optional Collection
|
Object with information about concat |
| external |
Optional Collection
|
Object with information about external |
| stopIsNull |
Optional DefaultValue
|
Stop is null |
| repeatIsNull |
Optional DefaultValue
|
Stop is null |
$chatId = 'chat_id';
$contact = array('contact');
$external = array('external');
$stopIsNull = false;
$repeatIsNull = false;
$result = $client->answers($chatId, $contact, $external, $stopIsNull, $repeatIsNull);
BroScript php api sdk
MIT
api sdk broscript