속성 생성
/crm-core/v1/properties개체에 새 속성(Property)을 추가합니다. 속성은 레코드의 데이터 필드를 정의하며, 타입별로 저장되는 값의 형식과 UI 입력기가 달라집니다. OWNER 전용 권한이 필요합니다.
Body Params
Response
Structure
코드 예제
const crypto = require('crypto');
const apiKey = 'NCSXXXXXXXXXXXXX';
const apiSecret = 'YOUR_API_SECRET';
const dateTime = new Date().toISOString();
const salt = crypto.randomBytes(16).toString('hex');
const signature = crypto.createHmac('sha256', apiSecret).update(dateTime + salt).digest('hex');
const authHeader = HMAC-SHA256 apiKey=${apiKey}, date=${dateTime}, salt=${salt}, signature=${signature};
const response = await fetch('https://api.solapi.com/crm-core/v1/properties', {
method: 'POST',
headers: { 'Authorization': authHeader, 'Content-Type': 'application/json' },
body: JSON.stringify({
"entityId": "CRMET1260423081530123XYZ11122233",
"name": "계약 상태",
"fieldType": "DROPDOWN",
"options": [
{
"label": "진행 중",
"value": "IN_PROGRESS",
"priority": 1
},
{
"label": "계약완료",
"value": "CLOSED_WON",
"priority": 2
}
]
})
});
const data = await response.json();
import hmac, hashlib, secrets, requests
from datetime import datetime, timezone
api_key = 'NCSXXXXXXXXXXXXX'
api_secret = 'YOUR_API_SECRET'
date_time = datetime.now(timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ')
salt = secrets.token_hex(16)
signature = hmac.new(api_secret.encode(), (date_time + salt).encode(), hashlib.sha256).hexdigest()
auth_header = f'HMAC-SHA256 apiKey={api_key}, date={date_time}, salt={salt}, signature={signature}'
response = requests.post('https://api.solapi.com/crm-core/v1/properties', headers={
'Authorization': auth_header,
'Content-Type': 'application/json'
}, json={
"entityId": "CRMET1260423081530123XYZ11122233",
"name": "계약 상태",
"fieldType": "DROPDOWN",
"options": [
{
"label": "진행 중",
"value": "IN_PROGRESS",
"priority": 1
},
{
"label": "계약완료",
"value": "CLOSED_WON",
"priority": 2
}
]
})
data = response.json()
API_KEY="NCSXXXXXXXXXXXXX"
API_SECRET="YOUR_API_SECRET"
DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
SALT=$(openssl rand -hex 16)
SIGNATURE=$(echo -n "${DATE}${SALT}" | openssl dgst -sha256 -hmac "${API_SECRET}" | awk '{print $NF}')
AUTH="HMAC-SHA256 apiKey=${API_KEY}, date=${DATE}, salt=${SALT}, signature=${SIGNATURE}"
curl -X POST 'https://api.solapi.com/crm-core/v1/properties' \
-H "Authorization: ${AUTH}" \
-H "Content-Type: application/json" \
-d '{"entityId": "CRMET1260423081530123XYZ11122233", "name": "계약 상태", "fieldType": "DROPDOWN", "options": [{"label": "진행 중", "value": "IN_PROGRESS", "priority": 1}, {"label": "계약완료", "value": "CLOSED_WON", "priority": 2}]}'
선택 옵션이 있는 필드 유형(DROPDOWN / RADIO / MULTI_CHECKBOX)은 반드시 `options` 배열을 함께 전달하세요. `isMasked: true`는 전화번호·이메일 등 개인정보 필드에 사용하며, 목록 뷰에서 값이 마스킹돼 표시됩니다.
`key`는 선택 입력이지만 설정하면 SDK 레코드 생성 등에서 속성 ID 대신 사용 가능한 영문 식별자가 됩니다. 같은 개체 내에서 유일해야 합니다.
**401 응답**: `{ "errorCode": "Unauthorized", "errorMessage": "권한이 없습니다." }`