Modify users
You can modify users (including updating the sites they are assigned to) through an API call.
Step 1: Create the Request Payload File
The request body of this API call needs to include the ID of the visit that you want to add the form to.
Create a new JSON file called update<username>.json (where <username> is the name of the user) and copy the following:
PUT /scim/TESTTRIAL/1.0/users
HOST: <hostname>
Accept: application/json
Authorization: Bearer eyJhGciO1J5...-MBqc
{
"schemas":[
"urn:ietf:params:scim:schemas:core:2.0:User",
"urn:umt:extension:schema:user"
],
"username": "testUserName",
"name" : {
"familyName": "Jensen",
"givenName": "Barbara",
"middleName": "Jane",
"honorificPrefix": "Mrs"
},
"displayName": "Babs Jensen",
"profileUrl": "https://HOST_NAME:PORT/bjensen",
"userType": "Site",
"preferredLanguage": "English (United States)",
"locale": "English (United States)",
"phoneNumbers": [
{
"value": "+1 555-555-5555",
"type": "primary"
},
{
"value": "+1 555-555-5555",
"type": "alternate"
},
{
"value": "+1 555-555-5555",
"type": "pager"
},
{
"value": "+1 555-555-4444",
"type": "fax"
}
],
"emails":
[
{
"value": "bjensen@example.com",
"type": "work"
}
],
"addresses":
{ "streetAddress": "100 Evergreen Ave.",
"formatted": "Apartment 101",
"locality": "Los Angeles",
"region": "CA",
"postalCode": "94333",
"country": "USA"
},
"groups":
[
{
"value": "TestqueryGrp",
"type": "query"
},
{
"value": "Testsignature",
"type": "signature"
},
{
"value": "Testmanageruser",
"type": "manageruser"
},
{
"value": "Testreportgroup",
"type": "reportgroup"
}
],
"roles": "TestRightsGroup",
"urn:umt:extension:schema:user":
{
"SiteMnemonic":
[
"123",
"456"
],
"DateFormat": "Month / Day / Year",
"TrainingStatus": "Trained",
"DoTechnicalAssessment": true
}
}
Step 2: Run the cURL call
Run the following cURL call to add the user to your study using the request payload file.
curl -X POST "https://hs-umt-scim.oracleindustry.com/scim/<trialname>/1.0/users -d "@update<username>.json"