PostRecord

Prev Next
Post
/sys-rest-api/jersey/v2/user-extension

POST /v2/user-extension - Insert Record

Overview

This endpoint inserts a new row into any UE table. You pass the table code, the object key values that identify the parent record, and the UDF field values to write. The API validates the parent record exists, re-fetches the authoritative key values from the parent table, validates every UDF field, and then inserts the row. On success it returns the newly inserted row as re-queried from the database.

Property Value
URL {base_url}/sys-rest-api/jersey/v2/user-extension
Method POST
Consumes / Produces application/json
Success Status 201 Created
Auth Basic (Authorization: Basic {credentials})

Notes

Authentication and authorization are required.

tableCode must be present in the request body. If it is blank or missing the request is rejected immediately.

The data map must contain at least objectKey1. Additional object keys (objectKey2 through objectKey10) are required for composite-key tables.

The object key values you send are used only to locate the parent record. The values that actually get written into the UE row are re-fetched from the parent table using the resolved ORASEQ. This means the inserted row will always have the correct casing, padding, and formatting as stored in the parent — not whatever the caller typed.

Every UDF field value is validated and normalised before the insert runs. If any field fails validation (wrong LOV value, wrong case, unparseable date) the entire request is rejected and nothing is written.

dateFormat defaults to YYYY-MM-DD if not supplied. It controls how date field values in the data map are interpreted.

After a successful insert the row is re-queried from the physical UE table and returned in the response. If the re-query fails, the response falls back to the resolved input values — the row was still inserted and committed.


UI Navigation

User Extension tables are attached to the parent object's own screen in CMiC. There is no standalone navigation path. This endpoint is the API equivalent of filling in the UE fields on an object's record and saving.


Request Body

Field Type Required Description
tableCode String Yes UE table code to insert into (e.g. CIITEM_K).
dateFormat String No Oracle date mask for date fields in data. Defaults to YYYY-MM-DD.
data Map Yes Field code to value map. Must include objectKey1 (and additional keys for composite-key tables). All other entries are treated as UDF field codes.
data.objectKey1 String Yes First business key of the parent record (e.g. 01 for Company Code).
data.objectKey2 through objectKey10 String Depends Additional keys for composite-key objects.
data.{UDF_FIELD_CODE} String No UDF field value to insert (e.g. UDF_NOTES, UDF_RATING, UDF_REVIEW_DATE).

Attributes

Response — 201 Created

Field Type Description Example
status String Always success on 201 success
tableCode String UE table code that was inserted into CIITEM_K
rowsAffected Integer Number of rows inserted (normally 1) 1
message String Confirmation message Successfully inserted 1 row.
data Map The re-queried inserted row. Column names are prefixed with the table code. System columns excluded.
data.{TABLECODE}_COMP_CODE String Company Code as stored in the UE row 01
data.{TABLECODE}_ITEM_CODE String Item Code as stored in the UE row BOLT-123
data.{TABLECODE}_{UDF_FIELD} String Inserted UDF field value (normalised) A
data.UE__IU__CREATE_DATE String (ISO 8601) Row create timestamp 2026-06-30T10:30:00-04:00
data.UE__IU__UPDATE_DATE String (ISO 8601) Row update timestamp 2026-06-30T10:30:00-04:00

Example

Request

POST {base_url}/sys-rest-api/jersey/v2/user-extension
Content-Type: application/json
Authorization: Basic {credentials}
{
  "tableCode": "CIITEM_K",
  "dateFormat": "YYYY-MM-DD",
  "data": {
    "objectKey1":      "01",
    "objectKey2":      "BOLT-123",
    "UDF_NOTES":       "Approved by Engineering",
    "UDF_RATING":      "a",
    "UDF_REVIEW_DATE": "2026-06-30"
  }
}

Response — 201 Created

{
  "status": "success",
  "tableCode": "CIITEM_K",
  "rowsAffected": 1,
  "message": "Successfully inserted 1 row.",
  "data": {
    "CIITEM_K_COMP_CODE":       "01",
    "CIITEM_K_ITEM_CODE":       "BOLT-123",
    "CIITEM_K_UDF_NOTES":       "Approved by Engineering",
    "CIITEM_K_UDF_RATING":      "A",
    "CIITEM_K_UDF_REVIEW_DATE": "2026-06-30T00:00:00-04:00",
    "UE__IU__CREATE_DATE":      "2026-06-30T10:30:00-04:00",
    "UE__IU__UPDATE_DATE":      "2026-06-30T10:30:00-04:00"
  }
}

Note: UDF_RATING was sent as "a" but the field is configured with uppercase case flag, so the API normalised it to "A" before inserting.

Error — Parent Record Not Found (400)

{
  "error": "SD-000376-ERR: Master record does not exist for the given key values."
}


Error Codes

HTTP Error Code Reason
400 SD-000380-ERR Request body is null or empty
400 SD-000381-ERR Request body is not valid JSON
400 SD-000375-ERR tableCode is blank or missing
400 SD-000382-ERR data map is null or empty
400 SD-000376-ERR Table code invalid or parent record not found for the supplied keys
400 IllegalArgumentException No objectKey1 found in data; key mapping not found for the table; a UDF field does not exist; UDF field validation failed
500 — Unhandled database or server error — auto rollback
Security
HTTP
Type basic

Basic authentication

Body parameters
object
Example{ "tableCode": "CIITEM_K", "data": { "objectKey1": "ZZ", "objectKey2": "DIESEL", "NUMBEROKEY": "16.15", "AAA": "123" } }
Responses
201

Created

Headers
Content-Type
string
Exampleapplication/json
"{\n    \"status\": \"success\",\n    \"tableCode\": \"CIITEM_K\",\n    \"rowsAffected\": 1,\n    \"message\": \"Successfully inserted 1 row.\",\n    \"data\": {\n        \"COMP_CODE\": \"ZZ\",\n        \"ITEM_CODE\": \"DIESEL\",\n        \"NUMBEROKEY\": \"16.15\",\n        \"AAA\": \"123\",\n        \"UE__IU__CREATE_DATE\": \"2026-07-20T11:37:41-04:00\",\n        \"UE__IU__UPDATE_DATE\": null,\n        \"CLTEST\": null\n    }\n}"
string
Copyright © 2024 CMiC All Rights Reserved