This document provides general guides and tutorials for common operations relating to the SCIM 2.0 API for Work Accounts. This content describes multi-step operations or administrative tasks. For examples of singular requests, see the Examples page. |
How to Assign Managers to UsersThis guide outlines how to assign managers to new users or to existing users. |
Identify the manager's Work Accounts ID. If the ID is unknown, perform a GET User Request using the user's username
or externalId
to retrieve the id
.
GET /Users?filter=userName%20eq%20%22`{USERNAME}`%22 HTTP/1.1 Host: scim.workplace.com Authorization: Bearer {your access token} User-Agent: {your user agent}
200: Success
Returns a JSON representation of the User's account. Record the value of the id
property.
Example |
---|
Request PathGET /Users?filter=userName%20eq%20%22`b.wayne`%22 |
Response { "userName":"b.wayne", "id":"2567" } |
Perform a Create User Request and input the manager's id
in the manager
field. If you're assigning the manager to an existing user, skip to Step 2B.
POST /Users HTTP/1.1 Host: scim.workplace.com Authorization: Bearer {your access token} User-Agent: {your user agent}Request Body
{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0/User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", ], "userName":"{STRING}", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "manager":{ "value":"{STRING}", } } }
201: Created
Returns a JSON representation of the user account with the manager set to the specified ID.
Example |
---|
Request PathPOST https://scim.workplace.com/Users |
Request Body{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0/User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", ], "userName":"d.grayson", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "manager":{ "value":"2567", } } } |
Response{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0/User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", ], "userName":"d.grayson", "id":"4215", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "manager":{ "value":"2567", } } } |
Identify the existing User's Work Accounts ID. If the ID is unknown, perform a GET User Request using the user's username
or externalId
to retrieve the id
.
Perform a PatchOp Request to update the User's manager
field.
PATCH /Users/`{WORK ACCOUNTS ID}`/ HTTP/1.1 Host: scim.workplace.com Authorization: Bearer {your access token} User-Agent: {your user agent}Request Body
{ "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":{ "value":"{STRING}" } }] }
200: Success
Returns a JSON representation of the user account with the manager set to the specified ID.
Example |
---|
Request PathPATCH /Users/616 |
Request Body{ "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":{ "value":"2567" } }] } |
Response{ "schemas": [ "urn:ietf:params:scim:schemas:core:2.0/User", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", ], "userName":"m.morales", "id":"616", "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { "manager":{ "value":"2567", } } } |