Disconnecting Agent

You can forcibly disconnect the specified Agent.

Agent that can be disconnected is Ver.1.2.0 or higher.

Note

Note that the file transfer ends abnormally if Agent is disconnected during the file transfer.

Request Interface

HTTP Request

POST /agent/disconnection

Parameter

Request Parameter

Value

Required

Description

Default Value

sessionId

string

true

Session ID between Agent and HULFT-WebConnect

 

endpoint

string

true

Access point of HULFT-WebConnect that Agent currently connecting to

 

Authorization

In the API Key Management screen in Management Console, 'Agent' under the 'Scopes' field must be selected as 'Disconnect'.

Response Interface

If the request is processed successfully, the response body is not returned.

Examples

public static void main(String[] args) {
    String host = "https://www.webconnect.hulft.com";
    String apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    try {
        URL url = new URL(host + "/api/v2/agent/disconnection");
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        String postData = "{\"sessionId\":\"xxxxxxxxxxxxxxxx\", \"endpoint\":\"california-service1.webconnect.hulft.com\"}";

        connection.setRequestMethod("POST");
        connection.setDoOutput(true);
        connection.setRequestProperty("Authorization", "Bearer " + apiKey);
        connection.setRequestProperty("Content-Type", "application/json");
        connection.setRequestProperty("Content-Length", Integer.toString(postData.length()));
        try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()))) {
            writer.write(postData);
        }
        System.out.println(connection.getResponseMessage()); // The response does not contain the response body.
    } catch (IOException ex) {
        // error
    }
}

// load jquery 
var host = 'https://www.webconnect.hulft.com';
var apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
$.ajax({
  type: 'POST',
  url: host + '/api/v2/agent/disconnection',
  headers: {
    Authorization: 'Bearer ' + apiKey
  },
  contentType: 'application/json',
  data: JSON.stringify({sessionId: 'xxxxxxxxxxxxxxxx', endpoint: 'california-service1.webconnect.hulft.com'})
}).done(function(data, status, xhr) {
  console.log(data);
}).fail(function(data, status, xhr) {
  console.log(data);
});