IM Sdk for Tencent Instant Messaging.
- PHP >= 5.5.9
- Composer
- Openssl Extension
$ composer require jimchen/tim-sdk -vvv
Basic Usage:
use TimSDK;
use TimSDK\Core\API;
$options = [
'app_id' => '14000xxxx',
'identifier' => 'admin',
'private_key' => 'Your private key',
'public_key' => 'Your public key',
'http' => [
'timeout' => 5,
'base_uri' => 'Your base url',
],
];
$app = new TimCloud($options);
/**
* Call api uri
*/
$response = $app->request(API::DIRTY_WORDS_GET);
/**
* or call api alias
*/
$response = $app->request('DIRTY_WORDS_GET');
/**
* or call a magic function
*/
$response = $app->requestDirtyWordsGet();
var_dump($response);
more API Constants
more details focus on this demo