1 件取得

コネクション ID 、相手先コネクション ID および転送方向を指定して中継許可設定を 1 件取得します。

Request Interface

HTTP Request

GET /relay/permission/{connectionId}/{remoteConnectionId}/{direction}

Parameter

Path Parameter

Value

Required

Description

Default Value

connectionId

string

true

Connection ID

 

remoteConnectionId

string

true

Connection ID of the remote machine

 

direction

string

true

Transfer direction to enable the relay transfer (send | receive)

 

Authorization

Management Console の [API キー管理] 画面の「スコープ」で、「中継許可設定」の「取得」を選択する必要があります。

Response Interface

リクエストが正常に処理された場合、以下の JSON フォーマットでレスポンスを返却します。

{
    "totalSize":1,
    "fetchSize":1,
    "startIndex":0,
    "maxResults":30,
    "permission":[
        {
            "connectionId":"id1",
            "remoteConnectionId":"id2",
            "direction":"send",
            "enabled":"false",
            "memo":"memo1"
        }
    ]
}

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

permission

array

Array of the elements described below

connectionId

string

Connection ID

remoteConnectionId

string

Connection ID of the remote machine

direction

string

Transfer direction to enable the relay transfer

enabled

string

Whether Relay Authorization Settings are enabled or not

memo

string

Note for the settings

Examples

public static void main(String[] args) {
    String host = "https://www.webconnect.hulft.com";
    String apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
    String connectionId = "xxxxxxxx";
    String remoteConnectionId = "xxxxxxxx";
    String direction = "send";
    try {
        URL url = new URL(host + "/api/v2/relay/permission/" + connectionId + "/" + remoteConnectionId + "/" + 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 connectionId = 'xxxxxxxx';
var remoteConnectionId = 'xxxxxxxx';
var direction = 'send';
$.ajax({
  type: 'GET',
  url: host + '/api/v2/relay/permission/' + connectionId + '/' + remoteConnectionId + '/' + direction,
  headers: {
    Authorization: 'Bearer ' + apiKey
  }
}).done(function(data, status, xhr) {
  console.log(data);
}).fail(function(data, status, xhr) {
  console.log(data);
});