Getting Status by Specifying Transfer Direction

You can get the Agent connection status by specifying the transfer direction.

Request Interface

HTTP Request

GET /agent/status/{direction}

Parameter

Path Parameter

Value

Required

Description

Default Value

direction

string

true

Transfer direction of Agent (send | receive)

Blank

For details on common request parameters for Site API, refer to Common Parameter.

Authorization

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

Response Interface

If the request is processed successfully, the following response is returned in JSON format.

{
    "totalSize":1,
    "fetchSize":1,
    "startIndex":0,
    "maxResults":30,
    "status":[
        {
            "agentId":"agent1",
            "direction":"receive",
            "connectionId":["id1","id22"],
            "endpoint":"california-service1.webconnect.hulft.com",
            "startConnection":"2016-06-30 14:22:00.942",
            "sessionId":"dfBqpCYBFcQZNRx9z6q_A6rQ0Yv7y3yZ3IJJf2aJ",
            "agentVersion":"2.0.0",
            "willBeClosed":false,
            "supportingDisconnectApi":true
        }
    ]
}

Property Name

Value

Description

totalSize

integer

The total number of data

fetchSize

integer

The number of the obtained data

startIndex

integer

Index of the first row of a data to retrieve

maxResults

integer

The maximum number of indexes included in a response data

status

array

Array of the elements described below

agentId

string

Agent ID of the connected Agent

direction

string

Transfer direction of Agent

connectionId

array

Connection ID to be used when Agent connects to HULFT-WebConnect

endpoint

string

Access point of HULFT-WebConnect that Agent currently connecting to

startConnection

string

The date and time at which Agent was connected

sessionId

string

Session ID between Agent and HULFT-WebConnect

agentVersion

string

Version of Agent

willBeClosed

boolean

Whether the disconnection request is received or not

supportingDisconnectApi

boolean

Whether the disconnection API is accepted or not

Examples

public static void main(String[] args) {
    String host = "https://www.webconnect.hulft.com";
    String apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    String direction = "receive";
    try {
        URL url = new URL(host + "/api/v2/agent/status/" + direction);
        HttpURLConnection connection = (HttpURLConnection) url.openConnection();
        connection.setRequestMethod("GET");
        connection.setRequestProperty("Authorization", "Bearer " + apiKey);
        try (BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()))) {
            String line;
            while((line = reader.readLine()) != null) {
                System.out.println(line);
            }
        }
    } catch (IOException ex) {
        // error
    }
}

// load jquery 
var host = 'https://www.webconnect.hulft.com';
var apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
var direction = 'receive';
$.ajax({
  type: 'GET',
  url: host + '/api/v2/agent/status/' + direction,
  headers: {
    Authorization: 'Bearer ' + apiKey
  }
}).done(function(data, status, xhr) {
  console.log(data);
}).fail(function(data, status, xhr) {
  console.log(data);
});