Create a user
/rest/ofscCore/v1/users/{login}
This operation creates a new user record or replaces an existing record. If a user with the specified login does not exist, then a new user record is created. If a user already exists, then the existing user properties are replaced with the properties specified in the request.
Consider the following conditions while creating a new user:
- The user login has to be unique.
- The user has to be assigned to one or more resources.
- The other required fields such as 'name', 'userType', 'language', and 'timeZone' must be set.
Request
-
login(required): string
The unique identifier of the user account in Oracle Field Service.
object-
password:
string
Title:
PasswordThe password of the user account. It is only used when the login policy is set to 'local password storage'. For SAML, the password is ignored.
objectUser-
dateFormat:
string
Title:
Date FormatThe date format of the user account. Allowed Values: ["dd/mm/yy", "mm/dd/yy","dd.mm.yy","yyyy/mm/dd"]. -
language(required):
string
Title:
LanguageThe preferred language of the user. This field accepts the language codes listed on: Supported Language Codes. -
longDateFormat:
string
Title:
Long Date FormatThe long date format of the user account. -
mainResourceId:
string
Title:
Main Resource IDThe unique identifier of the main resource of the user account. This field is only set for resources that represent field service personnel. It is not set for groups and routing buckets.Note that if the specified resource was already assigned as main resource for some other user, that association will be removed, so that the other user will lose the main resource association.
This field is not returned in the response if it is empty.
-
name(required):
string
Title:
NameMinimum Length:1The full name of the user. -
organizationalUnit:
string
Title:
Organizational UnitThe identifier of the organization unit where the user works. The value of this field can be the ID of a resource with the role as 'bucket' or 'organization unit'. -
passwordTemporary:
boolean
Title:
Temporary PasswordThe temporary password of the user account. If the temporary password is set, then the user is prompted to change password on the next login. -
resources:
array Resources
Title:
ResourcesMinimum Number of Items:1Unique Items Required:trueThe list of resources assigned to the user account. These resources along with their children are visible to the user. This list does not incIude the resources whose resourceId values are empty. -
selfAssignment:
boolean
Title:
Self AssignmentIndicates whether the users can assign activities to themselves. -
status:
string
Title:
StatusAllowed Values:[ "active", "inactive" ]The status of the user account. -
timeFormat:
string
Title:
Time FormatThe time format of the user account. Allowed Values: [ "12-hour", "24-hour" ]. -
timeZone(required):
string
Title:
Time ZoneThe name of the user's time zone.This field accepts both Oracle Field Service time zone names (for example, Eastern) and IANA standard time zone names (for example, America/New_York). It is recommended that IANA names are specified.
For a list of supported time zones, see Supported Time Zones.
-
userType(required):
string
Title:
User TypeMinimum Length:1The type of the user account. The access controls of the user account are defined based on the user type. -
weekStart:
string
Title:
Week StartAllowed Values:[ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "default" ]The day on which the week starts for the user account.
arrayResources1trueResponse
- application/json
200 Response
object-
avatar:
object Avatar
Title:
AvatarThe profile picture of the user. -
blockedUntilTime:
string
Title:
Blocked Until TimeIf set, then this account is blocked temporarily (e.g. too many failed login attempts). The value is the time when account becomes unblocked -
createdTime:
string
Title:
Created TimeThe date and time when the user account is created. -
lastLoginTime:
string
Title:
Last Login TimeThe date and time when the user logged in to the account. -
lastPasswordChangeTime:
string
Title:
Last Password Change TimeThe date and time when the password was changed. -
lastUpdatedTime:
string
Title:
Last Updated TimeThe date and time when the user account was updated. This field is not updated if a custom property or the profile picture of the user is changed. This field is only updated when one of the built-in properties is changed. -
login:
string
Title:
LoginThe unique identifier of the user account in Oracle Field Service. -
loginAttempts:
integer
Title:
Login AttemptsThe number of unsuccessful login attempts. -
timeZoneDiff:
integer
Title:
Time Zone DiffThe difference between UTC and the user's local time, displayed in minutes. For example, -180 means that the resource time is 3 hours behind UTC.This is a read-only field.
-
timeZoneIANA:
string
Title:
Time Zone IANA NameThe IANA name of the user's time zone (for example, America/New_York). For the list of IANA time zone names, see IANA Time ZonesThis is a read-only field and is only returned in responses.
objectUser-
dateFormat:
string
Title:
Date FormatThe date format of the user account. Allowed Values: ["dd/mm/yy", "mm/dd/yy","dd.mm.yy","yyyy/mm/dd"]. -
language(required):
string
Title:
LanguageThe preferred language of the user. This field accepts the language codes listed on: Supported Language Codes. -
longDateFormat:
string
Title:
Long Date FormatThe long date format of the user account. -
mainResourceId:
string
Title:
Main Resource IDThe unique identifier of the main resource of the user account. This field is only set for resources that represent field service personnel. It is not set for groups and routing buckets.Note that if the specified resource was already assigned as main resource for some other user, that association will be removed, so that the other user will lose the main resource association.
This field is not returned in the response if it is empty.
-
name(required):
string
Title:
NameMinimum Length:1The full name of the user. -
organizationalUnit:
string
Title:
Organizational UnitThe identifier of the organization unit where the user works. The value of this field can be the ID of a resource with the role as 'bucket' or 'organization unit'. -
passwordTemporary:
boolean
Title:
Temporary PasswordThe temporary password of the user account. If the temporary password is set, then the user is prompted to change password on the next login. -
resources:
array Resources
Title:
ResourcesMinimum Number of Items:1Unique Items Required:trueThe list of resources assigned to the user account. These resources along with their children are visible to the user. This list does not incIude the resources whose resourceId values are empty. -
selfAssignment:
boolean
Title:
Self AssignmentIndicates whether the users can assign activities to themselves. -
status:
string
Title:
StatusAllowed Values:[ "active", "inactive" ]The status of the user account. -
timeFormat:
string
Title:
Time FormatThe time format of the user account. Allowed Values: [ "12-hour", "24-hour" ]. -
timeZone(required):
string
Title:
Time ZoneThe name of the user's time zone.This field accepts both Oracle Field Service time zone names (for example, Eastern) and IANA standard time zone names (for example, America/New_York). It is recommended that IANA names are specified.
For a list of supported time zones, see Supported Time Zones.
-
userType(required):
string
Title:
User TypeMinimum Length:1The type of the user account. The access controls of the user account are defined based on the user type. -
weekStart:
string
Title:
Week StartAllowed Values:[ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "default" ]The day on which the week starts for the user account.
arrayResources1trueDefault Response
object-
detail:
string
The detailed description of this error.
-
status:
string
The HTTP status code of this error.
-
title(required):
string
The brief description of this error.
-
type(required):
string
The URL of the web page containing more details about this error.
Examples
The following example shows how to create a user by submitting a PUT request on the REST resource.
Example of Request Header
The following shows an example of the request header.
PUT /rest/ofscCore/v1/users/login HTTP/1.0 Authorization: Basic c29hcEB5YW1hdG86MQ== Host: etadev1f Accept: */*
Example of Request Body
The following shows an example of the request body.
{
"name": "Test Name",
"mainResourceId": "44042",
"language": "en",
"timeZone": "Arizona",
"userType": "soap",
"password": "123123123",
"resources": ["44008", "44035"]
}Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK Server: nginx/1.6.2 Date: Fri, 24 Jul 2015 08:35:48 GMT Content-Type: application/json; charset=utf-8 Connection: close
Example of Response Body
The following example shows the contents of the response body in JSON format:
{
"name": "Test Name",
"status": "active",
"login": "qwwqweqweqwe",
"language": "en",
"dateFormat": 12,
"longDateFormat": 16,
"timeFormat": 14,
"timeZoneDiff": -420,
"timeZone": "Arizona",
"createdTime": "2015-09-01 08:20:18",
"lastPasswordChangeTime": "2015-09-01 08:20:18",
"userType": "soap",
"resources":
[
"44008",
"44035",
"44042"
],
"collaborationGroups":
{
"links": [
{
"rel": "canonical",
"href": "https://etadev1f/rest/ofscCore/v1/users/qwwqweqweqwe/collaborationGroups"
}
]
},
"links": [
{
"rel": "canonical",
"href": "https://etadev1f/rest/ofscCore/v1/users/qwwqweqweqwe"
},
{
"rel": "describedby",
"href": "https://etadev1f/rest/ofscCore/v1/metadata-catalog/users"
}
]
}