POST api/Files/NewVoiceUpload

语音聊天提交服务器

Request Information

Body Parameters

语聊参数

VoiceUploadModel
NameDescriptionTypeAdditional information
SerialNumber

设备 imei

string

None.

Long

语音时长

integer

None.

VoiceTime

录制时间

date

None.

Command

语音文件内容 将amr文件内容转为 base64字符串

string

None.

IdentityID

终端唯一 id [终端用于缓存,由APP自行维护,服务器只作保存]

string

None.

UserId

用户 id

integer

None.

ChatType

聊天类型 1 单聊 2 群聊

integer

None.

FileType

消息类型

integer

None.

Token

登录后获取到的 Token

string

None.

Language

语言选项

string

None.

AppId

APP应用标识

string

None.

Request Formats

application/json, text/json

Sample:
{
  "SerialNumber": "sample string 1",
  "Long": 2,
  "VoiceTime": "2025-12-12T05:27:24.3789371+08:00",
  "Command": "sample string 4",
  "IdentityID": "sample string 5",
  "UserId": 6,
  "ChatType": 7,
  "FileType": 8,
  "Token": "sample string 9",
  "Language": "sample string 10",
  "AppId": "sample string 11"
}

application/xml, text/xml

Sample:
<VoiceUploadModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NewGPS2012.AppApi.Models.ParModel">
  <AppId>sample string 11</AppId>
  <Language>sample string 10</Language>
  <Token>sample string 9</Token>
  <ChatType>7</ChatType>
  <Command>sample string 4</Command>
  <FileType>8</FileType>
  <IdentityID>sample string 5</IdentityID>
  <Long>2</Long>
  <SerialNumber>sample string 1</SerialNumber>
  <UserId>6</UserId>
  <VoiceTime>2025-12-12T05:27:24.3789371+08:00</VoiceTime>
</VoiceUploadModel>

Response Information

Resource Description

State说明:
0. 成功
1000. 设备不存在
1100. IMEI为空
8000. 语音数据为空或时长超长

NormalResult
NameDescriptionTypeAdditional information
Message

消息 [大多数情况下可通过该消息做为提示语]

string

None.

State

状态码

integer

None.

Response Formats

application/json, text/json

Sample:
{
  "Message": "sample string 1",
  "State": 2
}

application/xml, text/xml

Sample:
<NormalResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/NewGPS2012.AppApi.Models.ResModel">
  <State>2</State>
  <Message>sample string 1</Message>
</NormalResult>