添加归档服务器
添加归档服务器,用于存储 PBX 的录音文件和备份文件。
请求 URL
POST {base_url}/{api_path}/archive_server/create?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| name | 是 | String | 归档服务器的名称。 |
| server_type | 是 | String | 归档服务器的类型。 取值范围:
|
| host | 否 | String | 服务器地址。 注: 当 server_type 为
ftp 或 sftp 时,此参数必填。 |
| port | 否 | Integer | 服务器端口。 注: 当 server_type 为
ftp 或 sftp 时,此参数必填。 |
| protoc | 否 | String | FTP 服务器使用的协议。 注: 当 server_type 为
ftp 时,此参数必填。取值范围:
|
| method | 否 | Integer | SFTP 服务器使用的认证方式。 注: 当 server_type 为
sftp 时,此参数必填。取值范围:
|
| username | 否 | String | FTP 或 SFTP 账户的用户名。 注: 当 server_type 为
ftp 或 sftp 时,此参数必填。 |
| password | 否 | String | FTP 或 SFTP 账户的密码。 注: 当
server_type 为
ftp,或 server_type 为 sftp 且
method 为 1 时,此参数必填。 |
| ssh_private_key | 否 | String | 用于 SFTP 认证的 SSH 私钥的文件名。 注:
|
| endpoint | 否 | String | S3 兼容存储的 endpoint。 注: 当 server_type 为
amazon_s3 时,此参数必填。 |
| region | 否 | String | S3 兼容存储的地域。 注: 当
server_type 为
amazon_s3 时,此参数必填。 |
| access_key_id | 否 | String | S3 兼容存储账户的 Access Key ID。 注: 当 server_type 为
amazon_s3 时,此参数必填。 |
| secret_access_key | 否 | String | S3 兼容存储账户的 Secret Access Key。 注: 当 server_type 为
amazon_s3 时,此参数必填。 |
| tenant_id | 否 | String | Microsoft Entra 租户 ID。 注: 当
server_type 为 sharepoint
时,此参数必填。 |
| client_id | 否 | String | 在 Microsoft Entra ID 中注册的应用程序 (客户端) ID。 注: 当
server_type 为 sharepoint
时,此参数必填。 |
| client_secret | 否 | String | 在 Microsoft Entra ID 中注册的应用程序的客户端密钥。 注: 当
server_type 为 sharepoint
时,此参数必填。 |
| private_key | 否 | String | 用于 Google Cloud Storage 认证的私钥的文件名。 注:
|
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| id | Integer | 归档服务器的 ID。 |
| upper_limited | Integer | 归档服务器的数量上限,仅当 errcode 为 60002 (达到数量上限)
时返回。 |
示例
请求示例
POST /openapi/v1.0/archive_server/create?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
"name": "Sample-FTP-Server",
"server_type": "ftp",
"protoc": "ftp",
"host": "121.41.123.45",
"port": 21,
"username": "root",
"password": "password"
}
响应示例
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"submsg": "",
"id": 10,
"upper_limited": 0
}