TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAlscChudaWeatherCollectRequest req = new AlibabaAlscChudaWeatherCollectRequest();
AlibabaAlscChudaWeatherCollectRequest.MetDisasterRequest obj1 = new AlibabaAlscChudaWeatherCollectRequest.MetDisasterRequest();
obj1.setAdCode("610626");
obj1.setAlertId("ac_610002314");
obj1.setCity("延安市");
obj1.setCode("1101");
obj1.setCounty("吴起县");
obj1.setDescription("吴起县气象台x年x月x日x时x分发布霜冻蓝色预警信号");
obj1.setExpiredTime("2018-10-24T14:27:00+08:00");
obj1.setExpiredTimestamp(1540908348L);
obj1.setLatlon(new Long[] { \"36.927216\",\"108.175933\" };
);
obj1.setLocation("陕西省延安市吴起县");
obj1.setProvince("陕西省");
obj1.setPublishedTime("2018-10-24T14:27:00+08:00");
obj1.setPublishedTimestamp(1540909929L);
obj1.setRegionId("101110312");
obj1.setStatus("预警中");
obj1.setTitle("吴起县气象局解除霜冻蓝色预警[IV级/一般]");
req.setParamMetDisasterRequest(obj1);
AlibabaAlscChudaWeatherCollectResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAlscChudaWeatherCollectRequest req = new AlibabaAlscChudaWeatherCollectRequest();
AlibabaAlscChudaWeatherCollectRequest.MetDisasterRequestDomain obj1 = new AlibabaAlscChudaWeatherCollectRequest.MetDisasterRequestDomain();
obj1.AdCode = "610626";
obj1.AlertId = "ac_610002314";
obj1.City = "延安市";
obj1.Code = "1101";
obj1.County = "吴起县";
obj1.Description = "吴起县气象台x年x月x日x时x分发布霜冻蓝色预警信号";
obj1.ExpiredTime = "2018-10-24T14:27:00+08:00";
obj1.ExpiredTimestamp = 1540908348L;
obj1.Latlon = new long[] { \"36.927216\",\"108.175933\" };
;
obj1.Location = "陕西省延安市吴起县";
obj1.Province = "陕西省";
obj1.PublishedTime = "2018-10-24T14:27:00+08:00";
obj1.PublishedTimestamp = 1540909929L;
obj1.RegionId = "101110312";
obj1.Status = "预警中";
obj1.Title = "吴起县气象局解除霜冻蓝色预警[IV级/一般]";
req.ParamMetDisasterRequest_ = obj1;
AlibabaAlscChudaWeatherCollectResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAlscChudaWeatherCollectRequest;
$param_met_disaster_request = new MetDisasterRequest;
$param_met_disaster_request->ad_code="610626";
$param_met_disaster_request->alert_id="ac_610002314";
$param_met_disaster_request->city="延安市";
$param_met_disaster_request->code="1101";
$param_met_disaster_request->county="吴起县";
$param_met_disaster_request->description="吴起县气象台x年x月x日x时x分发布霜冻蓝色预警信号";
$param_met_disaster_request->expired_time="2018-10-24T14:27:00+08:00";
$param_met_disaster_request->expired_timestamp="1540908348";
$param_met_disaster_request->latlon="\"36.927216\",\"108.175933\"";
$param_met_disaster_request->location="陕西省延安市吴起县";
$param_met_disaster_request->province="陕西省";
$param_met_disaster_request->published_time="2018-10-24T14:27:00+08:00";
$param_met_disaster_request->published_timestamp="1540909929";
$param_met_disaster_request->region_id="101110312";
$param_met_disaster_request->status="预警中";
$param_met_disaster_request->title="吴起县气象局解除霜冻蓝色预警[IV级/一般]";
$req->setParamMetDisasterRequest(json_encode($param_met_disaster_request));
$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.alsc.chuda.weather.collect' \
-d 'partner_id=apidoc' \
-d 'sign=7BB12702F3A71C434CE7A6B90736EA03' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-25+17%3A38%3A12' \
-d 'v=2.0' \
-d 'param_met_disaster_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAlscChudaWeatherCollectRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_met_disaster_request=""
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.alsc.chuda.weather.collect");
add_param(pRequest,"param_met_disaster_request","数据结构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.alsc.chuda.weather.collect', {
'param_met_disaster_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})