Updating Information
You can update the specified Relay Authorization Settings information.
Request Interface
HTTP Request
PUT /relay/permission/{connectionId}/{remoteConnectionId}/{direction}
Parameter
Path Parameter |
Value |
Required |
Description |
Default Value |
---|---|---|---|---|
connectionId |
string |
true |
Connection ID of the local machine to be updated |
|
remoteConnectionId |
string |
true |
Connection ID of the remote machine to be updated |
|
direction |
string |
true |
Transfer direction to be updated |
|
Request Parameter |
Value |
Required |
Description |
Default Value |
---|---|---|---|---|
enabled |
string |
false |
Whether to enable Relay Authorization Settings or not |
No update |
memo |
string |
false |
Note for the settings |
No update |
Authorization
In the API Key Management screen in Management Console, 'Relay Auth Settings' under the 'Scopes' field must be selected as 'Update'.
Response Interface
If the request is processed successfully, the following response is returned in JSON format.
{ "connectionId":"id1", "remoteConnectionId":"id2", "direction":"send", "enabled":"true", "memo":"memo1" }
Property Name |
Value |
Description |
---|---|---|
connectionId |
string |
Connection ID of the local machine to be updated |
remoteConnectionId |
string |
Connection ID of the remote machine to be updated |
direction |
string |
Transfer direction to be updated |
enabled |
string |
Whether to enable Relay Authorization Settings 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(); String putData = "{\"enabled\":\"true\", \"memo\":\"xxxxxxxxx\"}"; connection.setRequestMethod("PUT"); connection.setDoOutput(true); connection.setDoInput(true); connection.setRequestProperty("Authorization", "Bearer " + apiKey); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Content-Length", Integer.toString(putData.length())); try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(connection.getOutputStream()))) { writer.write(putData); } 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: 'PUT', url: host + '/api/v2/relay/permission/' + connectionId + '/' + remoteConnectionId + '/' + direction, headers: { Authorization: 'Bearer ' + apiKey }, contentType: 'application/json', data: JSON.stringify({enabled: 'true', memo: 'xxxxxxx'}) }).done(function(data, status, xhr) { console.log(data); }).fail(function(data, status, xhr) { console.log(data); });