语音通话 VOICECALL-语音通知API:接口示例

时间:2024-11-04 21:27:20

接口示例

  • 请求示例
    示例1
    POST /rest/httpsessions/callnotify/v2.0 HTTP/1.1 
    
    content-type: application/json;charset=UTF-8
    authorization: AKSK realm="SDP",profile="UsernameToken",type="Appkey"
    x-aksk: UsernameToken Username="ZRBRz4bAXoFgEH7o4Ew308eXc1RA",PasswordDigest="****",Nonce="ac1c911c4792492687f8f6b2264a491e",Created="2018-05-26T00:35:30Z"
    content-length:xx
    
    { 
     
    "displayNbr":"+86186****5611", 
    "calleeNbr":"+8675581****01", 
    "playInfoList":[{"notifyVoice":"welcome.wav"},{"notifyVoice":"welcome.wav","collectInd":4}], 
    "statusUrl":"****", 
    "feeUrl":"****", 
    "userData":"testUserData" 
    }
    
    示例2
    语音通话平台上设置的模板ID=test_template,模板内容为“您有${NUM_2}件快递请到${TXT_32}领取”。
    下面的API将播放文本“您有3件快递请到人民公园正门领取”。
    POST /rest/httpsessions/callnotify/v2.0?app_key=z4Sdu8p7nml5Wd790aENW64oV5Fp HTTP/1.1 
    
    content-type: application/json;charset=UTF-8
    authorization: AKSK realm="SDP",profile="UsernameToken",type="Appkey"
    x-aksk: UsernameToken Username="ZRBRz4bAXoFgEH7o4Ew308eXc1RA",PasswordDigest="****",Nonce="ac1c911c4792492687f8f6b2264a491e",Created="2018-05-26T00:35:30Z"
    content-length:xx
     
    { 
     
    "displayNbr":"+86186****5611", 
    "calleeNbr":"+8675581****01", 
    "playInfoList":[{"templateId":"test_template", "templateParas":["3","人民公园正门"],"collectInd":5}], 
    "statusUrl":"****", 
    "feeUrl":"****", 
    "userData":"testUserData" 
    }
  • 响应示例
    HTTP/1.1 200 OK 
    Content-Type: application/json;charset=UTF-8 
    
    { 
    "resultcode":"0", 
    "resultdesc":"Success",
    "sessionId":"1200_366_0_20161228102743@callenabler.home1.com"
    }     
support.huaweicloud.com/api-VoiceCall/rtc_05_0013.html