更新

アカウント設定を更新します。メールアドレスが更新された場合はパスワードもリセットされます。

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

Description

mailAddress

string

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)

passwordValidityPeriod

string

Password validity period. The unit is days. If 0 is specified, there is no expiration dat (0, or from 30 to 365)

ipFilterGroupName

string

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 (""))

memo

string

Note for the account.(String within 256 characte)

Response Interface

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

{
	"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 accunt.

mailAddress

string

Email addres.

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);
  });