All Products
Search
Document Center

Direct Mail:Send data information

Last Updated:Sep 29, 2024

Obtain data sent under specified conditions

Email Tracking Obtains Sending Data under Specified Conditions

Obtains the data sent under specified conditions.

 public void testSenderStatisticsByTagNameAndBatchID() {
        IAcsClient client = IAcsClientUtil.getiAcsClient();
        SenderStatisticsByTagNameAndBatchIDRequest request = new SenderStatisticsByTagNameAndBatchIDRequest();
        try {
            request.setAccountName("test***@example.net");
            request.setTagName("testtag");
            request.setStartTime("2018-07-31");
            request.setEndTime("2018-08-05");
            SenderStatisticsByTagNameAndBatchIDResponse httpResponse = client.getAcsResponse(request);
            System.out.println("------testSenderStatisticsByTagNameAndBatchID------" + JSON.toJSONString(httpResponse));
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }

Recipient Tracking Obtains Sending Data under Specified Conditions

public void testGetTrackListByMailFromAndTagName() {
        //If you are not in the China (Hangzhou) region, replace cn-hangzhou in the following code with your region ID. For example, if you are in the Singapore (Singapore) region, specify ap-southeast-1. 
        IAcsClient client = IAcsClientUtil.getiAcsClient();
        GetTrackListByMailFromAndTagNameRequest request = new GetTrackListByMailFromAndTagNameRequest();
        try {
            request.setAccountName("test***@example.net");
            request.setTagName("testtag");
            request.setStartTime("2018-09-22");
            request.setEndTime("2018-10-03");
            GetTrackListByMailFromAndTagNameResponse httpResponse = client.getAcsResponse(request);
            System.out.println("------getTrackListByMailFromAndTagName------" + JSON.toJSONString(httpResponse));
        } catch (ServerException e) {
            e.printStackTrace();
        }
        catch (ClientException e) {
            e.printStackTrace();
        }
    }