天猫订阅接口,包含2方面授权:
1.天猫端,把订阅消息授权给服务商
点“批量订阅”中,就会显示服务商可订阅的订阅消息,把订阅的消息选中,确认即可。
订阅消息分传给淘宝的消息,还是收到淘宝的消息。天猫和淘宝的订阅消息配置是一样的,这里就不累赘。
2.服务商端,允许接受天猫订阅消息
public String tmcUserPermit() {
TaobaoClient client = new DefaultTaobaoClient(url, appkey, appSecret);
TmcUserPermitRequest req = new TmcUserPermitRequest();
req.setTopics("tmall_fuwu_AnomalyRecourse,tmall_fuwu_AnomalyRecourseStatusUpdate,tmall_fuwu_SettleAdjustmentStatusUpdate");
TmcUserPermitResponse response;
try {
response = client.execute(req, sessionkey);
return response.getBody();
} catch (ApiException e) {
e.printStackTrace();
}
return "没有获取到数据";
}
注意:
1)以前授权的订阅消息,不能删掉,删掉后表示取消以前的订阅消息;
2)多个订阅消息间,用逗号分开