对接京东接口流程如下:
安装完成jingdong.las.im.hfs.install.push官网文档地址如下:
http://jos.jd.com/api/detail.htm?id=1902
Java代码如下:
public static String serverUrl = "https://api.jdwl.com/routerjson";
public static String accessToken = "***";//您的访问Token
public static String appKey = "***";//您的APP KEY
public static String appSecret = "***";//您的APP Secret
public static String serProNo = "***";//您的服务商编号,京东提供
public static String searchToken = "123456";//获取订单的校验码// 安装反馈
public static LasImHfsInstallPushResponse lasImHfsInstallPush(
LasImHfsInstallPushRequest request) throws JdException {
JdClient client = new DefaultJdClient(serverUrl, accessToken, appKey,
appSecret);
request.setSerProNo(serProNo);//服务商编码
return client.execute(request);
}// 安装反馈
public String installPush(int jdOrderID, String ordNo, String serviceNo,
String verCod, String opeN, String opeTel, int installStatus)
throws Exception {
// 向京东回传信息
String uniDet = "[{\"serviceNo\":\"" + serviceNo
+ "\",\"installStatus\":\"" + installStatus + "\"}]";
String result = this.lasImHfsInstallPush(ordNo, verCod, opeN,
opeTel, uniDet);
return result;}
API请求数据举例:
[{"serviceNo":"W1000140***","installStatus":"81"}]
API返回数据举例:
com.jd.open.api.sdk.response.HouseEI.LasImHfsInstallPushResponse@15a33500[result=com.jd.open.api.sdk.domain.HouseEI.ImServiceProviderExternalJsfSerivce.Result@dec9e19,code=0,url=https://api.jd.com/routerjson?sign=1F70D59C8855F***×tamp=2019-04-09+12%3A40%3A50&v=2.0&app_key=C56C3FA9B8F09***&method=jingdong.las.im.hfs.install.push&access_token=4e4ef0c7-***&360buy_param_json={"ins_det":"[{\"serviceNo\":\"W100014***\",\"installStatus\":\"81\"}]","ope_n":"张三","ope_t":"2019-04-09 12:40:50","ope_tel":"18312***","ord_no":"99952***","ser_pro_no":"0108***","ver_cod":""},zhDesc=<null>,enDesc=<null>,msg={"jingdong_las_im_hfs_install_push_responce":{"code":"0","result":{"err_cod":100,"err_msg":"操作成功","con":100,"suc":true}}}]//result=com.jd.open.api.sdk.domain.HouseEI.ImServiceProviderExternalJsfSerivce.Result@dec9e19[suc=true,con=100,errCod=100,errMsg=操作成功]
源码目录结构: