Skip to content

Commit

Permalink
Add statusvoicefile examples
Browse files Browse the repository at this point in the history
  • Loading branch information
qcloudsms committed Jul 4, 2018
1 parent 6c1a8df commit edcd99d
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,36 @@ try {

> `Note` '语音文件上传'功能需要联系腾讯云短信技术支持(QQ:3012203387)才能开通
- **查询语音文件审核状态**

```java
import com.github.qcloudsms.VoiceFileStatus;
import com.github.qcloudsms.VoiceFileStatusResult;
import com.github.qcloudsms.httpclient.HTTPException;
import org.json.JSONException;

try {
// Note: 这里fid来自`上传语音文件`接口返回的响应,要按语音
// 文件fid发送语音通知,需要先上传语音文件获取fid
String fid = "c799d10a43ec109f02f2288ca3c85b79e7700c98.mp3";
VoiceFileStatus vfstatus = new VoiceFileStatus(appid, appkey);
VoiceFileStatusResult result = vfstatus.get(fid);
// result里会带有语音文件审核状态status, {0: 待审核, 1: 通过, 2: 拒绝, 3: 语音文件不存在}
System.out.print(result);
} catch (HTTPException e) {
// HTTP响应码错误
e.printStackTrace();
} catch (JSONException e) {
// json解析错误
e.printStackTrace();
} catch (IOException e) {
// 网络IO错误
e.printStackTrace();
}
```

> `Note` '查询语音文件审核状态'功能需要联系腾讯云短信技术支持(QQ:3012203387)才能开通

- **按语音文件fid发送语音通知**

Expand Down

0 comments on commit edcd99d

Please sign in to comment.