Electronic single interface source code: one access, four links and one access, Baishi, post, Shunfeng, Debang, Jingdong

Time:2021-11-26

The express 100api electronic face-to-face single interface can support 45 + Express Companies (Sitong Yida, Baishi, postal, Shunfeng, Debang, etc.). It can also connect with SF. When connecting with SF, you can choose to use SF’s electronic face list service or express 100api’s electronic face list service.

Express 100api provides electronic face list interface for Independent E-commerce, warehousing, logistics and other system platforms. Customers select express companies on express 100api network and deliver goods online. For official technical documentation, please visit:https://api.kuaidi100.com/document/5eb9f5b686b0df41883139f4.html

Convenient for developers to realize: after the operation front-end places an order and sends a piece, it automatically generates an electronic face list, shipping note and marketing materials – > the warehouse personnel automatically obtains the electronic face list, shipping note and marketing materials generated by the operation and completes the packaging.

Language: Java

API product introduction of electronic face sheet

The electronic face list API supports face list printing at outlets of 45 + express companies, face list printing on mainstream e-commerce platforms (Taobao, JD, pinduoduo) and face list printing by international express companies. Check the specific listParameter dictionary

/**
     *Electronic single picture interface
     */
     
    @Test
    public void testPrintImg() throws Exception{
        PrintImgParam printImgParam = new PrintImgParam();
        printImgParam.setKuaidicom(CompanyConstant.ZJS);
        Printimgparam.setsendmaname ("Zhang San");
        printImgParam.setSendManMobile("15999566666");
        Printimgparam.setsendmanprintaddr ("Keji South 12th Road, Nanshan District, Shenzhen City, Guangdong Province");
        Printimgparam.setrecmanname ("Li Si");
        printImgParam.setRecManMobile("15999566666");
        Printimgparam.setrecmanprintaddr ("XXX Road, Haidian District, Beijing");
        printImgParam.setType("10");
        printImgParam.setTempid("180c7c8f646742ca871a92c976392b05");
        printImgParam.setCount("1");

        String param = new Gson().toJson(printImgParam);
        String t = System.currentTimeMillis() + "";
        String sign = SignUtils.printSign(param,t,key,secret);

        PrintReq printReq = new PrintReq();
        printReq.setKey(key);
        printReq.setMethod(ApiInfoConstant.ELECTRONIC_ORDER_PIC_METHOD);
        printReq.setSign(sign);
        printReq.setParam(param);
        printReq.setT(t);

        IBaseClient printImg = new PrintImg();
        System.out.println(printImg.execute(printReq));
    }
/**
     *Electronic face sheet HTML interface
     */
    
    @Test
    public void testPrintHtml() throws Exception{
        ManInfo recManInfo  = new ManInfo();
        Recmaninfo.setname ("Zhang San");
        recManInfo.setMobile("15999566666");
        Recmaninfo.setprintaddr ("Keji South 12th Road, Nanshan District, Shenzhen City, Guangdong Province");

        ManInfo sendManInfo = new ManInfo();
        Sendmaninfo.setname ("Li Si");
        sendManInfo.setMobile("15999566666");
        Sendmaninfo.setprintaddr ("XXX Road, Haidian District, Beijing");

        PrintHtmlParam printHtmlParam = new PrintHtmlParam();
        printHtmlParam.setKuaidicom(CompanyConstant.ZJS);
        printHtmlParam.setCount(2);
        printHtmlParam.setNeedChild(1);
        //If you need to return the electronic face sheet, you need to set it
        printHtmlParam.setNeedTemplate("1");
        printHtmlParam.setSendMan(sendManInfo);
        printHtmlParam.setRecMan(recManInfo);

        String t = System.currentTimeMillis() + "";
        String param = new Gson().toJson(printHtmlParam);
        String sign = SignUtils.printSign(param,t,key,secret);

        PrintReq printReq = new PrintReq();
        printReq.setKey(key);
        printReq.setMethod(ApiInfoConstant.ELECTRONIC_ORDER_HTML_METHOD);
        printReq.setT(t);
        printReq.setSign(sign);
        printReq.setParam(param);

        IBaseClient printHtml = new PrintHtml();
        System.out.println(printHtml.execute(printReq));
    }
/**
     *Electronic sheet printing
     */
     
    @Test
    public void testPrintCloud() throws Exception{
        ManInfo recManInfo  = new ManInfo();
        Recmaninfo.setname ("Zhang San");
        recManInfo.setMobile("15999566666");
        Recmaninfo.setprintaddr ("Keji South 12th Road, Nanshan District, Shenzhen City, Guangdong Province");

        ManInfo sendManInfo = new ManInfo();
        Sendmaninfo.setname ("Li Si");
        sendManInfo.setMobile("15999566666");
        Sendmaninfo.setprintaddr ("XXX Road, Haidian District, Beijing");

        PrintCloudParam printCloudParam = new PrintCloudParam();
        printCloudParam.setKuaidicom(CompanyConstant.ZJS);
        printCloudParam.setCount("1");
        printCloudParam.setSiid(siid);
        printCloudParam.setTempid("180c7c8f646742ca871a92c976392b05");
        printCloudParam.setSendMan(sendManInfo);
        printCloudParam.setRecMan(recManInfo);

        String param = new Gson().toJson(printCloudParam);
        String t = System.currentTimeMillis() + "";

        PrintReq printReq = new PrintReq();
        printReq.setT(t);
        printReq.setKey(key);
        printReq.setMethod(ApiInfoConstant.ELECTRONIC_ORDER_PRINT_METHOD);
        printReq.setSign(SignUtils.printSign(param,t,key,secret));
        printReq.setParam(param);

        IBaseClient baseClient = new PrintCloud();
        System.out.println(baseClient.execute(printReq));
    }
/**
     *Cloud Print customization
     */
    
    @Test
    public void testCloudCustom() throws Exception{
        CloudPrintCustomParam cloudPrintCustomParam = new CloudPrintCustomParam();
        cloudPrintCustomParam.setSiid(siid);
        cloudPrintCustomParam.setCallBackUrl("https://www.baidu.com");
        cloudPrintCustomParam.setTempid("180c7c8f646742ca871a92c976392b05");

        String t = System.currentTimeMillis() + "";
        String param = new Gson().toJson(cloudPrintCustomParam);

        PrintReq printReq = new PrintReq();
        printReq.setKey(key);
        printReq.setMethod(ApiInfoConstant.CLOUD_PRINT_CUSTOM_METHOD);
        printReq.setT(t);
        printReq.setSign(SignUtils.printSign(param,t,key,secret));
        printReq.setParam(param);

        IBaseClient baseClient = new CloudPrintCustom();
        System.out.println(baseClient.execute(printReq));
    }
/**
     *Cloud Print attachment
     */
    
    @Test
    public void testCloudAttachment() throws Exception{
        CloudPrintAttachmentParam cloudPrintAttachmentParam = new CloudPrintAttachmentParam();
        cloudPrintAttachmentParam.setSiid(siid);
        cloudPrintAttachmentParam.setCallBackUrl("https://www.baidu.com");

        String t = System.currentTimeMillis() + "";
        String param = new Gson().toJson(cloudPrintAttachmentParam);
        CloudAttachmentReq cloudPrintAttachmentReq = new CloudAttachmentReq();

        cloudPrintAttachmentReq.setKey(key);
        cloudPrintAttachmentReq.setMethod(ApiInfoConstant.CLOUD_PRINT_ATTACHMENT_METHOD);
        cloudPrintAttachmentReq.setT(t);
        cloudPrintAttachmentReq.setSign(SignUtils.printSign(param,t,key,secret));
        cloudPrintAttachmentReq.setParam(param);
        cloudPrintAttachmentReq.setFile(new File("C:\\Users\\Administrator.-20171106WFEKLN\\Desktop\.jpg"));

        IBaseClient baseClient = new CloudPrintAttachment();
        System.out.println(baseClient.execute(cloudPrintAttachmentReq));
    }
/**
     *Replay
     */

    @Test
    public void testCloudPrintOld() throws Exception{
        PrintReq printReq = new PrintReq();
        CloudPrintOldParam cloudPrintOldParam = new CloudPrintOldParam();
        cloudPrintOldParam.setTaskId("D21DB1AC74A260E6F5604FC43B4598B8");

        String t = System.currentTimeMillis() + "";
        String param = new Gson().toJson(cloudPrintOldParam);

        printReq.setKey(key);
        printReq.setMethod(ApiInfoConstant.CLOUD_PRINT_OLD_METHOD);
        printReq.setT(t);
        printReq.setSign(SignUtils.printSign(param,t,key,secret));
        printReq.setParam(param);

        IBaseClient cloudPrintOld = new CloudPrintOld();
        System.out.println(cloudPrintOld.execute(printReq));
    }
/**
     *Send SMS
     */
       
    @Test
    public void testSendSms() throws Exception{
        SendSmsReq sendSmsReq = new SendSmsReq();
        sendSmsReq.setCallback("http://www.baidu.com");
        Map<String,String> content = new HashMap<String, String>();
        Content.put ("username", "test user");
        sendSmsReq.setContent(new Gson().toJson(content));
        sendSmsReq.setPhone("15994708912");
        Sendsmsreq.setseller ("your company name");
        sendSmsReq.setUserid(userid);
        sendSmsReq.setTid(tid);
        sendSmsReq.setSign(SignUtils.smsSign(key,userid));

        IBaseClient sendSms = new SendSms();
        System.out.println(sendSms.execute(sendSmsReq));
    }

Official technical support:https://api.kuaidi100.com/document/5eb9f5b686b0df41883139f4.html