pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"alibaba.amap.channel.car.order.submit");
add_param(pRequest,"amap_order_id","1541894302897424029");
add_param(pRequest,"channel_order_id","1541894302897");
add_param(pRequest,"mobile","15811531425");
add_param(pRequest,"user_id","6334083");
add_param(pRequest,"cp_transport_list","数据结构JSON示例");
add_param(pRequest,"start_location","数据结构JSON示例");
add_param(pRequest,"end_location","数据结构JSON示例");
add_param(pRequest,"gd_service_id","1");
add_param(pRequest,"departure_time","1600087832858");
add_param(pRequest,"extra_info","\"\"");
add_param(pRequest,"trace_id","6d684a10-873a-5c84-878c-161f15923200");
add_param(pRequest,"client_source","amap-car");
add_param(pRequest,"idfa","6d684a10-873a-5c84-878c-161f15923200");
add_param(pRequest,"imei","6d684a10-873a-5c84-878c-161f15923200");
add_param(pRequest,"order_mark","3");
add_param(pRequest,"airport_info","数据结构JSON示例");
add_param(pRequest,"insurance_amount","50");
add_param(pRequest,"open_ability","数据结构JSON示例");
add_param(pRequest,"support_pay_flag","1");
add_param(pRequest,"enterprise_flag","1");
add_param(pRequest,"third_party_dispatch_reward","100");
add_param(pRequest,"strategy_type","3");
add_param(pRequest,"directional_assignment_information","数据结构JSON示例");
add_param(pRequest,"sub_gd_service_id","1");
add_param(pRequest,"contact_passenger_first","true");
add_param(pRequest,"passenger_phone","18771043173");
add_param(pRequest,"passenger_name","张三");
add_param(pRequest,"estimate_id","6d684a10-873a-5c84-878c-161f15923200");
add_param(pRequest,"user_mobile_type","1");
add_param(pRequest,"last_four_digits_of_real_mobile","5434");
add_param(pRequest,"contact_info","数据结构JSON示例");
add_param(pRequest,"chauffeur_info","数据结构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('alibaba.amap.channel.car.order.submit', {
'amap_order_id':'1541894302897424029',
'channel_order_id':'1541894302897',
'mobile':'15811531425',
'user_id':'6334083',
'cp_transport_list':'数据结构JSON示例',
'start_location':'数据结构JSON示例',
'end_location':'数据结构JSON示例',
'gd_service_id':'1',
'departure_time':'1600087832858',
'extra_info':'\"\"',
'trace_id':'6d684a10-873a-5c84-878c-161f15923200',
'client_source':'amap-car',
'idfa':'6d684a10-873a-5c84-878c-161f15923200',
'imei':'6d684a10-873a-5c84-878c-161f15923200',
'order_mark':'3',
'airport_info':'数据结构JSON示例',
'insurance_amount':'50',
'open_ability':'数据结构JSON示例',
'support_pay_flag':'1',
'enterprise_flag':'1',
'third_party_dispatch_reward':'100',
'strategy_type':'3',
'directional_assignment_information':'数据结构JSON示例',
'sub_gd_service_id':'1',
'contact_passenger_first':'true',
'passenger_phone':'18771043173',
'passenger_name':'张三',
'estimate_id':'6d684a10-873a-5c84-878c-161f15923200',
'user_mobile_type':'1',
'last_four_digits_of_real_mobile':'5434',
'contact_info':'数据结构JSON示例',
'chauffeur_info':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})