tencent cloud

Tencent Real-Time Communication

소식 및 공지 사항
제품 업데이트
Tencent Cloud 오디오/비디오 단말 SDK 재생 업그레이드 및 권한 부여 인증 추가
TRTC 월간 구독 패키지 출시 관련 안내
제품 소개
제품 개요
기본 개념
제품 기능
제품 장점
응용 시나리오
성능 데이터
구매 가이드
Billing Overview
무료 시간 안내
Monthly subscription
Pay-as-you-go
TRTC Overdue and Suspension Policy
과금 FAQ
Refund Instructions
신규 사용자 가이드
Demo 체험
Call
개요(TUICallKit)
Activate the Service
Run Demo
빠른 통합(TUICallKit)
오프라인 푸시
Conversational Chat
온클라우드 녹화(TUICallKit)
AI Noise Reduction
UI 사용자 정의
Calls integration to Chat
Additional Features
No UI Integration
Server APIs
Client APIs
Solution
ErrorCode
릴리스 노트
FAQs
라이브 스트리밍
Billing of Video Live Component
Overview
Activating the Service (TUILiveKit)
Demo 실행
No UI Integration
UI Customization
Live Broadcast Monitoring
Video Live Streaming
Voice Chat Room
Advanced Features
Client APIs
Server APIs
Error Codes
Release Notes
FAQs
RTC Engine
Activate Service
SDK 다운로드
API 코드 예시
Usage Guidelines
API 클라이언트 API
고급 기능
RTC RESTFUL API
History
Introduction
API Category
Room Management APIs
Stream mixing and relay APIs
On-cloud recording APIs
Data Monitoring APIs
Pull stream Relay Related interface
Web Record APIs
AI Service APIs
Cloud Slicing APIs
Cloud Moderation APIs
Making API Requests
Call Quality Monitoring APIs
Usage Statistics APIs
Data Types
Appendix
Error Codes
콘솔 가이드
애플리케이션 관리
사용량 통계
모니터링 대시보드
개발 보조
Solution
Real-Time Chorus
FAQs
과금 개요
기능 관련
UserSig 관련
방화벽 제한 처리
설치 패키지 용량 축소 관련 질문
Andriod 및 iOS 관련
Web 관련
Flutter 관련
Electron 관련
TRTCCalling Web 관련
멀티미디어 품질 관련
기타 질문
Protocols and Policies
컴플라이언스 인증
보안 백서
정보 보안에 관한 참고 사항
Service Level Agreement
Apple Privacy Policy: PrivacyInfo.xcprivacy
TRTC 정책
개인 정보 보호 정책
데이터 처리 및 보안 계약
용어집

Introduction to REST API

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-07-24 10:20:03
The RESTful API is a part of the TRTC Call's backend HTTP Hub Management Interface Hub, providing developers with a simplified management entry. For the RESTful APIs currently supported by the TRTC Call, please refer to REST API List.
For security reasons, the RESTful API is only available via HTTPS Interface.

Use Conditions

The REST API is currently in beta. During the beta period, applications (SDKAppId) that have enabled the Group Call Version of TRTC Call can use the REST API. You can also activate a free trial of the experience version. For version descriptions and activation guidelines, refer to Activate the Service.
Currently, the RESTful API is available only in specific versions of TUICallKit across different platforms, as detailed in the table below:
Platform/Framework
Version number
Android/iOS/Flutter/uni-app (client)
≥ 1.7.1
Web
≥ 1.4.6
WeChat Mini Program
≥ 1.5.1
Note:
Only after all participating platforms/frameworks are upgraded to the versions mentioned above, can the corresponding call information be peeked at in the console.
During the Beta Testing Period, the RESTful API supports querying data from the past 7 days.

RESTful API List

Feature Overview
API
Access records through callId
Access records by condition

Calling method

Request URL

The URL format of the RESTful API is as follows:
https://xxxxxx/$version/$kind/$command?sdkappid=$SDKAppID&identifier=$identifier&usersig=$usersig&random=99999999&contenttype=json
The meanings and values of each parameter are as follows (both parameter names and their values are case-sensitive):
Parameter
Meaning
Fetching Value
https
Request protocol
The request protocol is HTTPS, and the request method is POST
xxxxxx
reserved domain name
callkit-intl.trtc.tencent-cloud.com
version
Protocol Version Number
Fixed as v1
kind
Management Classification
Example:
v1/records/get_record_by_callId, where `records` is a kind
command
The word `command`, combined with `kind`, is used to indicate a specific business feature
Example: v1/records/get_record_by_callId, where `get_record_by_callId` is a command
sdkappid
The application identifier accessed in the console
Obtained when applying for integration
identifier
username, must be an App Administrator Account when calling RESTful APIs
Using the Admin account of Chat
usersig
password corresponding to username
Refer to Generating UserSig
random
Identifies the random number parameter for the current request
32-bit unsigned integer random number, ranging from 0 to 4294967295
contenttype
Request Format
Fixed value: json
Note:
After obtaining or purchasing package bundles, an administrator account named `administrator` will be created in the Chat account system. Please use `administrator` for the identifier parameter in requests. If you cancel or delete an administrator in Chat Account Management, please correctly specify the administrator account and corresponding UserSig.
Apps can either generate a UserSig for the administrator account at every RESTful API call, or generate a fixed UserSig for repeated use. However, it is crucial to pay attention to the UserSig's validity period.
During operations such as creating or entering a room, the system will automatically import Chat accounts into the Chat System. Please be aware.

HTTP Request Body Format

The RESTful API only supports the POST method, and its request body is in JSON format. For specific body formats, refer to the detailed description of each API.
Note:
The POST body cannot be empty. Even if a protocol does not require any information to be carried, it must still include an empty JSON object, namely {}.

HTTP return code

Unless a network error occurs (e.g., 502 error), the call result of the RESTful API is always 200. The actual error code and error message of the API call are returned in the HTTP response body.

HTTP Response Body Format

The response body of the RESTful API is also in JSON format, and its format conforms to the following characteristics:
{
"errorCode": 0,
"errorMessage": "Success",
"requestId": "1c8960ac38d61be38b6fb219db0182d1",
"data": {}
}
The response body must contain three attributes: errorCode, errorMessage, requestId. Their meanings are as follows:
Field
Type
Description
errorCode
String
Error code, 0 for success, others for failure
errorMessage
String
Error message
requestId
Integer
Request Unique Identifier

Sample call

Below is an example of accessing call records for a specified callId through RESTful APIs.
HTTPS Request:
POST /records/get_record_by_callId?usersig=xxx&identifier=admin&sdkappid=88888888&random=99999999&contenttype=json HTTP/2
Host: callkit-intl.trtc.tencent-cloud.com
Content-Length: 36
{
"callId": "2ae7d549-c441-4a9b-87c0-61810fe19582"
}
HTTPS Response:
HTTP/2 200 OK
Date: Fri, 21 Apr 2023 06:06:16 GMT
Content-Length: 112
Connection: keep-alive

{
"errorCode": 0,
"errorMessage": "Success",
"requestId": "9f01db503f2006ad10c45f4f4609e38d",
"data": {
"callId": "2ae7d549-c441-4a9b-87c0-61810fe19582",
"sdkAppId": 88888888,
"mediaType": "video",
"roomId": "123456",
"startCallTs": 1688705638,
"acceptTs": 1688705641,
"endTs": 1688705668,
"caller": "alice",
"totalUserNumber": 2,
"callType": "single",
"callResult": "normal_end",
"callees": [
"bob1",
"bob2"
]
}
}

Common Error Codes for RESTful APIs

Error code
Description
0
Request succeeded
50001
The current application needs to purchase the TUICallKit Group Call Version Package to use
70001
Invalid request parameters, please check whether mandatory parameters are missing or incorrectly entered
70002
UserSig is invalid
70003
UserSig has expired
70004
Requesting user is not a Super Administrator
70005
Request frequency limited
70009
Error in parsing request body, please check if the request parameter type is correct
Unknown error code
System internal error, please Submit a ticket to contact technical personnel

FAQs

Is there a chance that REST API requests timeout, receiving no response?

You can confirm from the following aspects:
1. The backend REST interface's timeout setting is 3s, the caller's timeout setting should be longer than 3s.
2. telnet callkit-intl.trtc.tencent-cloud.com 443 to confirm if the service port can be connected.
3. Use curl -I https://callkit-intl.trtc.tencent-cloud.com for a simple test to see if the status code is 200.
4. Confirm whether the machine's DNS server configuration is an internal DNS server or a public DNS server. If it is an internal DNS server, ensure that the DNS server's network egress and the region ISP of the machine's network egress IP match.
5. It is recommended for business callers to use the long connection + connection pool pattern.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백