UMC ServiceLayerAPIDeveloperManual
UMC ServiceLayerAPIDeveloperManual
05/2019
A5E47537996-AA
Guidelines
This manual contains notes of varying importance that should be read with care; i.e.:
Important:
Highlights key information on handling the product, the product itself or to a particular part of the documentation.
Note: Provides supplementary information regarding handling the product, the product itself or a specific part of
the documentation.
Trademarks
The remaining trademarks in this publication may be trademarks whose use by third parties for their own purposes
could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Security information
Siemens provides products and solutions with industrial security functions that support the secure operation of
plants, systems, machines and networks. In order to protect plants, systems, machines and networks against
cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art industrial
security concept. Siemens’ products and solutions only form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems, machines and networks. Systems,
machines and components should only be connected to the enterprise network or the internet if and to the extent
necessary and with appropriate security measures (e.g. use of firewalls and network segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be taken into account. For more
information about industrial security, please visit http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure. Siemens strongly
recommends to apply product updates as soon as available and to always use the latest product versions. Use of
product versions that are no longer supported, and failure to apply latest updates may increase customer’s
exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed under http://www.
siemens.com/industrialsecurity.
4 Users ...................................................................................................................................... 12
4.1 Get All Users................................................................................................................... 12
4.2 Get User Details.............................................................................................................. 14
4.3 Create User..................................................................................................................... 19
4.4 Update User - Basic........................................................................................................ 21
4.5 Update User - Full........................................................................................................... 22
4.6 Unlock User .................................................................................................................... 24
4.7 Delete Users ................................................................................................................... 25
4.8 Browse AD Users............................................................................................................ 26
4.9 Import Users ................................................................................................................... 28
4.10 Reset Password............................................................................................................ 29
5 Groups ................................................................................................................................... 31
5.1 Get All Groups ................................................................................................................ 31
5.2 Get Group Details ........................................................................................................... 32
5.3 Create Group .................................................................................................................. 34
5.4 Update Group - Basic ..................................................................................................... 35
5.5 Update Group - Full ........................................................................................................ 37
5.6 Delete Groups................................................................................................................. 38
5.7 Browse AD Groups ......................................................................................................... 40
5.8 Import Groups from AD................................................................................................... 40
6 Roles ...................................................................................................................................... 42
6.1 Get All Roles ................................................................................................................... 42
6.2 Get Role Details.............................................................................................................. 44
6.3 Create Role..................................................................................................................... 44
6.4 Update Role .................................................................................................................... 45
6.5 Delete Roles ................................................................................................................... 47
User Management Component 2.7 - UMC Service Layer API Developer Manual
iii
A5E47537996-AA
1 What is UMC Service Layer?
UMC Service Layer (SL) is the UMC Open Development Kit (ODK) to develop an application that
needs to manage authentication, UMC users, groups and roles. Refer to the User Management
Component Installation Manual for more details on the UMC Service Layer configuration.
UMC SL is based on HTTP services that reach a broad range of clients, including browsers and mobile
devices. It can be used to develop Web pages and is also a powerful platform for exposing APIs
providing services and data. HTTP is simple, flexible and ubiquitous. Almost any platform that you can
think of has an HTTP library.
The data exchange is based on JSON format. Any call to the UMC SL include the requested "method"
in the uri or the HTTP request. The response format is composed of:
• authentication APIs;
• user management APIs;
• group management APIs.
Any request except the ones necessary to login, needs authorization. Authorization session is created
using one of the "authentication" methods and transmitted by the browser in the request header
(cookie authentication).
User Management Component 2.7 - UMC Service Layer API Developer Manual
4
A5E47537996-AA
2 Common Response Information
The answer for every response (except the service for WebSSO) has the following format.
Field Value
Content-Type application/json
version integer Protocol version. Consider that can vary depending on the API. See each API
section for the value.
operation string Represents the invoked operation. See each API section for the value.
result integer Returns the last error code (decimal format) returned by the UMC APIs invoked
during the command execution. See UMC APIs Error Codes for more details.
User Management Component 2.7 - UMC Service Layer API Developer Manual
5
A5E47537996-AA
3 Authentication
The following APIs are dedicated to authentication:
• Login
• Authentication from Claim
• Identity
3.1 Login
Performs user authentication providing a user name and password.
Example:
https://localhost/UMC/slwapi/login?user=myuser&password=mypsw
{"version" : 0 ,
"operation" : "loginresult",
"result" : 0}
User Management Component 2.7 - UMC Service Layer API Developer Manual
6
A5E47537996-AA
3 Authentication
3.1 Login
function CallLogin([string]$protocol,[string]$srv,[string]$user,[string]$pwd)
{
write-host "Call login to service layer"
write-host "Server:$srv"
write-host "user:$user"
$url = $protocol+"://"+$srv+"/UMC/slwapi/login"
$uri = New-Object "System.Uri" "$url"
$request = [System.Net.HttpWebRequest]::Create($uri)
$pair = "user=$user&password=$pwd"
$enc = [system.Text.Encoding]::UTF8
$data = $enc.GetBytes($pair)
$request.ContentType = "application/x-www-form-urlencoded"
$request.cookiecontainer = New-Object System.Net.CookieContainer
$request.Method = "POST"
$stream= $request.GetRequestStream()
$stream.Write($data,0,$data.Length)
$stream.Flush()
$stream.close()
$response = $request.GetResponse()
if ($response.StatusCode -eq "OK" )
{
$cookie = $response.Cookies[0]
$resstream= $response.GetResponseStream()
$streanreader = New-Object System.IO.StreamReader($resstream)
$logindata = $streanreader.ReadToEnd()
write-host $logindata
write-host $cookie
return $cookie
}
return $null
}
Input Parameters
Return Values
The function also writes the result JSON shown in the example.
User Management Component 2.7 - UMC Service Layer API Developer Manual
7
A5E47537996-AA
3 Authentication
3.2 Authentication from Claim
Request POST
HTTP Verb
Request application/x-www-form-urlencoded
Content-
Type
keyid string The identifier of the key used to sign the claim.
Example:
https://localhost/UMC/slwapi/pswclaimlogin?name=myuser&password=
mypsw&claim=myclaim&signature=mysignature&keyid=mykeyid
3.3 Identity
Provides information about the authenticated user.
{
"domaininfo":{
User Management Component 2.7 - UMC Service Layer API Developer Manual
8
A5E47537996-AA
3 Authentication
3.3 Identity
"domainid":"{{G3F6FEE1931D8D38EBC79793DFEDECD1132FFBECB",
"domainname":"umcdomain"
},
"domains_support":"",
"issuer":"https://vm-vdip13-26.swqa.tst/IPSimatic-Logon/",
"language":"en-US",
"result":0,
"rights":{
"can_modify":true,
"can_read":true,
"can_register":true,
"can_resetpwd":true,
"can_unlock":true,
"can_viewlog":true,
"is_admin":true
},
"session_id":"f75306a84fc4448a9747058d41252b42",
"user":{
"fullname":"myfullname",
"username":"myuser"
},
"validity":"2017-09-25T14:02:53.1557317Z",
"version":190
}
function CallLogin([string]$protocol,[string]$srv,[string]$user,[string]$pwd)
{
write-host "Call identity from service layer"
write-host "Server:$srv"
$url = $protocol+"://"+$srv+"/UMC/slwapi/identity"
$uri = New-Object "System.Uri" "$url"
$request = [System.Net.HttpWebRequest]::Create($uri)
$request.ContentType = "application/json"
$request.cookiecontainer = New-Object System.Net.CookieContainer
$request.Header.Add($cookie)
$request.Method = "POST"
$stream= $request.GetRequestStream()
$stream.Flush()
$stream.close()
$response = $request.GetResponse()
User Management Component 2.7 - UMC Service Layer API Developer Manual
9
A5E47537996-AA
3 Authentication
3.3 Identity
Properties
domains_support integer Yes when the provisioning service is configurator (on the machine which
exposes the identity service), otherwise no.
issuer string The address of the identity provider, which is configured on the machine
that exposes the identity .
language string It is the user language and has the format <langcode>-<countrycode>,
where
• langcode is the language code according to the ISO 639
standard; we accept both two-letter codes (ISO 639-1) and three-
letter codes (ISO 639-2);
• countrycode is the country code according to the ISO 3166
standard.
An example is en-GB.
Domaininfo Object
User Management Component 2.7 - UMC Service Layer API Developer Manual
10
A5E47537996-AA
3 Authentication
3.3 Identity
Rights Object
can_modify string If set to true the user can modify the umc configuration. If set to false the
user cannot make modifications.
can_read string If set to true the user can view the configuration. If set to false the user
cannot access the configuration.
can_register string If set to true the user can register a machine as a client. If set to false the
user cannot register a client.
can_resetpwd string If set to true the user can reset thier password. If set to false the user cannot
reset their password.
can_unlock string If set to true the user can unlock locked users. If set to false the user cannot
unlock locked users.
can_viewlog string If set to true the user can view the umc log. If set to false the user cannot
view the umc log.
is_admin string If set to true the user is a umc administrator. If set to false the user is not
configured as administrator.
User object
Return Values
The function also writes the result JSON shown in the example.
User Management Component 2.7 - UMC Service Layer API Developer Manual
11
A5E47537996-AA
4 Users
The following APIs are dedicated to user management:
{
"version":0,
"operation":"usersresult",
"result":0,
"users":
[
{"id": 2,"objver":1,"name":"root","fullname":"","comment":"","userflags":
8},
{"id": 1073741852, "objver":2,"name":"umdom1\\administrator",
"fullname":"Administrator","comment":"Built-in account for
administering the computer\/domain","userflags":24},
{"id": 29,"objver":1,"name":"Marco", "fullname": "Marco Rossi","comment":
"this user can change the password","userflags":10},
{"id": 30,"objver":2,"name":"Luca", "fullname": "Luca Bianchi",
"comment":"this user is locked", "userflags":12},
User Management Component 2.7 - UMC Service Layer API Developer Manual
12
A5E47537996-AA
4 Users
4.1 Get All Users
id integer User identifier, it is a 32 bit number greater than zero where the 31st bit is used
to store the information if the user is imported or not. If the 31st bit is equal to 1
the user is imported from Active Directory, 0 otherwise. The ID ranges are as
follows:
• 1-20: reserved for system users;
• 21- 1073741844: UMC users created from scratch;
• 1073741845 to 2147483647: Imported users.
User Management Component 2.7 - UMC Service Layer API Developer Manual
13
A5E47537996-AA
4 Users
4.2 Get User Details
userflags integer It is a 16 bit number bit mask representing the following flags, the order is from
the LSB (less significant bit) to the MSB (most significant bit) :
1. User Must Change Password: it is equal to 1 if the user must change
password, 0 otherwise.
2. User Can Change Password: it is equal to 1 if the user can change
password, 0 otherwise.
3. User Locked: it is equal to 1 if the user is locked, 0 otherwise.
4. User Enabled: it is equal to 1 if the user can authenticate into UMC, 0
otherwise.
5. User imported from AD: it is equal to 1 if the user has been imported
from Active Directory domain users, 0 otherwise.
6. User imported from Local: it is equal to 1 if the user has been imported
from Windows local users, 0 otherwise.
7. User imported from group: it is equal to 1 if the user has been imported
through imported Active Directory group, 0 otherwise.
8. User offline: it is equal to 1 if the user is offline, 0 otherwise. See Get
User Details for additional information.
9. Not used.
10. Not used.
11. Not used.
12. Not used.
13. Not used.
14. Not used.
15. Not used.
16. Not used.
User Management Component 2.7 - UMC Service Layer API Developer Manual
14
A5E47537996-AA
4 Users
4.2 Get User Details
"version": 140,
"operation": "usersresult",
"result": 0,
"users": {
"id": 25,
"objver":16,
"name": "mydomain\myName",
"fullname": "my fullname",
"comment": "",
"firstname": "myFirstname",
"lastname": "myLastname",
"initials": "MI",
"language": "IGNORE_CULT",
"datalanguage": "IGNORE_CULT",
"phone": "",
"mobile": "",
"email1": "",
"email2": "",
"email3": "",
"sid": "",
"expirationdate": "never expire",
"alertsbeforeexpirationdate": "no allert",
"passwordexpirationdays": "password never expire",
"alertbeforepasswordexpirationdays": "no allert",
"autologoff": "no autologoff",
"timebeforeautologoff": "no autologoff",
"imported": 1,
"enabled": 1,
"locked": 1,
"mustchange": 1,
"offline": 1,
"importedfromgroup": 0 ,
"importedfromad": 1 ,
"canchange": 1,
"attributes": [
{
"name": "attr_1",
"value": "val_1"
},
{
"name": "attr_2",
"value": "val_2"
}
],
"roles": [
{
"name": "role_1",
"id": 21,
"description": "role_1 "
},
{
User Management Component 2.7 - UMC Service Layer API Developer Manual
15
A5E47537996-AA
4 Users
4.2 Get User Details
"name": "role_2",
"id": 22,
"description": "role_2 "
},
{
"name": "role_3",
"id": 23,
"description": "role_3 "
}
],
"groups": [
{
"name": "group1",
"id": 1,
"imported": 1,
"objver":60,
"sid":"",
"description": "descr_1 "
},
{
"name": "group2",
"id": 2,
"imported": 1,
"objver":60,
"sid":"",
"description": "descr_2 "
}
]
}
}
users Object
User Management Component 2.7 - UMC Service Layer API Developer Manual
16
A5E47537996-AA
4 Users
4.2 Get User Details
User Management Component 2.7 - UMC Service Layer API Developer Manual
17
A5E47537996-AA
4 Users
4.2 Get User Details
User Management Component 2.7 - UMC Service Layer API Developer Manual
18
A5E47537996-AA
4 Users
4.3 Create User
User Management Component 2.7 - UMC Service Layer API Developer Manual
19
A5E47537996-AA
4 Users
4.3 Create User
It is optional. It is mandatory only if parameters in the query string are not present.
If the user is offline, the value of the offline property assumes the value true that corresponds to 1. If
the user is not offline, the offline property is not part of the JSON file. The meaning is the same as
described in Get User Details. Empty passwords are not allowed.
[{"name":"franz",
"password":"secret",
"fullname":"franz",
"canchange":true,
"mustchange":false,
"enabled":true,
"locked":false,
"offline":true}]
For the description of the single user properties see Get User Details.
{
"version": 0 ,
"operation" : "useraddresult",
"result" : 0, users: [{
"id" = 102, //present only in case of success
"result" = 0,
"name" = "franz",
"offline" = true,
"password" = "secret",
"fullname" = "franz",
"canchange" = true,
"mustchange" = false,
"enabled" = true,
"locked" = false}]
}
For the common properties see Common Response Information. For the description of the single user
properties see Get User Details. See above for the management of the offline property.
User Management Component 2.7 - UMC Service Layer API Developer Manual
20
A5E47537996-AA
4 Users
4.4 Update User - Basic
• fullname
• password (empty passwords are not allowed)
• enabled
• mustchange
• canchange
Note that the password specified for the user is not bound to password policies.
Parameters None.
[
{"id":10247,
"name":"myName",
"objver":19,
"fullname":"user new fullname",
"password":"secret",
"canchange":1,
"mustchange":0,
"enabled":1,
"locked":0}
]
For the description of the single user properties see Get User Details.
{ "version" : 0,
" operation" : "userupdateresult",
"result" : 0,
"users": [
User Management Component 2.7 - UMC Service Layer API Developer Manual
21
A5E47537996-AA
4 Users
4.5 Update User - Full
{"canchange": 1,
"enabled": 1,
"fullname": "user new fullname",
"id": 10247,
"locked":0,
"mustchange": 0,
"name": "myName",
"objver": 20,
"password": "secret",
"result":0}
]
}
For the common properties see Common Response Information. For the description of the single user
properties see Get User Details.
[
{
"id":5037,
"objver":2,
"name":"Alessio",
"fullname":"ROSSI ALESSIO",
"comment":"GOOD",
"initials":"AR",
"datalanguage":"en-GB",
"language":"en-GB",
"firstname":"Alessio",
"lastname":"Rossi",
"mobile":"",
User Management Component 2.7 - UMC Service Layer API Developer Manual
22
A5E47537996-AA
4 Users
4.5 Update User - Full
"phone":"",
"email1":"",
"email2":"",
"email3":"",
"enabled":1,
"locked":0,
"canchange":1,
"mustchange":0,
"alertbeforepasswordexpirationdays":"0",
"passwordexpirationdays":"0",
"override_lock_policy":0,
"alertsbeforeexpirationdate":"0",
"autologoff":"30",
"timebeforeautologoff":"3",
"expirationdate":"Sun, 29 Nov 2076 08:54:34 GMT",
"attributes":[
{ "name":"Address",
"value":"Trafalgar Square 1a" }
],
"groups": [ ],
"roles":[
{"name":"myrole",
"id":21,
"description":"myroledescription"}
]
}
]
For the description of the single user properties see Get User Details.
{
"version" : 0 ,
"operation" : "userupdateresult",
"result" : 0,
"users":[
{"alertbeforepasswordexpirationdays":"0",
"alertsbeforeexpirationdate":"0",
"attributes":
[ { "name":"Address",
"value":"Trafalgar Square 1a" }
],
"autologoff":"30",
"canchange":1,
User Management Component 2.7 - UMC Service Layer API Developer Manual
23
A5E47537996-AA
4 Users
4.6 Unlock User
"comment":"GOOD",
"datalanguage":"en-GB",
"email1":"",
"email2":"",
"email3":"",
"enabled":1,
"expirationdate":"Sun, 29 Nov 2076 08:54:34 GMT",
"firstname":"Alessio",
"fullname":"ROSSI ALESSIO",
"groups":[],
"id":5037,
"initials":"AR",
"language":"en-GB",
"lastname":"Rossi",
"locked":0,
"mobile":"+393211233210",
"mustchange":0,
"name":"Alessio",
"objver":3,
"override_lock_policy":0,
"password":null,
"passwordexpirationdays":"0",
"phone":"0101112223",
"result":0,
"roles":[
{"description":"myroledescription1",
"id":21,
"name":"myrole"}
],
"timebeforeautologoff":"3"}
]
}
For the common properties see Common Response Information. For the description of the single user
properties see Get User Details.
Parameters None.
User Management Component 2.7 - UMC Service Layer API Developer Manual
24
A5E47537996-AA
4 Users
4.7 Delete Users
{
name=newuser
}
For the description of the single user properties see Get User Details.
{
"version" : 0 ,
"operation" : "userunlockresult",
"result" : 0}
[
{"id":5034}
User Management Component 2.7 - UMC Service Layer API Developer Manual
25
A5E47537996-AA
4 Users
4.8 Browse AD Users
For the description of the single user properties see Get User Details.
{
"deleted":[{
"id":5034,
"result":0}],
"operation":"deleteresponse",
"result":0,
"version":0}
User Management Component 2.7 - UMC Service Layer API Developer Manual
26
A5E47537996-AA
4 Users
4.8 Browse AD Users
{
"version": 0,
"operation": "adusersresult",
"result": 0,
"users": [
{
"comment": "my comment 1",
"email1": "myUser1@myDomain.com",
"firstname": "Firstname1",
"fullname": "Fullname of user 1",
"lastname": "Lastname1",
"mobile": "",
"phone": "",
"sid": "S-1-5-21-1972147420-2157339849-452057256-3749",
"username": "domain\\USER1"
},
{
"comment": "my comment 2",
"email1": "myUser2@myDomain.com",
"firstname": "Firstname2",
"fullname": "Fullname of user 2",
"lastname": "Lastname2",
"mobile": "",
"phone": "",
"sid": "S-1-5-21-1972147420-2157339849-452057256-3753",
"username": "domain\\USER2"
},
{
"comment": "my comment 3",
"email1": "myUser3@myDomain.com",
"firstname": "Firstname3",
"fullname": "Fullname of user 3",
"lastname": "Lastname3",
"mobile": "",
"phone": "",
"sid": "S-1-5-21-1972147420-2157339849-452057256-4077",
"username": "domain\\USER3"
},
]
}
User Management Component 2.7 - UMC Service Layer API Developer Manual
27
A5E47537996-AA
4 Users
4.9 Import Users
In case of success an array of user objects, including the assigned identifiers, is returned. For the
common properties see Common Response Information. For the description of the single user
properties see Get User Details.
[{
"comment":"my comment",
"company":"my company",
"email1":"myMail@siemens.com",
"firstname":"username_first",
"fullname":"username_full",
"lastname":"username_last",
"localuser":true,
"mobile":"",
"phone":"",
"sid":"S-1-5-21-1972147420-2157339849-452057256-3753",
"username":"SWQA\\ITA00",
"selected":true,
"id":1
}]
[{
"comment":"my comment",
"company":"my company",
"email1":"myMail@siemens.com",
"firstname":"username_first",
"fullname":"username_full",
User Management Component 2.7 - UMC Service Layer API Developer Manual
28
A5E47537996-AA
4 Users
4.10 Reset Password
"lastname":"username_last",
"mobile":"",
"phone":"",
"sid":"S-1-5-21-1972147420-2157339849-452057256-3753",
"username":"SWQA\\ITA00",
"selected":true,
"id":1
}]
For the description of the single user properties see Get User Details.
{}
The user performing the action is represented by the input identity handle parameter and must have
the function right UM_ADMIN or both the function rights UM_VIEW and UM_RESETPSW. For a
detailed list of UM function rights, see the Appendix of User Management Component API SDK
Developer Manual.
[{"usertoreset" = "franz",
"pswtoreset" = "secret"}]
User Management Component 2.7 - UMC Service Layer API Developer Manual
29
A5E47537996-AA
4 Users
4.10 Reset Password
{
"version": 0 ,
"operation" : "pswresetresult",
"result" : 0
}
User Management Component 2.7 - UMC Service Layer API Developer Manual
30
A5E47537996-AA
5 Groups
The following APIs are dedicated to group management:
{
"version" : 140 ,
"operation" : "groupsresult",
"result" : 0,
"groups" : [{
"description":"mygroupdescription",
"id":628,
"imported":0,
"name":"mygroup",
"objver":0,
"offline":0,
"sid":""},
{
"description":"mygroupdescription1",
User Management Component 2.7 - UMC Service Layer API Developer Manual
31
A5E47537996-AA
5 Groups
5.2 Get Group Details
"id":629,
"imported":0,
"name":"mygroup1",
"objver":0,
"offline":1,
"sid":""}]
}
imported integer It is equal to 1 if the group is imported from Active Directory, 0 otherwise.
User Management Component 2.7 - UMC Service Layer API Developer Manual
32
A5E47537996-AA
5 Groups
5.2 Get Group Details
{
"version" : 0 ,
"operation" : "groupsresult",
"result" : 0,
"group" : {
"name":"mygroup",
"id" : 628,
"imported" : 0,
"offline" : 0,
"objver" : 1,
"description" : "mygroupnewdescription",
"lastsync" : 0,
"syncstatus" : "SYNC_NOSTATUS",
"sid" : "",
"roles":[{
"name":"myrole",
"id" : 21,
"description" : "myroledescription"
}],
"users":[]
}}
group Object
imported integer It is equal to 1 if the group is imported from Active Directory, 0 otherwise.
User Management Component 2.7 - UMC Service Layer API Developer Manual
33
A5E47537996-AA
5 Groups
5.3 Create Group
sid string Group Security Identifier (SID). See Microsoft Documentation on Security
Identifiers for more details
User Management Component 2.7 - UMC Service Layer API Developer Manual
34
A5E47537996-AA
5 Groups
5.4 Update Group - Basic
[
{"name":"mygroup",
"domain":"",
"description":"mygroupdescription",
"offline":true
}]
For the description of the single group properties see Get Group Details.
If the group is offline, the value of the offline property assumes the value true that corresponds to 1. If
the group is not offline, the offline property is not part of the JSON file. The meaning is the same as
described in Get Group Details.
{
"groups":[{
"description":"mygroupdescription",
"domain":"",
"id":628,
"name":"mygroup",
"result":0}],
"operation":"useraddgroup",
"offline":true,
"result":0,
"version":0}
For the common properties see Common Response Information. For the description of the single user
properties see Get Group Details. See above for the management of the offline property.
• name,
• domain,
User Management Component 2.7 - UMC Service Layer API Developer Manual
35
A5E47537996-AA
5 Groups
5.4 Update Group - Basic
• description.
[{
"id":628,
"name":"mygroup",
"domain":"UMC",
"description":"mygroupnewdescription"
}]
For the description of the single group properties see Get Group Details.
{
"groups":[{
"description":"mygroupnewdescription",
"domain":"UMC",
"id":628,
"name":"mygroup",
"objver":0,
"result":0}],
"operation":"userupdateinlinegroup",
"result":0,
"version":0}
In case of success the object is returned including the assigned id. For the common properties see
Common Response Information. For the description of the single group properties see Get Group
Details.
User Management Component 2.7 - UMC Service Layer API Developer Manual
36
A5E47537996-AA
5 Groups
5.5 Update Group - Full
[{
"name":"mygroup",
"id":628,
"imported":0,
"objver":1,
"offline":0,
"description":"mygroupnewdescription",
"lastsync":0,
"syncstatus":"SYNC_NOSTATUS",
"sid":"",
"roles":[{
"name":"myrole",
"id" : 21,
"description" : "myroledescription"
}],
"users":[{
"id":5034,
"name":"nuovo",
"fullname":"nuovo"}],
"rights":{
"can_modify":true,
"can_read":true,
"can_resetpwd":true,
"can_unlock":true,
"is_admin":true}
}]
For the description of the single user properties see Get Group Details.
User Management Component 2.7 - UMC Service Layer API Developer Manual
37
A5E47537996-AA
5 Groups
5.6 Delete Groups
{
"groups":[{
"description":"mygroupnewdescription",
"id":628,
"imported":0,
"lastsync":0,
"name":"mygroup",
"objver":1,
"offline":0,
"result":0,
"rights":{
"can_modify":true,
"can_read":true,
"can_resetpwd":true,
"can_unlock":true,
"is_admin":true},
"roles":[{
"description":"myroledescription",
"id":21,
"name":"myrole"
}]
"sid":"",
"syncstatus":"SYNC_NOSTATUS",
"users":[{
"fullname":"nuovo",
"id":5034,
"name":"nuovo"}]
}],
"operation":"userupdategroup",
"result":0,
"version":0}
For the common properties see Common Response Information. For the description of the single user
properties see Get Group Details.
User Management Component 2.7 - UMC Service Layer API Developer Manual
38
A5E47537996-AA
5 Groups
5.6 Delete Groups
[{
"id":628
}]
For the description of the single group properties see Get Group Details.
{
"groups":[{
"id":628,
"result":0}],
"operation":"deletegroupresponse",
"result":0,
"version":0}
In case of success the object is returned including the assigned id. For the common properties see
Common Response Information.
User Management Component 2.7 - UMC Service Layer API Developer Manual
39
A5E47537996-AA
5 Groups
5.7 Browse AD Groups
{
"version" : 0,
"operation" : "adgroupsresult",
"result" : 0,
"groups":[
{"description":"vdi_P13_UMC","domain":"MYDOMAIN","name":"vdi_P13_UMC",
"sid":"S-1-5-21-1972147420-2157339849-452057256-14151"},
{"description":"SWQA UMC","domain":"MYDOMAIN","name":"SWQA UMC","sid":
"S-1-5-21-1972147420-2157339849-452057256-13147"},
{"description":"SWQA UMC read","domain":"MYDOMAIN","name":"SWQA UMC
read","sid":"S-1-5-21-1972147420-2157339849-452057256-15002"}
]
}
In case of success an array of groups objects, including the assigned identifiers, is returned. For the
common properties see Common Response Information. For the description of the single user
properties see Get Group Details.
User Management Component 2.7 - UMC Service Layer API Developer Manual
40
A5E47537996-AA
5 Groups
5.8 Import Groups from AD
For the description of the single user properties see Get Group Details.
{"version" : 0,
"operation" : "groupimportresult",
"result" : 0,
"groups":[
{"description":"SWQA UMC read",
"domain":"SWQA",
"name":"SWQA UMC read",
"result":13,
"selected":true,
"sid":"S-1-5-21-1972147420-2157339849-452057256-15002"
}]}
JSON Description
For the common properties see Common Response Information. For the description of the single user
properties see Get Group Details.
User Management Component 2.7 - UMC Service Layer API Developer Manual
41
A5E47537996-AA
6 Roles
The following APIs are dedicated to role management:
{
"Version": 0,
"operation": "rolesresult",
"result": 0,
"roles":
[
{"id": 2,"name": "administrator","description": "","application":
"UMC","function_rights": "all" },
{"id": 21,"name": "Reader","description": "Only Read","application":
"UMC","function_rights": []}
{"id": 22,"name": "Writer","description": "Write","application": "UMC",
"function_rights":
[
{ "name":"UM_ADMIN", "id" : 10001, "description" : "Administer UM
Configuration" },
{ "name":"UM_VIEW", "id" : 10002, "description" : "View UM
Configuration" },
{ "name":"UM_RESETPWD", "id" : 10003, "description" : "Reset user
password" },
User Management Component 2.7 - UMC Service Layer API Developer Manual
42
A5E47537996-AA
6 Roles
6.1 Get All Roles
id integer Role identifier. 0 and negative IDs are not allowed. The ID ranges are as
follows:
• 1-20: reserved to system roles;
• 21-32600: UMC roles created from scratch.
function_rights function The set of function rights associated to the role. If the role has no
right associated function rights the value is [], if the role has all the associated
Array function rights the value is all, this is the case of the Administrator built-
in role. See below for the description of the function right object
properties.
User Management Component 2.7 - UMC Service Layer API Developer Manual
43
A5E47537996-AA
6 Roles
6.2 Get Role Details
{
"version" : 0 ,
"operation" : "roledetailresult",
"result" : 0,
"role" :
{
"name":"myrole",
"objver": 6,
"id" : 21,
"application" : "UMC",
"description" : "myroledescription1a",
"function_rights" : ["name":"UM_VIEW","id" : 10002,"description" :
"View UM Configuration"]
}
}
For the common properties see Common Response Information, whereas for the description of the
single role properties see Get All Roles.
User Management Component 2.7 - UMC Service Layer API Developer Manual
44
A5E47537996-AA
6 Roles
6.4 Update Role
Optional. It is mandatory only if parameters in the query string are not present.
[{"name":"myrolename",
"description":"myroledescr"}]
For the description of the single role properties see Get All Roles.
{
"operation":"addroleresult",
"roles":[{
"description":"myroledescr",
"id":21,
"name":"myrolename",
"result":0}],
"version":0
}
For the common properties see Common Response Information. For the description of the single user
properties see Get All Roles.
User Management Component 2.7 - UMC Service Layer API Developer Manual
45
A5E47537996-AA
6 Roles
6.4 Update Role
[{
"name":"myrole",
"objver":2,
"id":21,
"application":"UMC",
"description":"myroledescription1",
"function_rights":[{"name":"UM_ADMIN","id":10001,"description":"Administer
UM Configuration"}],
"rights":[{"name":"UM_ADMIN","id":10001,"description":"Administer UM
Configuration",own":true},
{"name":"UM_UNLOCKUSR","id":10005,"description":"Unlock User","own":
true}]
}]
For the description of the single role properties see Get All Roles.
{
"operation":"roleupdate",
"result":0,
"roles":[{
"application":"UMC",
"description":"myroledescription1",
"function_rights":[{"name":"UM_ADMIN","id":10001,"description":
"Administer UM Configuration"}],
"id":21,
"name":"myrole",
"objver":2,
"result":0,
"rights":[{
"description":"Administer UM Configuration",
"id":10001,
"name":"UM_ADMIN",
"own":true}
{
"name":"UM_UNLOCKUSR",
User Management Component 2.7 - UMC Service Layer API Developer Manual
46
A5E47537996-AA
6 Roles
6.5 Delete Roles
"id":10005,
"description":"Unlock User",
"own":true}
],
"version":0
}
For the common properties see Common Response Information. For the description of the single role
properties see Get All Roles.
[
{"id":22}
]
For the description of the single role properties see Get All Roles.
{
"operation":"roledelete",
User Management Component 2.7 - UMC Service Layer API Developer Manual
47
A5E47537996-AA
6 Roles
6.5 Delete Roles
"result":0,
"roles":[{
"id":22,
"result":0}],
"version":0
}
For the common properties see Common Response Information, for the description of the single role
properties see Get All Roles.
User Management Component 2.7 - UMC Service Layer API Developer Manual
48
A5E47537996-AA
7 UMC APIs Error Codes
All the UMC APIs return a boolean value or an object handle. If the API is successful, the returned
boolean value is true or the object handle is well formed; otherwise the returned boolean value is false,
or null is returned instead of the object handle. If the API fails an error code can be retrieved calling the
SL_GetLastError method. SL_RESULT defines the type of error. In what follows we list the possible
error codes.
Generic Errors
Authentication Errors
User Management Component 2.7 - UMC Service Layer API Developer Manual
49
A5E47537996-AA
7 UMC APIs Error Codes
6.5 Delete Roles
User Management Component 2.7 - UMC Service Layer API Developer Manual
50
A5E47537996-AA
7 UMC APIs Error Codes
6.5 Delete Roles
User Management Component 2.7 - UMC Service Layer API Developer Manual
51
A5E47537996-AA
7 UMC APIs Error Codes
6.5 Delete Roles
SL_INVALID_LOCK_OPTION 0x108 264 The lock option has not been defined.
SL_INVALID_PROPERTY 0x109 265 The property has not been defined for
the object.
File Errors
User Management Component 2.7 - UMC Service Layer API Developer Manual
52
A5E47537996-AA
7 UMC APIs Error Codes
6.5 Delete Roles
SL_RESOURCE_NOT_FOUND 0x150 336 The user does not have the correct
function right to perform the
requested operation. This error has
the same meaning as the
SL_MISSING_FUNCTION_RIGHT
error.
SL_MISSING_FUNCTION_RIGHT 0x152 338 The user does not have the correct
function right to perform the
requested operation. This error has
the same meaning as the
SL_RESOURCE_NOT_FOUND
error.
Package Errors
User Management Component 2.7 - UMC Service Layer API Developer Manual
53
A5E47537996-AA
7 UMC APIs Error Codes
6.5 Delete Roles
Database Errors
User Management Component 2.7 - UMC Service Layer API Developer Manual
54
A5E47537996-AA
7 UMC APIs Error Codes
6.5 Delete Roles
User Management Component 2.7 - UMC Service Layer API Developer Manual
55
A5E47537996-AA