POST/directory/users/custom-properties

ユーザーカスタムプロパティを登録する。 ドメイン単位で最大 50 個まで登録できる。

Authorization

oauth2

Access Token を指定します。
指定の方法や Access Token の取得方法は 共通仕様 を参照してください。

Scope

directory

HTTP Request

POSThttps://www.worksapis.com/v1.0/directory/users/custom-properties

Header Parameters

HeadertypeDescription
Authorization string 

Bearer {token}


required 
Content-Type string 

application/json


required
example : application/json 

Request Body

PropertyTypeDescription
domainId integer 

ドメイン ID


required
format : int32 
propertyName string 

ユーザーカスタムプロパティ名
ドメイン内で一意
英数字とアンダーバー (_) のみ使用可能
英字またはアンダーバー (_) で始める


required
maxLength : 120 
displayName string 

ユーザーカスタムプロパティの表示名
ドメイン内で一意


required
maxLength : 20 
i18nDisplayNames array (I18nDisplayName) 

ユーザーカスタムプロパティの表示名の多言語リスト


minItems : 0 
propertyType string 

ユーザーカスタムプロパティタイプ

  • STRING: テキスト
  • LINK: リンク
  • INTEGER: 数値
  • DATE: 日付

required
Allowed values : STRING, LINK, INTEGER, DATE 
displayOrder integer 

表示順位 (重複許可)
値を指定しない (NULL) 場合、最後尾に指定される。


minimum : 1
format : int32
nullable : true 
multiValued boolean 

複数値の許可
同一のユーザーカスタムプロパティに複数の値を登録できる


default : false 
options array (UserCustomPropertyOption) 

選択肢リスト
propertyType が STRING の場合に指定できる


minItems : 2 
mandatory boolean 

必須項目


default : false 
readAccessType string 

読み取り権限


default : ALL
Allowed values : ADMIN_AND_SELF, ALL 
writeAccessType string 

書き込み権限


default : ADMIN
Allowed values : ADMIN, ADMIN_AND_SELF 

I18nDisplayName

PropertyTypeDescription
language string 

多言語コード


Allowed values : ja_JP, ko_KR, zh_CN, zh_TW, en_US 
name string 

表示名


maxLength : 20 

UserCustomPropertyOption

PropertyTypeDescription
optionName string 

選択肢名
英数字とアンダーバー (_) のみ使用可能


maxLength : 100 
displayName string 

選択肢表示名


maxLength : 20 
i18nDisplayNames array (I18nDisplayName) 

選択肢表示名の多言語リスト


minItems : 0 

Request Example

example

1{2  "domainId": 10000001,3  "propertyName": "string_single_option",4  "displayName": "趣味",5  "i18nDisplayNames": [6    {7      "language": "ja_JP",8      "name": "趣味"9    },10    {11      "language": "en_US",12      "name": "hobby"13    }14  ],15  "propertyType": "STRING",16  "displayOrder": 1,17  "multiValued": false,18  "options": [19    {20      "optionName": "option_piano",21      "displayName": "ピアノ"22    },23    {24      "optionName": "option_cooking",25      "displayName": "料理"26    }27  ],28  "mandatory": false,29  "readAccessType": "ALL",30  "writeAccessType": "ADMIN_AND_SELF"31}

Response

HTTP 201

OK

PropertyTypeDescription
domainId integer 

ドメイン ID


required
format : int32 
customPropertyId string 

ユーザーカスタムプロパティ ID

  • ユーザーカスタムプロパティのリソース ID
  • 登録時に自動発行されるユニーク ID

readOnly : true 
propertyName string 

ユーザーカスタムプロパティ名
ドメイン内で一意
英数字とアンダーバー (_) のみ使用可能
英字またはアンダーバー (_) で始める


required
maxLength : 120 
displayName string 

ユーザーカスタムプロパティの表示名
ドメイン内で一意


required
maxLength : 20 
i18nDisplayNames array (I18nDisplayName) 

ユーザーカスタムプロパティの表示名の多言語リスト


minItems : 0 
propertyType string 

ユーザーカスタムプロパティタイプ

  • STRING: テキスト
  • LINK: リンク
  • INTEGER: 数値
  • DATE: 日付

required
Allowed values : STRING, LINK, INTEGER, DATE 
displayOrder integer 

表示順位 (重複許可)
値を指定しない (NULL) 場合、最後尾に指定される


required
minimum : 1
format : int32
nullable : true 
multiValued boolean 

複数値の許可
同一のユーザーカスタムプロパティに複数の値を登録できる


required
default : false 
options array (UserCustomPropertyOption) 

選択肢リスト
propertyType が STRING の場合に指定できる


minItems : 2 
mandatory boolean 

必須項目


required
default : false 
readAccessType string 

読み取り権限


required
default : ALL
Allowed values : ADMIN_AND_SELF, ALL 
writeAccessType string 

書き込み権限


required
default : ADMIN
Allowed values : ADMIN, ADMIN_AND_SELF 

I18nDisplayName

PropertyTypeDescription
language string 

多言語コード


Allowed values : ja_JP, ko_KR, zh_CN, zh_TW, en_US 
name string 

表示名


maxLength : 20 

UserCustomPropertyOption

PropertyTypeDescription
optionName string 

選択肢名
英数字とアンダーバー (_) のみ使用可能


maxLength : 100 
displayName string 

選択肢表示名


maxLength : 20 
i18nDisplayNames array (I18nDisplayName) 

選択肢表示名の多言語リスト


minItems : 0 

Response Example

example

1{2  "domainId": 10000001,3  "customPropertyId": "customfd-fc09-4a57-ab38-03dc6c425e01",4  "propertyName": "string_single_option",5  "displayName": "趣味",6  "i18nDisplayNames": [7    {8      "language": "ja_JP",9      "name": "趣味"10    },11    {12      "language": "en_US",13      "name": "hobby"14    }15  ],16  "propertyType": "STRING",17  "displayOrder": 1,18  "multiValued": false,19  "options": [20    {21      "optionName": "option_piano",22      "displayName": "ピアノ"23    },24    {25      "optionName": "option_cooking",26      "displayName": "料理"27    }28  ],29  "mandatory": false,30  "readAccessType": "ALL",31  "writeAccessType": "ADMIN_AND_SELF"32}

HTTP 400

Bad Request