Updated on 2022-11-18 GMT+08:00

Exporting a User List

Function

Invoke the export and download interfaces in sequence to export the user list. The output of the export interface is the input of the download interface.

Example code

The following provides an example code of exporting a user list, which uses the main method of the ExportUsers class in the rest package.

    String operationName = "ExportUsers"; 
    String exportOperationUrl = webUrl + EXPORT_URL; 
    HttpManager httpManager = new HttpManager(); 
    //Invoke the export interface. 
    String responseLineContent = httpManager 
        .sendHttpPostRequestWithString(httpClient, exportOperationUrl, StringUtils.EMPTY, operationName); 
    //Invoke the download interface. 
    operationName = "DownloadUsers"; 
    JSONObject jsonObj = JSON.parseObject(responseLineContent); 
    String downloadOperationUrl = webUrl + DOWNLOAD_URL + jsonObj.getString("fileName"); 
    httpManager.sendHttpGetRequest(httpClient, downloadOperationUrl, operationName);