転送方向を指定して取得
転送方向を指定して Agent 接続状況を取得します。
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 |
Site API 共通のリクエストパラメータについては、「共通パラメータ」を参照してください。
Authorization
Management Console の [API キー管理] 画面の「スコープ」で、「接続 Agent」の「取得」を選択する必要があります。
Response Interface
リクエストが正常に処理された場合、以下の JSON フォーマットでレスポンスを返却します。
{ "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); });