HTTP API is available via the https://kit-im-{{region}}.voximplant.com/{method} endpoint. To send events you need to use jwt token. You can get jwt token via login method using an api token created on api tokens page. You need to pass api token as access_token.
The parameters that are needed to be sent for generate jwt token are as follows:
- access_token
- domain
PHP 5.5 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/voximplant/kit-imclient-php.git"
}
],
"require": {
"voximplant/kit-imclient-php": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/VoximplantKitIM/vendor/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$config = VoximplantKitIM\Configuration::getDefaultConfiguration();
$config->setHost('https://kit-im-{{region}}.voximplant.com');
// Configure API key authorization: access_token
$config->setApiKey('access_token', 'your_access_token');
// Configure API key authorization: domain
$config->setApiKey('domain', 'your_domain');
$kitApi = new VoximplantKitIM\VoximplantKitIMClient($config);
$channel_uuid = "channel_uuid_example"; // string |
try {
$result = $kitApi->BotServiceApi->login($channel_uuid);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling $kitApi->BotServiceApi->login: ', $e->getMessage(), PHP_EOL;
}
?>
All URIs are relative to https://kit-im-{{region}}.voximplant.com
Class | Method | HTTP request | Description |
---|---|---|---|
BotServiceApi | login | POST /api/v3/botService/login | |
BotServiceApi | refreshToken | POST /api/v3/botService/refreshToken | |
BotServiceApi | sendEvent | POST /{channel_uuid} |
- AnyOfMessagingEventMessageTypePayloadItems
- Body
- Body1
- ErrorResultType
- ErrorType
- InlineResponse200
- MessagingEventMessagePayloadContact
- MessagingEventMessagePayloadLocation
- MessagingEventMessagePayloadMedia
- MessagingEventMessageSenderDataType
- MessagingEventMessageType
- MessagingIncomingEventClientDataDeviceType
- MessagingIncomingEventClientDataLocationType
- MessagingIncomingEventClientDataPageType
- MessagingIncomingEventClientDataUtmType
- MessagingIncomingEventType
- MessagingIncomingEventTypeClientData
- MessagingIncomingEventTypeEventData
- MessagingLoginResponseType
- MessagingLoginResponseTypeResult
- MessagingOutgoingChatCloseEventSenderDataType
- MessagingOutgoingChatCloseEventType
- MessagingOutgoingChatCloseEventTypeEventData
- MessagingOutgoingNewMessageEventType
- MessagingOutgoingNewMessageEventTypeClientData
- MessagingOutgoingNewMessageEventTypeEventData
Authentication schemes defined for the API:
- Type: API key
- API key parameter name: access_token
- Location: URL query string
- Type: API key
- API key parameter name: domain
- Location: URL query string
- Location: HTTP header
- Header key parameter name: Authorization