OpenAPI SDK for Python
Project description
简介
欢迎使用腾讯会议开发者工具套件(SDK)1.1.0,为方便 Python 开发者调试和接入腾讯云会议 API,这里向您介绍适用于 Python 的腾讯会议开发工具包,并提供首次使用开发工具包的简单示例。让您快速获取腾讯会议 Python SDK 并开始调用。
依赖环境
- 依赖环境:Python 3.7 版本及以上。
- 购买腾讯会议企业版获取 SecretID、SecretKey,接入的企业 AppId。
获取安装
在第一次使用云API之前,用户首先需要在腾讯云控制台上申请安全凭证,安全凭证包括 SecretID 和 SecretKey,SecretID 是用于标识 API 调用者的身份,SecretKey 是用于加密签名字符串和服务器端验证签名字符串的密钥 SecretKey 必须严格保管,避免泄露。
通过源码包安装
- 前往 Github 代码托管地址 下载源码压缩包;
- 解压源码包到您项目合适的位置;
- 引用方法可参考示例。
示例
以创建会议接口为例:
import random
import time
import wemeet_openapi
# crete_meeting_demo 创建会议请求demo
def crete_meeting_demo():
# 1.构造 client 客户端(jwt 鉴权需要配置 appId sdkId secretID 和 secretKey)
client = wemeet_openapi.Client(app_id="2****46", sdk_id="2****50",
secret_id="Zk*****J8h",
secret_key="Y2z*****WRsVksn")
# 2.构造请求体
request = wemeet_openapi.ApiV1MeetingsPostRequest(
body=wemeet_openapi.V1MeetingsPostRequest(
instanceid=2,
meeting_type=0,
subject="测试会议",
type=1,
userid="userid",
start_time="1651334400",
end_time="1651377600"
)
)
# 3.构造 JWT 鉴权器
authenticator_builder = wemeet_openapi.JWTAuthenticator(
nonce=random.randrange(0, 2 ** 64),
timestamp=str(int(time.time()))
).options_build()
# 4.发送对应的请求
try:
response = client.meetings_api.v1_meetings_post(
request=request,
authenticator_options=[authenticator_builder])
print(f"Response from `MeetingsApi.V1MeetingsPost`: {vars(response)}\n")
except wemeet_openapi.ClientException as e:
print(f"Error when calling `MeetingsApi.V1MeetingsPost`: {e}\n")
except wemeet_openapi.ServiceException as svrErr:
print(f"Error when calling `MeetingsApi.V1MeetingsPost`: {svrErr}\n")
print(f"Full HTTP response: {str(svrErr.api_resp.raw_body)}\n")
# 调用入口点函数
if __name__ == "__main__":
crete_meeting_demo()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wemeet-openapi-1.0.0.15.tar.gz.
File metadata
- Download URL: wemeet-openapi-1.0.0.15.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2b35f0dd05f6e31e34ae0968049d8c250a095e404ef815476bb218d630198c9
|
|
| MD5 |
d44fe6dcfcda7c1b9d4b908ceb08fd7a
|
|
| BLAKE2b-256 |
458d84e3ee3932f88091d3dc2a03b3ed9f751db5d0e0ef18046cf5f150f13ca1
|
File details
Details for the file wemeet_openapi-1.0.0.15-py3-none-any.whl.
File metadata
- Download URL: wemeet_openapi-1.0.0.15-py3-none-any.whl
- Upload date:
- Size: 98.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3eb8c92d404af04a3cb880de9dc60bd2f322b7952ab6ee9dfb5cdf27a3c42c9b
|
|
| MD5 |
9858cbf7a2df14fe38505f5ace98813a
|
|
| BLAKE2b-256 |
991cc43e1a2a0651dd01d15b529b2a9d6453afc4f90c42c32742a6763876cd6f
|