Registering Information
You can register new Relay Authorization Settings information.
Request Interface
HTTP Request
POST /relay/permission
Parameter
Request Parameter |
Value |
Required |
Description |
Default Value |
---|---|---|---|---|
connectionId |
string |
true |
Connection ID of the local machine registered in Connection Settings |
|
remoteConnectionId |
string |
true |
Connection ID of the remote machine for Relay Authorization Settings |
|
direction |
string |
true |
Transfer direction to enable the relay transfer (send | receive) |
|
enabled |
string |
false |
Whether to enable Relay Authorization Settings or not |
false |
memo |
string |
false |
Note for the settings |
Blank |
Authorization
In the API Key Management screen in Management Console, 'Relay Auth Settings' under the 'Scopes' field must be selected as 'Create'.
Response Interface
If the request is processed successfully, the following response is returned in JSON format.
Also, the URI of the registered resource is stored in the response header 'Location'.
{ "connectionId":"id1", "remoteConnectionId":"id2", "direction":"send", "enabled":"true", "memo":"memo1" }
Property Name |
Value |
Description |
---|---|---|
connectionId |
string |
Connection ID of the local machine registered in Connection Settings |
remoteConnectionId |
string |
Connection ID of the remote machine for Relay Authorization Settings |
direction |
string |
Transfer direction to enable the relay transfer |
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"; try { URL url = new URL(host + "/api/v2/relay/permission"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); String postData = "{\"connectionId\":\"xxxxxxxx\", \"remoteConnectionId\":\"xxxxxxxx\", \"direction\":\"send\", \"enabled\":\"true\", \"memo\":\"xxxxxxxxx\"}"; connection.setRequestMethod("POST"); connection.setDoOutput(true); connection.setDoInput(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); } 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'; $.ajax({ type: 'POST', url: host + '/api/v2/relay/permission', headers: { Authorization: 'Bearer ' + apiKey }, contentType: 'application/json', data: JSON.stringify({connectionId: 'xxxxxxxxx', remoteConnectionId: 'xxxxxxxx', direction: 'send', enabled: 'true', memo: 'xxxxxxx'}) }).done(function(data, status, xhr) { console.log(data); }).fail(function(data, status, xhr) { console.log(data); });