Skip to content

MDSEC User REST API

Published: 2024-05-15

Create, update, or delete a user in MDSEC.

For an update, any property that is omitted from the request body is left unchanged.

POST /mdsec/user

Preconditions

QTMHHTTP must be authorized in MDSEC to run command MDUPDUSR.

JSON payloads

All MDCMS REST API request and response bodies use JSON. Send Content-Type: application/json.

Authorization

Header Type Required Description
Authorization string Yes Bearer token for the MDSEC user. See Authenticate requests to the MDCMS REST API server.
Content-Type string Yes application/json

A missing or invalid token returns HTTP 401 Unauthorized.

Request body

Schema

Property Type Required Description
user string Yes User ID to register in MDSEC.
opt string No Create, update, or delete action. See Operation.
desc string No Description of the user.
addr string No Email address of the user.
extu string No External user ID, if mapping from LDAP for MDWorkflow.
act string No Whether the user is activated in MDSEC. See Activation.
grpa string No Whether authority for the user is based on the primary group the user belongs to. See Group authority.
ccsid string No CCSID to use for the user instead of the CCSID defined for the MDCMS instance. Used for character translation between the MDCMS database and MDOpen/MDWorkflow. Not all values are accepted in MDSEC — list the permitted values from MDCMS system settings first.
addroles array of string No Up to 20 MDSEC authority roles to apply to the user.
rmvroles array of string No Up to 20 MDSEC authority roles to revoke for the user.

Operation

Value Description
*UPDADD If the user already exists in MDSEC, update it with the provided information. Otherwise add the user.
*ADD Add the provided information only if the user is not already defined in MDSEC.
*REMOVE Remove the user from MDSEC.

Activation

Value Description
*NO Set the user to deactivated in MDSEC.
*YES Set the user to activated in MDSEC.

Group authority

Value Description
*NO The user's authority is based solely on the authority permitted for the user.
*YES The user's authority is based solely on the authority permitted for the primary group the user belongs to in MDSEC.
*BOTH The user's authority is based on the combination of the authority for the group and the specific user.

Example

Update a user, add roles, and revoke a role. Replace {endpoint} with the URL endpoint defined for the MDCMS HTTP server.

{
  "user": "SOMEUSER",
  "desc": "some user to be registered in MDSEC",
  "addr": "someuser@mdcms.ch",
  "ccsid": "37",
  "addroles": ["MD_ADMCMS", "MD_RFP_SBM"],
  "rmvroles": ["MD_PGMR"]
}
curl -X POST "https://{endpoint}/mdsec/user" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{"user":"SOMEUSER","desc":"some user to be registered in MDSEC","addr":"someuser@mdcms.ch","ccsid":"37","addroles":["MD_ADMCMS","MD_RFP_SBM"],"rmvroles":["MD_PGMR"]}'
POST /mdsec/user HTTP/1.1
Host: {endpoint}
Authorization: Bearer {token}
Content-Type: application/json

{
  "user": "SOMEUSER",
  "desc": "some user to be registered in MDSEC",
  "addr": "someuser@mdcms.ch",
  "ccsid": "37",
  "addroles": ["MD_ADMCMS", "MD_RFP_SBM"],
  "rmvroles": ["MD_PGMR"]
}

Response body

Schema

Property Type Description
msg string Description of the result of the attempt to create, update, or delete the user.
sev string Result severity. See Severity.

Severity

Value Meaning
10 Success
20 Warning
30 Error

Example

{
  "msg": "User updated",
  "sev": "10"
}
Resource Description
Authenticate requests to the MDCMS REST API server Create and use API tokens