wen-gg/tencentcloud-im-sdk-php

dev-main 2023-01-28 08:28 UTC

This package is auto-updated.

Last update: 2024-11-28 12:12:18 UTC


README

TIM REST API

Requirements

PHP 5.6 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/tencentcloud/tencentcloud-im-sdk-php.git"
    }
  ],
  "require": {
    "tencentcloud/tencentcloud-im-sdk-php": "^1.0.6"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/tencentcloud-im-sdk-php/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = new Configuration();
//TODO: 此处替换成您的SDKAppID,应用 SDKAppID,可在即时通信 IM 控制台(https://console.cloud.tencent.com/im) 的应用卡片中获取。
$config->setSdkappid(123456789);
//TODO: 此处替换成您的identifier;用户名,调用 REST API时必须为App管理员帐号 参考:https://cloud.tencent.com/document/product/269/31999#app-.E7.AE.A1.E7.90.86.E5.91.98
$config->setIdentifier("identifier");
//TODO: 此处替换成您的key, 参考:https://cloud.tencent.com/document/product/269/32688#getkey
$config->setKey("key");

$apiInstance = new TencentCloud\IM\Api\AccountApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(), $config
);
$random = 56; // int | 
$accountCheckRequest = new \TencentCloud\IM\Model\AccountCheckRequest(); // \TencentCloud\IM\Model\AccountCheckRequest | 
 //TODO: Set the request parameters

try {
    $result = $apiInstance->accountCheck($random, $accountCheckRequest);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AccountApi->accountCheck: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://console.tim.qq.com

Documentation For Models

Documentation For Authorization

All endpoints do not require authorization.

Contact

腾讯云IM REST API SDK 技术交流QQ群

QQ群号:909322484