SCIM User examples
Operations
List all
List all users. Active or not. For example after the Soffid installation the admin user already exists.
GET http://<domain>/webservice/scim2/v1/User
HTTP 200
{
"totalResults": 1,
"resources": [
{
"lastName": "Admin",
"createdByUser": "Anonymous",
"secondaryGroups": [],
"mailServer": "null",
"multiSession": true,
"modifiedByUser": "Anonymous",
"id": 60,
"homeServer": "null",
"primaryGroupDescription": "Enterprise Administrators",
"primaryGroup": "admingroup",
"consoleProperties": {
"preferences": {
"lang": "en"
},
"language": "en",
"id": 229,
"lastLoginDate": "2017-08-25T12:38:50+02:00",
"userName": "admin",
"version": "TEST"
},
"comments": "Autocreated",
"profileServer": "null",
"active": true,
"fullName": "Admin Admin",
"userName": "admin",
"mailAlias": "",
"firstName": "Admin",
"createdDate": "2017-08-02T11:22:44+02:00",
"phoneNumber": "",
"meta": {
"created": "2017-08-02T11:22:44+02:00",
"location": "http://<domain>/webservice/scim2/v1/User/60",
"lastModified": "2017-08-02T11:22:44+02:00",
"resourceType": "User"
},
"modifiedDate": "2017-08-02T11:22:44+02:00",
"attributes": {},
"accounts": [
{
"system": "soffid",
"name": "admin",
"id": 69
}
],
"userType": "I"
}
]
}
List by id
List a user by its id (primary key). For example the admin user listed previously.
GET http://<domain>/webservice/scim2/v1/User/60
HTTP 200
{
"lastName": "Admin",
"createdByUser": "Anonymous",
"secondaryGroups": [],
"mailServer": "null",
"multiSession": true,
"modifiedByUser": "Anonymous",
"id": 60,
"homeServer": "null",
"primaryGroupDescription": "Enterprise Administrators",
"primaryGroup": "admingroup",
"consoleProperties": {
"preferences": {
"lang": "en"
},
"language": "en",
"id": 229,
"lastLoginDate": "2017-08-25T12:38:50+02:00",
"userName": "admin",
"version": "TEST"
},
"comments": "Autocreated",
"profileServer": "null",
"active": true,
"fullName": "Admin Admin",
"userName": "admin",
"mailAlias": "",
"firstName": "Admin",
"createdDate": "2017-08-02T11:22:44+02:00",
"phoneNumber": "",
"meta": {
"created": "2017-08-02T11:22:44+02:00",
"location": "http://<domain>/webservice/scim2/v1/User/60",
"lastModified": "2017-08-02T11:22:44+02:00",
"resourceType": "User"
},
"modifiedDate": "2017-08-02T11:22:44+02:00",
"attributes": {},
"accounts": [
{
"system": "soffid",
"name": "admin",
"id": 69
}
],
"userType": "I"
}
List by filter
List all users with a filter expression. For example, one can search active users with id greater than 50 and its user starting with 'a'.
GET http://<domain>/webservice/scim2/v1/User?filter=active eq true and id gt 50 and userName sw "a"
HTTP 200
{
"totalResults": 1,
"resources": [
{
"lastName": "Admin",
"createdByUser": "Anonymous",
"secondaryGroups": [],
"mailServer": "null",
"multiSession": true,
"modifiedByUser": "Anonymous",
"id": 60,
"homeServer": "null",
"primaryGroupDescription": "Enterprise Administrators",
"primaryGroup": "admingroup",
"consoleProperties": {
"preferences": {
"lang": "en"
},
"language": "en",
"id": 229,
"lastLoginDate": "2017-08-25T12:38:50+02:00",
"userName": "admin",
"version": "TEST"
},
"comments": "Autocreated",
"profileServer": "null",
"active": true,
"fullName": "Admin Admin",
"userName": "admin",
"mailAlias": "",
"firstName": "Admin",
"createdDate": "2017-08-02T11:22:44+02:00",
"phoneNumber": "",
"meta": {
"created": "2017-08-02T11:22:44+02:00",
"location": "http://<domain>/webservice/scim2/v1/User/60",
"lastModified": "2017-08-02T11:22:44+02:00",
"resourceType": "User"
},
"modifiedDate": "2017-08-02T11:22:44+02:00",
"attributes": {},
"accounts": [
{
"system": "soffid",
"name": "admin",
"id": 69
}
],
"userType": "I"
}
]
}
Create
One may create a user. This user will be used for next examples.
POST http://<domain>/webservice/scim2/v1/User
Put the user JSON in the body of the request:
{
"userName": "jsmith",
"firstName": "John",
"lastName": "Smith",
"userType": "I",
"primaryGroup": "world",
"homeServer": "null",
"mailServer": "null",
"profileServer": "null",
"active": true
}
HTTP 201
{
"lastName": "Smith",
"createdByUser": "admin",
"secondaryGroups": [],
"mailServer": "null",
"multiSession": false,
"id": 15245,
"homeServer": "null",
"primaryGroupDescription": "World",
"primaryGroup": "world",
"profileServer": "null",
"active": true,
"fullName": "John Smith",
"userName": "jsmith",
"mailAlias": "",
"firstName": "John",
"createdDate": "2017-08-25T14:01:40.522+02:00",
"phoneNumber": "",
"meta": {
"created": "2017-08-25T14:01:40.522+02:00",
"location": "http://<domain>/webservice/scim2/v1/User/15245",
"lastModified": "2017-08-25T14:01:40.522+02:00",
"resourceType": "User"
},
"modifiedDate": "2017-08-25T14:01:40.522+02:00",
"attributes": {},
"accounts": [],
"userType": "I"
}
Update partial
Update only the attributes with changes, only these attributes will be updated in the user, the rest will maintain the same value.
PATCH http://<domain>/webservice/scim2/v1/User/15245
Put the user JSON in the body of the request:
{
"phoneNumber": "666777888"
}
HTTP 200
{
"lastName": "Smith",
"createdByUser": "admin",
"secondaryGroups": [],
"mailServer": "null",
"multiSession": false,
"modifiedByUser": "admin",
"id": 15245,
"homeServer": "null",
"primaryGroupDescription": "World",
"primaryGroup": "world",
"profileServer": "null",
"active": true,
"fullName": "John Smith",
"userName": "jsmith",
"mailAlias": "",
"firstName": "John",
"createdDate": "2017-08-25T14:01:40+02:00",
"phoneNumber": "666777888",
"meta": {
"created": "2017-08-25T14:01:40+02:00",
"location": "http://<domain>/webservice/scim2/v1/User/15245",
"lastModified": "2017-08-25T14:11:22.957+02:00",
"resourceType": "User"
},
"modifiedDate": "2017-08-25T14:11:22.957+02:00",
"attributes": {},
"accounts": [],
"userType": "I"
}
Update all
This operation replaces all values in the user. For example we will update nationalID.
- Note that the attribute id is required to confirm that the resource "...User/<id>" is the same that the JSON user.
- Note that all the attributes not included in the request will be cleared in the user and their data will be lost.
- Note that not all the attributes are updatable, for example tag meta, avoid these tags. For more information see Resource data model page.
PUT http://<domain>/webservice/scim2/v1/User/15245
Put the user JSON in the body of the request:
{
"id": 15245,
"userName": "jsmith",
"firstName": "John",
"lastName": "Smith",
"active": true,
"multiSession": false,
"userType": "I",
"profileServer": "null",
"homeServer": "null",
"mailServer": "null",
"nationalID": "11223344A",
"phoneNumber": "666777888",
"mailAlias": "",
"primaryGroup": "world",
"primaryGroupDescription": "World",
"fullName": "John Smith",
"attributes": {},
"secondaryGroups": [],
"accounts": []
}
HTTP 200
{
"lastName": "Smith",
"createdByUser": "admin",
"secondaryGroups": [],
"mailServer": "null",
"nationalID": "11223344A",
"multiSession": false,
"modifiedByUser": "admin",
"id": 15245,
"homeServer": "null",
"primaryGroupDescription": "World",
"primaryGroup": "world",
"profileServer": "null",
"active": true,
"fullName": "John Smith",
"userName": "jsmith",
"mailAlias": "",
"firstName": "John",
"createdDate": "2017-08-25T14:01:40+02:00",
"phoneNumber": "666777888",
"meta": {
"created": "2017-08-25T14:01:40+02:00",
"location": "http://<domain>/webservice/scim2/v1/User/15245",
"lastModified": "2017-08-25T15:20:16.943+02:00",
"resourceType": "User"
},
"modifiedDate": "2017-08-25T15:20:16.943+02:00",
"attributes": {},
"accounts": [],
"userType": "I"
}
Delete
Delete a user and its relations (groups, accounts, attributes, secondary groups, etc).
- Please note that after this delete action, you will need to create again the user to use it in the next examples.
DELETE http://<domain>/webservice/scim2/v1/User/15245
HTTP 204