TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaLyserviceLippiSessionCreateRequest req = new AlibabaLyserviceLippiSessionCreateRequest();
AlibabaLyserviceLippiSessionCreateRequest.LyDingOpenParaDTO obj1 = new AlibabaLyserviceLippiSessionCreateRequest.LyDingOpenParaDTO();
obj1.setIsvOrgId(0L);
obj1.setCorpId("dingxx");
obj1.setTokenGrantType(0L);
obj1.setSuiteKey("xx");
obj1.setOrgId(123L);
req.setLyDingOpenParaDto(obj1);
AlibabaLyserviceLippiSessionCreateRequest.LyCreateSessionDTO obj2 = new AlibabaLyserviceLippiSessionCreateRequest.LyCreateSessionDTO();
AlibabaLyserviceLippiSessionCreateRequest.LySessionSourceDTO obj3 = new AlibabaLyserviceLippiSessionCreateRequest.LySessionSourceDTO();
obj3.setSummary("会话摘要");
obj3.setChannelAvatarUrl("https://down.dingtalk.com/ddmedia/iAEKAqNqcGcDAQTNA-gFzQLuBtoAIYQBpAu1l94Cqtvii70ZH-xyKTYDzwAAAWzq1yNYBM30hwcACAA.jpg");
obj3.setChannelNick("testNick");
obj3.setCmsId("testCmsId");
obj3.setSessionSource("XSpace");
obj3.setChannelUid("testUid");
obj3.setSessionEndTime(1577106264919L);
obj3.setChannel("0");
obj3.setSessionStartTime(1577106235000L);
obj3.setSessionStatus(0L);
obj3.setChannelUserSource("1234");
obj3.setSid("testSessionId");
obj2.setSource(obj3);
AlibabaLyserviceLippiSessionCreateRequest.LySessionTargetDTO obj4 = new AlibabaLyserviceLippiSessionCreateRequest.LySessionTargetDTO();
obj4.setSessionSource("XSpace");
obj4.setOpenInstanceId("shop001");
obj4.setDingCorpId("dingxxx");
obj4.setProductionType(1L);
obj4.setServiceId("testServiceId");
obj4.setBuId("123");
obj4.setCorpId("123");
obj2.setTarget(obj4);
req.setLyCreateSessionDto(obj2);
AlibabaLyserviceLippiSessionCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaLyserviceLippiSessionCreateRequest req = new AlibabaLyserviceLippiSessionCreateRequest();
AlibabaLyserviceLippiSessionCreateRequest.LyDingOpenParaDTODomain obj1 = new AlibabaLyserviceLippiSessionCreateRequest.LyDingOpenParaDTODomain();
obj1.IsvOrgId = 0L;
obj1.CorpId = "dingxx";
obj1.TokenGrantType = 0L;
obj1.SuiteKey = "xx";
obj1.OrgId = 123L;
req.LyDingOpenParaDto_ = obj1;
AlibabaLyserviceLippiSessionCreateRequest.LyCreateSessionDTODomain obj2 = new AlibabaLyserviceLippiSessionCreateRequest.LyCreateSessionDTODomain();
AlibabaLyserviceLippiSessionCreateRequest.LySessionSourceDTODomain obj3 = new AlibabaLyserviceLippiSessionCreateRequest.LySessionSourceDTODomain();
obj3.Summary = "会话摘要";
obj3.ChannelAvatarUrl = "https://down.dingtalk.com/ddmedia/iAEKAqNqcGcDAQTNA-gFzQLuBtoAIYQBpAu1l94Cqtvii70ZH-xyKTYDzwAAAWzq1yNYBM30hwcACAA.jpg";
obj3.ChannelNick = "testNick";
obj3.CmsId = "testCmsId";
obj3.SessionSource = "XSpace";
obj3.ChannelUid = "testUid";
obj3.SessionEndTime = 1577106264919L;
obj3.Channel = "0";
obj3.SessionStartTime = 1577106235000L;
obj3.SessionStatus = 0L;
obj3.ChannelUserSource = "1234";
obj3.Sid = "testSessionId";
obj2.Source= obj3;
AlibabaLyserviceLippiSessionCreateRequest.LySessionTargetDTODomain obj4 = new AlibabaLyserviceLippiSessionCreateRequest.LySessionTargetDTODomain();
obj4.SessionSource = "XSpace";
obj4.OpenInstanceId = "shop001";
obj4.DingCorpId = "dingxxx";
obj4.ProductionType = 1L;
obj4.ServiceId = "testServiceId";
obj4.BuId = "123";
obj4.CorpId = "123";
obj2.Target= obj4;
req.LyCreateSessionDto_ = obj2;
AlibabaLyserviceLippiSessionCreateResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaLyserviceLippiSessionCreateRequest;
$ly_ding_open_para_dto = new LyDingOpenParaDTO;
$ly_ding_open_para_dto->isv_org_id="0";
$ly_ding_open_para_dto->corp_id="dingxx";
$ly_ding_open_para_dto->token_grant_type="0";
$ly_ding_open_para_dto->suite_key="xx";
$ly_ding_open_para_dto->org_id="123";
$req->setLyDingOpenParaDto(json_encode($ly_ding_open_para_dto));
$ly_create_session_dto = new LyCreateSessionDTO;
$source = new LySessionSourceDTO;
$source->summary="会话摘要";
$source->channel_avatar_url="https://down.dingtalk.com/ddmedia/iAEKAqNqcGcDAQTNA-gFzQLuBtoAIYQBpAu1l94Cqtvii70ZH-xyKTYDzwAAAWzq1yNYBM30hwcACAA.jpg";
$source->channel_nick="testNick";
$source->cms_id="testCmsId";
$source->session_source="XSpace";
$source->channel_uid="testUid";
$source->session_end_time="1577106264919";
$source->channel="0";
$source->session_start_time="1577106235000";
$source->session_status="0";
$source->channel_user_source="1234";
$source->sid="testSessionId";
$ly_create_session_dto->source = $source;
$target = new LySessionTargetDTO;
$target->session_source="XSpace";
$target->open_instance_id="shop001";
$target->ding_corp_id="dingxxx";
$target->production_type="1";
$target->service_id="testServiceId";
$target->bu_id="123";
$target->corp_id="123";
$ly_create_session_dto->target = $target;
$req->setLyCreateSessionDto(json_encode($ly_create_session_dto));
$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.lyservice.lippi.session.create' \
-d 'partner_id=apidoc' \
-d 'sign=B8D3B54E7FF697D93F301CD4BFA7F274' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-29+16%3A10%3A33' \
-d 'v=2.0' \
-d 'ly_create_session_dto=null' \
-d 'ly_ding_open_para_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaLyserviceLippiSessionCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.ly_ding_open_para_dto="数据结构示例JSON格式"
req.ly_create_session_dto="数据结构示例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,"alibaba.lyservice.lippi.session.create");
add_param(pRequest,"ly_ding_open_para_dto","数据结构JSON示例");
add_param(pRequest,"ly_create_session_dto","数据结构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.lyservice.lippi.session.create', {
'ly_ding_open_para_dto':'数据结构JSON示例',
'ly_create_session_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})