TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAliqinFcIvrNumCallRequest req = new AlibabaAliqinFcIvrNumCallRequest();
req.setCalledNumber("13800000000");
req.setCalledShowNumber("057188773344");
req.setUseTts("tts");
req.setMenuCode("a.wav");
req.setSessionTimeOut("120");
req.setExtend("12345");
req.setByeCode("a.wav");
req.setMenuArgsString("{\"code\":\"1234\"}");
req.setPlayTimes(3L);
req.setParamsString("{ \"menuKeyMap\": [ { \"key\": \"1\", \"action\": \"voice\", \"code\": \"1.wav\" }, { \"key\": \"2\", \"action\": \"voice\", \"code\": \"2.wav\" }, { \"key\": \"-1\", (按键输入错误) \"action\": \"voice\", \"code\": \"error.wav\",(按键输入错误提示音) \"max\":\"3\",(按键输入错误最大次数) \"maxNotice\":\"maxNotice.wav\"(按键输入误超过最大输入次数的错提示音) } ]}");
req.setServiceNumber("95***");
AlibabaAliqinFcIvrNumCallResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAliqinFcIvrNumCallRequest req = new AlibabaAliqinFcIvrNumCallRequest();
req.CalledNumber = "13800000000";
req.CalledShowNumber = "057188773344";
req.UseTts = "tts";
req.MenuCode = "a.wav";
req.SessionTimeOut = "120";
req.Extend = "12345";
req.ByeCode = "a.wav";
req.MenuArgs = "{\"code\":\"1234\"}";
req.PlayTimes = 3L;
req.Params = "{ \"menuKeyMap\": [ { \"key\": \"1\", \"action\": \"voice\", \"code\": \"1.wav\" }, { \"key\": \"2\", \"action\": \"voice\", \"code\": \"2.wav\" }, { \"key\": \"-1\", (按键输入错误) \"action\": \"voice\", \"code\": \"error.wav\",(按键输入错误提示音) \"max\":\"3\",(按键输入错误最大次数) \"maxNotice\":\"maxNotice.wav\"(按键输入误超过最大输入次数的错提示音) } ]}";
req.ServiceNumber = "95***";
AlibabaAliqinFcIvrNumCallResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAliqinFcIvrNumCallRequest;
$req->setCalledNumber("13800000000");
$req->setCalledShowNumber("057188773344");
$req->setUseTts("tts");
$req->setMenuCode("a.wav");
$req->setSessionTimeOut("120");
$req->setExtend("12345");
$req->setByeCode("a.wav");
$req->setMenuArgs("{\"code\":\"1234\"}");
$req->setPlayTimes("3");
$req->setParams("{ \"menuKeyMap\": [ { \"key\": \"1\", \"action\": \"voice\", \"code\": \"1.wav\" }, { \"key\": \"2\", \"action\": \"voice\", \"code\": \"2.wav\" }, { \"key\": \"-1\", (按键输入错误) \"action\": \"voice\", \"code\": \"error.wav\",(按键输入错误提示音) \"max\":\"3\",(按键输入错误最大次数) \"maxNotice\":\"maxNotice.wav\"(按键输入误超过最大输入次数的错提示音) } ]}");
$req->setServiceNumber("95***");
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=alibaba.aliqin.fc.ivr.num.call' \
-d 'partner_id=apidoc' \
-d 'sign=574A2B1EF458ECE269F391B3E40F9373' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-12-04+13%3A38%3A11' \
-d 'v=2.0' \
-d 'bye_code=a.wav' \
-d 'called_number=13800000000' \
-d 'called_show_number=057188773344' \
-d 'extend=12345' \
-d 'menu_args=%7B%5C%22code%5C%22%3A%5C%221234%5C%22%7D' \
-d 'menu_code=a.wav' \
-d 'params=%7B++++%5C%22menuKeyMap%5C%22%3A+%5B+++++++++%7B+++++++++++++%5C%22key%5C%22%3A+%5C%221%5C%22%2C++++++++++++++%5C%22action%5C%22%3A+%5C%22voice%5C%22%2C++++++++++++++%5C%22code%5C%22%3A+%5C%221.wav%5C%22+++++++++%7D%2C++++++++++%7B+++++++++++++%5C%22key%5C%22%3A+%5C%222%5C%22%2C++++++++++++++%5C%22action%5C%22%3A+%5C%22voice%5C%22%2C++++++++++++++%5C%22code%5C%22%3A+%5C%222.wav%5C%22+++++++++%7D%2C++++++++++%7B+++++++++++++%5C%22key%5C%22%3A+%5C%22-1%5C%22%2C+%28%E6%8C%89%E9%94%AE%E8%BE%93%E5%85%A5%E9%94%99%E8%AF%AF%29+++++++++++++%5C%22action%5C%22%3A+%5C%22voice%5C%22%2C++++++++++++++%5C%22code%5C%22%3A+%5C%22error.wav%5C%22%2C%28%E6%8C%89%E9%94%AE%E8%BE%93%E5%85%A5%E9%94%99%E8%AF%AF%E6%8F%90%E7%A4%BA%E9%9F%B3%29+++++++%5C%22max%5C%22%3A%5C%223%5C%22%2C%EF%BC%88%E6%8C%89%E9%94%AE%E8%BE%93%E5%85%A5%E9%94%99%E8%AF%AF%E6%9C%80%E5%A4%A7%E6%AC%A1%E6%95%B0%29+++++++%5C%22maxNotice%5C%22%3A%5C%22maxNotice.wav%5C%22%28%E6%8C%89%E9%94%AE%E8%BE%93%E5%85%A5%E8%AF%AF%E8%B6%85%E8%BF%87%E6%9C%80%E5%A4%A7%E8%BE%93%E5%85%A5%E6%AC%A1%E6%95%B0%E7%9A%84%E9%94%99%E6%8F%90%E7%A4%BA%E9%9F%B3%29+++++++++%7D+++++%5D%7D' \
-d 'play_times=3' \
-d 'service_number=95***' \
-d 'session_time_out=120' \
-d 'use_tts=tts'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAliqinFcIvrNumCallRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.called_number="13800000000"
req.called_show_number="057188773344"
req.use_tts="tts"
req.menu_code="a.wav"
req.session_time_out="120"
req.extend="12345"
req.bye_code="a.wav"
req.menu_args="{\"code\":\"1234\"}"
req.play_times=3
req.params="{ \"menuKeyMap\": [ { \"key\": \"1\", \"action\": \"voice\", \"code\": \"1.wav\" }, { \"key\": \"2\", \"action\": \"voice\", \"code\": \"2.wav\" }, { \"key\": \"-1\", (按键输入错误) \"action\": \"voice\", \"code\": \"error.wav\",(按键输入错误提示音) \"max\":\"3\",(按键输入错误最大次数) \"maxNotice\":\"maxNotice.wav\"(按键输入误超过最大输入次数的错提示音) } ]}"
req.service_number="95***"
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.aliqin.fc.ivr.num.call");
add_param(pRequest,"called_number","13800000000");
add_param(pRequest,"called_show_number","057188773344");
add_param(pRequest,"use_tts","tts");
add_param(pRequest,"menu_code","a.wav");
add_param(pRequest,"session_time_out","120");
add_param(pRequest,"extend","12345");
add_param(pRequest,"bye_code","a.wav");
add_param(pRequest,"menu_args","{\"code\":\"1234\"}");
add_param(pRequest,"play_times","3");
add_param(pRequest,"params","{ \"menuKeyMap\": [ { \"key\": \"1\", \"action\": \"voice\", \"code\": \"1.wav\" }, { \"key\": \"2\", \"action\": \"voice\", \"code\": \"2.wav\" }, { \"key\": \"-1\", (按键输入错误) \"action\": \"voice\", \"code\": \"error.wav\",(按键输入错误提示音) \"max\":\"3\",(按键输入错误最大次数) \"maxNotice\":\"maxNotice.wav\"(按键输入误超过最大输入次数的错提示音) } ]}");
add_param(pRequest,"service_number","95***");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('alibaba.aliqin.fc.ivr.num.call', {
'called_number':'13800000000',
'called_show_number':'057188773344',
'use_tts':'tts',
'menu_code':'a.wav',
'session_time_out':'120',
'extend':'12345',
'bye_code':'a.wav',
'menu_args':'{\"code\":\"1234\"}',
'play_times':'3',
'params':'{ \"menuKeyMap\": [ { \"key\": \"1\", \"action\": \"voice\", \"code\": \"1.wav\" }, { \"key\": \"2\", \"action\": \"voice\", \"code\": \"2.wav\" }, { \"key\": \"-1\", (按键输入错误) \"action\": \"voice\", \"code\": \"error.wav\",(按键输入错误提示音) \"max\":\"3\",(按键输入错误最大次数) \"maxNotice\":\"maxNotice.wav\"(按键输入误超过最大输入次数的错提示音) } ]}',
'service_number':'95***'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})