TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
YunosEbanmaMiniappVoicegwToyotacallRequest req = new YunosEbanmaMiniappVoicegwToyotacallRequest();
YunosEbanmaMiniappVoicegwToyotacallRequest.ToyotaRequestParams obj1 = new YunosEbanmaMiniappVoicegwToyotacallRequest.ToyotaRequestParams();
obj1.setVersion("1.0");
YunosEbanmaMiniappVoicegwToyotacallRequest.Header obj2 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Header();
obj2.setType("IntentRequest");
obj2.setTimestamp("15869741258");
obj1.setHeader(obj2);
YunosEbanmaMiniappVoicegwToyotacallRequest.Header obj3 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Header();
obj3.setIsNew(true);
obj3.setSessionId("123456234");
obj1.setSession(obj3);
YunosEbanmaMiniappVoicegwToyotacallRequest.Session obj4 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Session();
YunosEbanmaMiniappVoicegwToyotacallRequest.ThirdContext obj5 = new YunosEbanmaMiniappVoicegwToyotacallRequest.ThirdContext();
obj5.setFusionContext("\"{\\"channelId\\":\\"f6f0926c4cf144\\",\\"appId\\":\\"2019040163777110\\",\\"deviceToken\\":\\"token-5fc74ddc41fa48f8bc5704b881352ccc\\"}\"");
obj4.setThirdContext(obj5);
YunosEbanmaMiniappVoicegwToyotacallRequest.Device obj6 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Device();
obj6.setDeviceId("80457851d442031855e4e7d838dd838bfb2c429474125");
YunosEbanmaMiniappVoicegwToyotacallRequest.Location obj7 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Location();
obj7.setLocationSystem("WGS84");
obj7.setLatitude("42.234623");
obj7.setLongitude("102.103239");
obj6.setLocation(obj7);
obj4.setDevice(obj6);
obj4.setLocale("zh-CN");
obj1.setEndpoint(obj4);
YunosEbanmaMiniappVoicegwToyotacallRequest.Endpoint obj8 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Endpoint();
obj8.setInquireId("c32348e9186347acb485681fd21d40a7");
YunosEbanmaMiniappVoicegwToyotacallRequest.Intent obj9 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Intent();
obj9.setName("SEARCH_HOTLE");
obj9.setDomain("Accommodation");
obj9.setSlots("");
obj8.setIntent(obj9);
YunosEbanmaMiniappVoicegwToyotacallRequest.Intent obj10 = new YunosEbanmaMiniappVoicegwToyotacallRequest.Intent();
obj10.setType("text");
obj10.setOriginal("查询附近的明日之星八星级酒店");
obj8.setUtterance(obj10);
obj1.setInquire(obj8);
req.setParams(obj1);
YunosEbanmaMiniappVoicegwToyotacallResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
YunosEbanmaMiniappVoicegwToyotacallRequest req = new YunosEbanmaMiniappVoicegwToyotacallRequest();
YunosEbanmaMiniappVoicegwToyotacallRequest.ToyotaRequestParamsDomain obj1 = new YunosEbanmaMiniappVoicegwToyotacallRequest.ToyotaRequestParamsDomain();
obj1.Version = "1.0";
YunosEbanmaMiniappVoicegwToyotacallRequest.HeaderDomain obj2 = new YunosEbanmaMiniappVoicegwToyotacallRequest.HeaderDomain();
obj2.Type = "IntentRequest";
obj2.Timestamp = "15869741258";
obj1.Header= obj2;
YunosEbanmaMiniappVoicegwToyotacallRequest.HeaderDomain obj3 = new YunosEbanmaMiniappVoicegwToyotacallRequest.HeaderDomain();
obj3.IsNew = true;
obj3.SessionId = "123456234";
obj1.Session= obj3;
YunosEbanmaMiniappVoicegwToyotacallRequest.SessionDomain obj4 = new YunosEbanmaMiniappVoicegwToyotacallRequest.SessionDomain();
YunosEbanmaMiniappVoicegwToyotacallRequest.ThirdContextDomain obj5 = new YunosEbanmaMiniappVoicegwToyotacallRequest.ThirdContextDomain();
obj5.FusionContext = "\"{\\"channelId\\":\\"f6f0926c4cf144\\",\\"appId\\":\\"2019040163777110\\",\\"deviceToken\\":\\"token-5fc74ddc41fa48f8bc5704b881352ccc\\"}\"";
obj4.ThirdContext= obj5;
YunosEbanmaMiniappVoicegwToyotacallRequest.DeviceDomain obj6 = new YunosEbanmaMiniappVoicegwToyotacallRequest.DeviceDomain();
obj6.DeviceId = "80457851d442031855e4e7d838dd838bfb2c429474125";
YunosEbanmaMiniappVoicegwToyotacallRequest.LocationDomain obj7 = new YunosEbanmaMiniappVoicegwToyotacallRequest.LocationDomain();
obj7.LocationSystem = "WGS84";
obj7.Latitude = "42.234623";
obj7.Longitude = "102.103239";
obj6.Location= obj7;
obj4.Device= obj6;
obj4.Locale = "zh-CN";
obj1.Endpoint= obj4;
YunosEbanmaMiniappVoicegwToyotacallRequest.EndpointDomain obj8 = new YunosEbanmaMiniappVoicegwToyotacallRequest.EndpointDomain();
obj8.InquireId = "c32348e9186347acb485681fd21d40a7";
YunosEbanmaMiniappVoicegwToyotacallRequest.IntentDomain obj9 = new YunosEbanmaMiniappVoicegwToyotacallRequest.IntentDomain();
obj9.Name = "SEARCH_HOTLE";
obj9.Domain = "Accommodation";
obj9.Slots = "";
obj8.Intent= obj9;
YunosEbanmaMiniappVoicegwToyotacallRequest.IntentDomain obj10 = new YunosEbanmaMiniappVoicegwToyotacallRequest.IntentDomain();
obj10.Type = "text";
obj10.Original = "查询附近的明日之星八星级酒店";
obj8.Utterance= obj10;
obj1.Inquire= obj8;
req.Params_ = obj1;
YunosEbanmaMiniappVoicegwToyotacallResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new YunosEbanmaMiniappVoicegwToyotacallRequest;
$params = new ToyotaRequestParams;
$params->version="1.0";
$header = new Header;
$header->type="IntentRequest";
$header->timestamp="15869741258";
$params->header = $header;
$session = new Header;
$session->is_new="true";
$session->session_id="123456234";
$params->session = $session;
$endpoint = new Session;
$third_context = new ThirdContext;
$third_context->fusion_context="\"{\\"channelId\\":\\"f6f0926c4cf144\\",\\"appId\\":\\"2019040163777110\\",\\"deviceToken\\":\\"token-5fc74ddc41fa48f8bc5704b881352ccc\\"}\"";
$endpoint->third_context = $third_context;
$device = new Device;
$device->device_id="80457851d442031855e4e7d838dd838bfb2c429474125";
$location = new Location;
$location->location_system="WGS84";
$location->latitude="42.234623";
$location->longitude="102.103239";
$device->location = $location;
$endpoint->device = $device;
$endpoint->locale="zh-CN";
$params->endpoint = $endpoint;
$inquire = new Endpoint;
$inquire->inquire_id="c32348e9186347acb485681fd21d40a7";
$intent = new Intent;
$intent->name="SEARCH_HOTLE";
$intent->domain="Accommodation";
$intent->slots="";
$inquire->intent = $intent;
$utterance = new Intent;
$utterance->type="text";
$utterance->original="查询附近的明日之星八星级酒店";
$inquire->utterance = $utterance;
$params->inquire = $inquire;
$req->setParams(json_encode($params));
$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=yunos.ebanma.miniapp.voicegw.toyotacall' \
-d 'partner_id=apidoc' \
-d 'sign=D13702B27AC00473A078276BFCE5E6C8' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-02+08%3A58%3A29' \
-d 'v=2.0' \
-d 'params=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.YunosEbanmaMiniappVoicegwToyotacallRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.params="数据结构示例JSON格式"
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,"yunos.ebanma.miniapp.voicegw.toyotacall");
add_param(pRequest,"params","数据结构JSON示例");
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('yunos.ebanma.miniapp.voicegw.toyotacall', {
'params':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})