Updating Information
You can update an account. If you update an email address, the corresponding password is also reset.
Request Interface
HTTP Request
PUT /accounts/definition/{accountId}
Parameter
Path Parameter |
Value |
Required |
Description |
Default Value |
---|---|---|---|---|
accountId |
string |
true |
ID of the account to updat (32 alphanumeric character) |
- |
Request Parameter |
Value |
Required |
Description |
Default Value |
---|---|---|---|---|
mailAddress |
string |
false |
It must be unique within the HULFT-WebConnect service. It is also used to identify the account. (String of 256 characters in email address forma) |
No update |
passwordValidityPeriod |
string |
false |
Password validity period. The unit is days. If 0 is specified, there is no expiration dat (0, or from 30 to 365) |
No update |
ipFilterGroupName |
string |
false |
IP filter group name that is used to restrict access based on source IP address. If you specify an empty string, the setting of the item is cleared.(String of 1 to 32 alphabet characters, "." (dots), and "-" (hyphens), or an empty string ("")) |
No update |
memo |
string |
false |
Note for the account.(String within 256 characte) |
No update |
Response Interface
If the request is processed successfully, the following response is returned in JSON format.
{ "id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "mailAddress": "sample@example.com", "statusCode": 0, "isVerifiedMailAddress": true, "passwordValidityPeriod": 0, "ipFilterGroupName": null, "memo": "xxxxxxxxxxxxxxxxxxxxxx" }
Property Name |
Value |
Description |
---|---|---|
id |
string |
ID of the registered account. |
mailAddress |
string |
Email address. |
statusCode |
number |
Status code of the account. (0: New, 1: In use, 2: Changing password management method, 3: Changing email address) |
isVerifiedMailAddress |
boolean |
Whether the email address is verified or not. True if it is verified. |
passwordValidityPeriod |
number |
Password validity period. The unit isdays |
ipFilterGroupName | string | IP filter group name that is used to restrict access based on source IP address. |
memo | string | Note for the account. |
Examples
public static void main(String[] args) { String host = "https://www.webconnect.hulft.com"; String apiKey = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; String accountId = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"; try { URL url = new URL(host + "/api/v2/accounts/definition/" + accountId); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); String putData = "{\"mailAddress\": \"sample@example.com\"," + "\"passwordValidityPeriod\": 0," + "\"ipFilterGroupName\": \"ipFilterGroupName\"," + "\"memo\": \"memo\"}"; 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 accountId = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'; $.ajax({ type: 'PUT', url: host + '/api/v2/accounts/definition/' + accountId , headers: { Authorization: 'Bearer ' + apiKey }, contentType: 'application/json', data: JSON.stringify({ "mailAddress": "sample@example.com", "passwordValidityPeriod": 0, "ipFilterGroupName": "ipFilterGroupName", "memo": "memo" }) }).done(function(data, status, xhr) { console.log(data); }).fail(function(data, status, xhr) { console.log(data); });