Thanks to visit codestin.com
Credit goes to developer.interactsoftware.com

SCIM Package Examples

SCHEMA example

URL: https://yourintranet.interactgo.com/api/v2/scim/v2/Schemas

GET User example

URL: https://yourintranet.interactgo.com/api/v2/scim/v2/Users?filter=userName eq "[email protected]"
Just replace yourintranet.interactgo.com with your URL. And then you can add your lookup information.

POST User example

URL: https://yourintranet.interactgo.com/api/v2/scim/v2/Users
Just replace yourintranet.interactgo.com with your URL
Contains all values except groups (in user profile), job end date, all urn:ietf:params:scim:schemas:core:2.0:Group values and all urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group values.

{
    "schemas": [
            "urn:ietf:params:scim:schemas:core:2.0:User",
            "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
    ],
    "externalId": "[email protected]",
    "userName": "[email protected]",
	"profileUrl": "https://www.google.com/myprofile",
    "active": true,
    "preferredLanguage": "en-GB",
    "locale": "en-GB",
    "timezone": "Eastern Standard Time",
    "title": "Customer Operations Agent",
    "userType": "Intranet User",
	"password": "Interact01!",
    "emails": [
        {
            "primary": true,
            "type": "work",
            "value": "[email protected]"
        },
        {
            "primary": false,
            "type": "home",
            "value": "[email protected]"
        }
    ],
	"phoneNumbers": [
	    {
		    "type": "mobile",
            "value": "+14055551212"
		},
		{
		    "type": "work",
            "value": "+441619273333"
	    },
		{
		    "type": "home",
            "value": "+14055553434"
		}
	],
	"ims": [
	    {
		    "type": "skype",
            "value": "skype chat"
		},
		{
		    "type": "chat",
            "value": "default chat"
	    }	
	],
	"photos": [
	    {
	        "value": "https://previews.123rf.com/images/aquir/aquir1311/aquir131100316/23569861-sample-grunge-red-round-stamp.jpg",
			"display": "Test User Pic",
			"type": "photo",
			"primary": true
	    }
	],
	"addresses": [
		{
			"formatted": "1 Main street, New York, NY 00101",
			"type": "work"
		}
	],
    "meta": {
        "resourceType": "User"
    },
    "name": {
        "familyName": "Test1",
        "givenName": "GivenName1"
    },
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
        "department": "Customer Operations",
        "manager": {
                "$ref": "",
                "displayName": null,
                "value": "[email protected]"
        },
        "organization": "Sample"
    },
    "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:User": {
        "jobStartDate": "2020-03-06T01:00:00Z",
        "location": "Jersey City",
        "loginType": "SAML",
	"bio": "This is my bio with special characters //  \\ \"  \b\f\t\r\n <p> </p> </p> <body bgcolor=?> <a href=\"URL\">clickable text</a> , ! £ #$%^&*()+-_=:;/?,.<>{}[]€ƒ„…†ÿ  <p> Test paragraph </p> <h> Header 1 </h>",
	"name": {
				"title": "Dr.",
				"initials": "Jr."
			},
	"pronouns": "He/His",
	"dateOfBirth": "1997-01-03T01:00:00Z",
	"linkedInId": "https://www.linkedin.com/in/user1",
	"twitterTag": "https://twitter.com/testuser1",
	"forcePasswordReset": false,
	"instagramTag": "https://instagram.com/testuser1",
	"facebookId": "https://facebook.com/testuser1"
    },
	"urn:ietf:params:scim:schemas:extension:interactsoftwareadditionalfields:2.0:User": {
	    "division": "Default Division"
	}
}

PATCH User example

https://yourintranet.interactgo.com/api/v2/scim/v2/Users/35259
Just replace yourintranet.interactgo.com with your URL. Also you need to replace 35259 with the personid of the record that you want to change in your DB. You get this from the GET command.

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "op": "Replace",
            "path": "locale",
            "value": "en-US"
        },
        {
            "op": "Add",
            "path": "userType",
            "value": "Intranet User"
        }
    ]
}

PATCH User - more complex example

https://yourintranet.interactgo.com/api/v2/scim/v2/Users/35259
Just replace yourintranet.interactgo.com with your URL. Also you need to replace 35259 with the personid of the record that you want to change in your DB. You get this from the GET command.

**Note that a PATCH to manager requires that you pass the "id" value from the GET command for the manager

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "op": "Replace",
            "path": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:manager",
            "value": "316"
        },
        {
            "op": "Replace",
            "path": "emails[type eq \"work\"].value",
            "value": "[email protected]"
        },
        {
            "op": "Add",
            "path": "addresses[type eq \"work\"].formatted",
            "value": "Toonsberry, OH"
        },
        {
            "op": "Add",
            "path": "phoneNumbers[type eq \"work\"].value",
            "value": "440-555-1212"
        },
        {
            "op": "Add",
            "path": "externalId",
            "value": "Eric.Smith"
        },
        {
            "op": "Add",
            "path": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:employeeNumber",
            "value": "1234"
        },
        {
            "op": "Replace",
            "path": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:organization",
            "value": "JustRocks LLC."
        },
        {
            "op": "Replace",
            "path": "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User:department",
            "value": "Marketing"
        },
        {
            "op": "Replace",
            "path": "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:User:location",
            "value": "Sunnyville"
        },
        {
            "op": "Replace",
            "path": "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:User:loginType",
            "value": "SAML"
        }
    ]
}

PUT User example

https://yourintranet.interactgo.com/api/v2/scim/v2/Users/35259
Just replace yourintranet.interactgo.com with your URL. Also you need to replace 35259 with the personid of the record that you want to change in your DB. You get this from the GET command. Also, I have found that you do not need to provide the personid... i.e. you can just use: https://yourintranet.interactgo.com/api/v2/scim/v2/Users.
Contains all values except groups (in user profile), job end date, all urn:ietf:params:scim:schemas:core:2.0:Group values and all urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group values.

{
    "schemas": [
            "urn:ietf:params:scim:schemas:core:2.0:User",
            "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User"
    ],
    "externalId": "[email protected]",
    "userName": "[email protected]",
	"profileUrl": "https://www.google.com/myprofile",
    "active": true,
    "preferredLanguage": "en-GB",
    "locale": "en-GB",
    "timezone": "Eastern Standard Time",
    "title": "Customer Operations Agent",
    "userType": "Intranet User",
	"password": "Interact01!",
    "emails": [
        {
            "primary": true,
            "type": "work",
            "value": "[email protected]"
        },
        {
            "primary": false,
            "type": "home",
            "value": "[email protected]"
        }
    ],
	"phoneNumbers": [
	    {
		    "type": "mobile",
            "value": "+14055551212"
		},
		{
		    "type": "work",
            "value": "+441619273333"
	    },
		{
		    "type": "home",
            "value": "+14055553434"
		}
	],
	"ims": [
	    {
		    "type": "skype",
            "value": "skype chat"
		},
		{
		    "type": "chat",
            "value": "default chat"
	    }	
	],
	"photos": [
	    {
	        "value": "https://previews.123rf.com/images/aquir/aquir1311/aquir131100316/23569861-sample-grunge-red-round-stamp.jpg",
			"display": "Test User Pic",
			"type": "photo",
			"primary": true
	    }
	],
	"addresses": [
		{
			"formatted": "1 Main street, New York, NY 00101",
			"type": "work",
			"primary": true
		}
	],
    "meta": {
        "resourceType": "User"
    },
    "name": {
        "familyName": "Test1",
        "givenName": "GivenName1"
    },
    "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
        "department": "Customer Operations",
        "manager": {
                "$ref": "Users/275",
                "displayName": null,
                "value": "275"
        },
        "organization": "Sample"
    },
    "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:User": {
        "jobStartDate": "2020-03-06T01:00:00Z",
        "location": "Jersey City",
        "loginType": "SAML",
		"bio": "This is my bio with special characters //  \\ \"  \b\f\t\r\n <p> </p> </p> <body bgcolor=?> <a href=\"URL\">clickable text</a> , ! £ #$%^&*()+-_=:;/?,.<>{}[]€ƒ„…†ÿ  <p> Test paragraph </p> <h> Header 1 </h>",
		"name": {
				"title": "Dr.",
				"initials": "Jr."
			},
		"pronouns": "He/His",
		"dateOfBirth": "1997-01-03T01:00:00Z",
		"linkedInId": "https://www.linkedin.com/in/user1",
		"twitterTag": "https://twitter.com/testuser1",
		"forcePasswordReset": false,
		"instagramTag": "https://instagram.com/testuser1",
		"facebookId": "https://facebook.com/testuser1"
    },
	"urn:ietf:params:scim:schemas:extension:interactsoftwareadditionalfields:2.0:User": {
	    "division": "Default Division"
	}
}

Get Group Example

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups

{
            "displayName": "Our Intranet Users",
            "id": "5291",
            "members": [],
            "meta": {
                "resourceType": "Group",
                "location": "Groups/5291"
            },
            "schemas": [
                "urn:ietf:params:scim:schemas:core:2.0:Group",
                "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group"
            ],
            "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group": {
                "externalId": "cc0db17f-6602-45f2-8cfc-b4650a9cd508",
                "groupType": "group"
            }
        }

Get Group by id Example

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups/id

{
    "displayName": "Our Intranet Users",
    "id": "5291",
    "members": [
        {
            "$ref": "Users/25158",
            "display": "Sri Nguyen",
            "type": "User",
            "value": 25158
        },
        {
            "$ref": "Users/35069",
            "display": "David Wilson",
            "type": "User",
            "value": 35069
        },
        {
            "$ref": "Users/35187",
            "display": "Test User",
            "type": "User",
            "value": 35187
        }
    ],
    "meta": {
        "resourceType": "Group",
        "location": "Groups/5291"
    },
    "schemas": [
        "urn:ietf:params:scim:schemas:core:2.0:Group",
        "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group"
    ],
    "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group": {
        "externalId": "cc0db17f-6602-45f2-8cfc-b4650a9cd508",
        "groupType": "group"
    }
}

POST Group with no users

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups

{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group",
              "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group"],
  "meta": {
        "resourceType": "Group" 
  },
  "displayName": "TestSCIM-POSTGroup1",
  "members":[],
  "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group": {
                "externalId": "5d471732ad3d5768e67f86859e329d46",
                "groupType": "group"
  }
}

POST Group with 1 user

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups

{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group",
              "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group"],
  "meta": {
        "resourceType": "Group" 
  },
  "displayName": "TestSCIM-POSTGroup2",
  "members":[
        {
            "$ref": "Users/25158",
            "display": "Sri Nguyen",
            "type": "User",
            "value": "25158"
        }
  ],
  "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group": {
                "externalId": "113581b2fe04e30e623a0fe28e293e02",
                "groupType": "group"
  }
}

PUT Group with 1 user

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups/{{group3}}

{
  "schemas": ["urn:ietf:params:scim:schemas:core:2.0:Group",
              "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group"],
  "meta": {
        "resourceType": "Group" 
  },
  "displayName": "TestSCIM-POSTGroup3",
  "members":[
        {
            "$ref": "Users/35069",
            "display": "David Wilson",
            "type": "User",
            "value": "35069"
        }
  ],
  "urn:ietf:params:scim:schemas:extension:interactsoftware:2.0:Group": {
                "externalId": "113581b2fe04e30e623a0fe28e293e02",
                "groupType": "group"
  }
}

PATCH Group - Add User

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups/{{group3}}

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "op": "Add",
            "value": {
                "members": [{
                    "value": "35187",
                    "display": "testuser1"
                }]
            }
        }]
}

PATCH Group - Remove User

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups/{{group3}}

{
    "schemas": [
        "urn:ietf:params:scim:api:messages:2.0:PatchOp"
    ],
    "Operations": [
        {
            "op": "remove",
            "path": "members[value eq \"35069\"]"
        }
    ]
}

PATCH Group - Remove User (Another way)

Programmatically, the "uid" can be difficult to handle. So you can also use this format to remove users:

{
    "schemas": ["urn:ietf:params:scim:api:messages:2.0:PatchOp"],
    "Operations": [
        {
        "op": "remove",
        "path": "members",
        "value": [
            {
            "value": "274",
            "display": "[email protected]"
            },
            {
            "value": "301",
            "display": "[email protected]"
            }
        ]
    }]
}

Delete Group

https://yourintranet.interactgo.com/api/v2/scim/v2/Groups/{{group3}}