Create a resource user
/crmRestApi/resources/11.13.18.05/resourceUsers
Request
-
Metadata-Context:
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version:
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
-
Upsert-Mode:
Contains one of the following values: true or false. If true, the server performs an Upsert operation instead of a Create operation. During an Upsert operation, the server attempts to find an existing resource that matches the payload. If a match is found, the server updates the existing resource instead of creating a new one. If not found or false (default), the server performs a Create operation. Note that the Upsert operation isn't supported for date-effective REST resources.
- application/json
object
-
AddressLine1: string
Title:
Address Line 1
Maximum Length:240
The first line of the address of the resource. -
AddressLine2: string
Title:
Address Line 2
Maximum Length:240
The second line of the address of the resource. -
BusinessUnit(required): string
Title:
Business Unit
The name of the business unit associated with the resource. -
County: string
Title:
County
Maximum Length:60
The name of the county provided in the resource's address. -
CreateUserAccountFlag: boolean
Title:
Create User Account
Indicates whether a user account can be created for the resource. The default value is true. -
FaxCountryCode: string
Title:
Phone Country Code
Maximum Length:10
The country code of the fax. -
FirstName(required): string
Title:
First Name
Maximum Length:150
The first name of the resource. -
HireDate: string
(date)
Title:
Hire Date
The date when the resource was hired. -
HRManagerEmailAddress: string
Title:
HR Manager Email
The email address of the human resource manager of the resource. -
IndividualRoleCode: string
Title:
Individual Role Code
Maximum Length:255
The special individual role of the user. -
IndividualRoleEndDate: string
(date)
Title:
Individual Role End Date
The date when the individual role ends. -
IndividualRoleStartDate: string
(date)
Title:
Individual Role Start Date
The date when the individual role starts. -
JobCode: string
Title:
Job Code
The job code assigned to the resource. -
LastName(required): string
Title:
Last Name
Maximum Length:150
The last name of the resource. -
LegalEntity(required): string
Title:
Legal Entity
The name of the legal entity of associated with the resource. -
MiddleName: string
Title:
Middle Name
Maximum Length:60
The middle name of the resource. -
MobilePhoneCountryCode: string
Title:
Phone Country Code
Maximum Length:10
The country code associated with the mobile phone. -
PersonType(required): string
Title:
Person Type
The type of the work relationship of a worker associated with the resource. For exampe, Employee, Contingent, or Worker. -
Province: string
Title:
Province
Maximum Length:60
The name of the province provided in the resource's address. -
RawFaxNumber: string
Title:
Fax
Maximum Length:60
The fax number of the resource in raw format. -
RawMobilePhoneNumber: string
Title:
Mobile Phone
Maximum Length:60
The mobile phone number of the resource. -
RawWorkPhoneNumber: string
Title:
Work Phone
Maximum Length:60
The resource's work phone number in raw format. -
ResourceEmail(required): string
Title:
Email
Maximum Length:320
The email address of the resource. -
ResourceEndDate(required): string
(date)
Title:
To Date
The date up to which the resource is active. -
ResourceManagerFirstName: string
Title:
Manager First Name
Maximum Length:255
The first name of the reporting manager of the resource. -
ResourceManagerLastName: string
Title:
Manager Last Name
Maximum Length:255
The last name of the reporting manager of the resource. -
ResourceManagerName: string
Title:
Manager Name
Maximum Length:255
The name of the manager of the resource. -
ResourceOrganizationName: string
Title:
Organization
Maximum Length:255
The name of the resource organization associated to the resource in managerial role. -
ResourceOrgManagerEmail: string
Title:
Manager Email
Maximum Length:255
The email address of the reporting manager of the resource. -
ResourceOrgMemRoleEndDate: string
(date)
Title:
Membership Role End Date
The date when the membership of the resource ends. -
ResourceOrgMemRoleStartDate: string
(date)
Title:
Organization Membership Role Start Date
The date when the resource becomes a member of the organization. -
ResourceOrgRoleCode: string
Title:
Organization Role Code
Maximum Length:255
The code indicating the role of the resource in association with organization membership. For example, SALES_REPRESENTATIVE or SALES_MANAGER. -
ResourceParentOrganizationName: string
Title:
Parent Organization
Maximum Length:255
The name of the organization to which the manager of the resource is associated. -
ResourcePartyId: integer
(int64)
Title:
Party ID
The unique identifier of the party associated with the resource. -
ResourcePartyNumber: string
Title:
Party Number
Maximum Length:30
The unique identifier of the party associated with the resource. -
ResourceRoleAssign: array
Resource Role Assignments
Title:
Resource Role Assignments
The resource role assignments resource is used to view the role assigned to a resource, such as implementer, reseller, and so on. -
ResourceStartDate: string
(date)
Title:
Resource Start Date
The date when the resource becomes active. -
ResourceType: string
Title:
Usage
The type of the resource. -
State: string
Title:
State
Maximum Length:60
The name of the state provided in the resource's address. -
TimezoneCode: string
Title:
Time Zone Code
Maximum Length:64
The code for the time zone of the resource. -
Title: string
Title:
Title
Maximum Length:60
The title preceding the name of the resource. -
TopResourceFlag: boolean
Title:
Root Resource
Default Value:false
Indicates whether the resource is top user in hierarchy. -
UserStatus: string
Title:
User Account Status
Maximum Length:255
Indicates the the status of the user account for the resource. The supported values are A for active and S for suspended. The status is set to A for new accounts. -
WorkPhoneCountryCode: string
Title:
Phone Country Code
Maximum Length:10
The country code associated with the work phone.
array
Resource Role Assignments
object
-
EndDateActive: string
(date)
Title:
To Date
The date when the resource role becomes inactive. -
PartyName: string
Title:
Resource
Maximum Length:360
The name of the party. -
RoleId: integer
Title:
Role
The unique identifier of the role. -
RoleResourceId: integer
The unique identifier of the resource role.
-
StartDateActive: string
(date)
Title:
From Date
The date when the resource role become active.
Response
- application/json
Default Response
-
Metadata-Context:
If the REST API supports runtime customizations, the shape of the service may change during runtime. The REST client may isolate itself from these changes or choose to interact with the latest version of the API by specifying this header. For example: Metadata-Context:sandbox="TrackEmployeeFeature".
-
REST-Framework-Version:
The protocol version between a REST client and service. If the client does not specify this header in the request the server will pick a default version for the API.
object
-
AddressLine1: string
Title:
Address Line 1
Maximum Length:240
The first line of the address of the resource. -
AddressLine2: string
Title:
Address Line 2
Maximum Length:240
The second line of the address of the resource. -
BusinessUnit: string
Title:
Business Unit
The name of the business unit associated with the resource. -
City: string
Title:
City
Read Only:true
Maximum Length:60
The name of the city provided in the resource's address. -
Country: string
Title:
Country
Read Only:true
Maximum Length:2
The name of the country provided in the resource's address. -
County: string
Title:
County
Maximum Length:60
The name of the county provided in the resource's address. -
CreatedBy: string
Title:
Created By
Read Only:true
Maximum Length:64
The user who created the record. -
CreateUserAccountFlag: boolean
Title:
Create User Account
Indicates whether a user account can be created for the resource. The default value is true. -
CreationDate: string
(date-time)
Title:
Creation Date
Read Only:true
The date and time when the record was created. -
DeleteFlag: boolean
Read Only:
true
Indicates if the user can delete the resource. -
FaxCountryCode: string
Title:
Phone Country Code
Maximum Length:10
The country code of the fax. -
FirstName: string
Title:
First Name
Maximum Length:150
The first name of the resource. -
FormattedAddress: string
Read Only:
true
Maximum Length:255
The primary formatted address of the resource. -
HireDate: string
(date)
Title:
Hire Date
The date when the resource was hired. -
HRManagerEmailAddress: string
Title:
HR Manager Email
The email address of the human resource manager of the resource. -
IndividualRoleCode: string
Title:
Individual Role Code
Maximum Length:255
The special individual role of the user. -
IndividualRoleEndDate: string
(date)
Title:
Individual Role End Date
The date when the individual role ends. -
IndividualRoleStartDate: string
(date)
Title:
Individual Role Start Date
The date when the individual role starts. -
JobCode: string
Title:
Job Code
The job code assigned to the resource. -
JobTitle: string
Title:
Job Title
Read Only:true
The title of the job assigned to the resource. -
LastName: string
Title:
Last Name
Maximum Length:150
The last name of the resource. -
LastUpdateDate: string
(date-time)
Title:
Last Update Date
Read Only:true
The date when the record was last updated. -
LastUpdatedBy: string
Title:
Last Updated By
Read Only:true
Maximum Length:64
The user who last updated the record. -
LegalEntity: string
Title:
Legal Entity
The name of the legal entity of associated with the resource. -
links: array
Links
Title:
Links
The link relations associated with the resource instance. -
MiddleName: string
Title:
Middle Name
Maximum Length:60
The middle name of the resource. -
MobilePhoneCountryCode: string
Title:
Phone Country Code
Maximum Length:10
The country code associated with the mobile phone. -
PartyName: string
Title:
Resource Name
Read Only:true
Maximum Length:360
The name of the person. -
PersonNumber: string
Title:
Person Number
Read Only:true
The person number identifier of the worker record of the resource. -
PersonType: string
Title:
Person Type
The type of the work relationship of a worker associated with the resource. For exampe, Employee, Contingent, or Worker. -
PostalCode: string
Title:
Postal Code
Read Only:true
Maximum Length:60
The postal code for the address of resource. -
Province: string
Title:
Province
Maximum Length:60
The name of the province provided in the resource's address. -
RawFaxNumber: string
Title:
Fax
Maximum Length:60
The fax number of the resource in raw format. -
RawMobilePhoneNumber: string
Title:
Mobile Phone
Maximum Length:60
The mobile phone number of the resource. -
RawWorkPhoneNumber: string
Title:
Work Phone
Maximum Length:60
The resource's work phone number in raw format. -
ResourceEmail: string
Title:
Email
Maximum Length:320
The email address of the resource. -
ResourceEndDate: string
(date)
Title:
To Date
The date up to which the resource is active. -
ResourceManagerFirstName: string
Title:
Manager First Name
Maximum Length:255
The first name of the reporting manager of the resource. -
ResourceManagerLastName: string
Title:
Manager Last Name
Maximum Length:255
The last name of the reporting manager of the resource. -
ResourceManagerName: string
Title:
Manager Name
Maximum Length:255
The name of the manager of the resource. -
ResourceManagerPartyId: integer
Title:
Manager Party ID
Read Only:true
The unique identifier of the reporting manager of the resource. -
ResourceManagerPartyNumber: string
Title:
Manager Party Number
Read Only:true
Maximum Length:255
The unique public identifier of the reporting manager of the resource. -
ResourceOrganizationName: string
Title:
Organization
Maximum Length:255
The name of the resource organization associated to the resource in managerial role. -
ResourceOrganizationUsage: string
Title:
Organization Usage
Read Only:true
Maximum Length:255
The usage type of the resource organization. For example, Sales or Marketing. -
ResourceOrgManagerEmail: string
Title:
Manager Email
Maximum Length:255
The email address of the reporting manager of the resource. -
ResourceOrgMemRoleEndDate: string
(date)
Title:
Membership Role End Date
The date when the membership of the resource ends. -
ResourceOrgMemRoleStartDate: string
(date)
Title:
Organization Membership Role Start Date
The date when the resource becomes a member of the organization. -
ResourceOrgRoleCode: string
Title:
Organization Role Code
Maximum Length:255
The code indicating the role of the resource in association with organization membership. For example, SALES_REPRESENTATIVE or SALES_MANAGER. -
ResourceOrgRoleName: string
Read Only:
true
Maximum Length:255
The role that defines the function of the resource in an organization or hierarchy. -
ResourceParentOrganizationName: string
Title:
Parent Organization
Maximum Length:255
The name of the organization to which the manager of the resource is associated. -
ResourcePartyId: integer
(int64)
Title:
Party ID
The unique identifier of the party associated with the resource. -
ResourcePartyNumber: string
Title:
Party Number
Maximum Length:30
The unique identifier of the party associated with the resource. -
ResourceProfileId: integer
(int64)
Title:
Profile ID
Read Only:true
The unique identifier of the profile of the resource. -
ResourceRoleAssign: array
Resource Role Assignments
Title:
Resource Role Assignments
The resource role assignments resource is used to view the role assigned to a resource, such as implementer, reseller, and so on. -
ResourceStartDate: string
(date)
Title:
Resource Start Date
The date when the resource becomes active. -
ResourceType: string
Title:
Usage
The type of the resource. -
State: string
Title:
State
Maximum Length:60
The name of the state provided in the resource's address. -
TimezoneCode: string
Title:
Time Zone Code
Maximum Length:64
The code for the time zone of the resource. -
Title: string
Title:
Title
Maximum Length:60
The title preceding the name of the resource. -
TopResourceFlag: boolean
Title:
Root Resource
Default Value:false
Indicates whether the resource is top user in hierarchy. -
UpdateFlag: boolean
Title:
Update Access
Read Only:true
Indicates if the user can update the resource. -
Username: string
Title:
User Name
Read Only:true
The user name or account name, used for login, of the resource user. -
UserStatus: string
Title:
User Account Status
Maximum Length:255
Indicates the the status of the user account for the resource. The supported values are A for active and S for suspended. The status is set to A for new accounts. -
WorkPhoneCountryCode: string
Title:
Phone Country Code
Maximum Length:10
The country code associated with the work phone.
array
Links
array
Resource Role Assignments
object
-
href: string
Title:
hyperlink reference
The URI to the related resource. -
kind: string
Title:
kind
Allowed Values:[ "collection", "item", "describe", "other" ]
The kind of the related resource. -
name: string
Title:
name
The name of the link to the related resource. -
properties: object
properties
-
rel: string
Title:
relation
Allowed Values:[ "self", "lov", "parent", "canonical", "child", "enclosure", "action", "custom" ]
The name of the relation to the resource instance. Example: self.
object
-
changeIndicator: string
Change indicator or the ETag value of the resource instance.
object
-
EndDateActive: string
(date)
Title:
To Date
The date when the resource role becomes inactive. -
links: array
Links
Title:
Links
The link relations associated with the resource instance. -
PartyName: string
Title:
Resource
Maximum Length:360
The name of the party. -
RoleCode: string
Read Only:
true
Maximum Length:30
The value of the code for the role assigned to the resource. -
RoleId: integer
Title:
Role
The unique identifier of the role. -
RoleRelateId: integer
Read Only:
true
Role Relation identifier (PK) -
RoleResourceId: integer
The unique identifier of the resource role.
-
StartDateActive: string
(date)
Title:
From Date
The date when the resource role become active.
array
Links
- FaxCountryCodeVA
-
The following properties are defined on the LOV link relation:
- Source Attribute: FaxCountryCode; Target Attribute: PhoneCountryCode
- Display Attribute: PhoneCountryCode, TerritoryShortName
- MobilePhoneCountryCodeVA
-
The following properties are defined on the LOV link relation:
- Source Attribute: MobilePhoneCountryCode; Target Attribute: PhoneCountryCode
- Display Attribute: PhoneCountryCode, TerritoryShortName
- ResourceRoleAssign
-
Operation: /crmRestApi/resources/11.13.18.05/resourceUsers/{resourceUsersUniqID}/child/ResourceRoleAssignParameters:
- resourceUsersUniqID:
$request.path.resourceUsersUniqID
The resource role assignments resource is used to view the role assigned to a resource, such as implementer, reseller, and so on. - resourceUsersUniqID:
- WorkPhoneCountryCodeVA
-
The following properties are defined on the LOV link relation:
- Source Attribute: WorkPhoneCountryCode; Target Attribute: PhoneCountryCode
- Display Attribute: PhoneCountryCode, TerritoryShortName
Examples
Note:
When you add roles to resources without a start date, the start date is set to the hire date of the resource.
cURL Command
curl --user sales_cloud_user -X PATCH -d
@example_request_payload.json
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/resourceUsers/
Example of Request Body
The following example shows the contents of the request body in JSON format.
{ "LegalEntity": "Vision Corporation", "BusinessUnit": "Vision Corporation Enterprise", "FirstName": "ABC", "LastName": "20200717_1706", "Title":"MR.", "ResourceEmail": "ABC_20200717_1706@oracle.com", "PersonType": "EMP", "HireDate": "2007-05-01", "ResourceStartDate": "2007-05-01", "Username": "ABC_20200717_1706@oracle.com", "IndividualRoleCode": "SALES_MANAGER" }
Example of Response Body
The following shows the contents of the response body in JSON format.
{ "ResourceProfileId": 300100185303175, "PartyName": "ABC 20200717_1706", "LastUpdateDate": "2020-07-20T07:31:31.019+00:00", "LastUpdatedBy": "sales_admin", "CreationDate": "2020-07-20T07:31:27.001+00:00", "CreatedBy": "sales_admin", "ResourceType": null, "FormattedAddress": null, "TimezoneCode": null, "Username": "ABC_20200717_1706@oracle.com", "City": null, "Country": null, "PostalCode": null, "UpdateFlag": "true", "DeleteFlag": "false", "ResourceOrgRoleCode": null, "ResourceOrgRoleName": null, "FirstName": "ABC", "LastName": "20200717_1706", "MiddleName": null, "Title": "MR.", "ResourcePartyNumber": "CDRM_885912", "State": null, "ResourceEmail": "ABC_20200717_1706@oracle.com", "WorkPhoneCountryCode": null, "RawWorkPhoneNumber": null, "MobilePhoneCountryCode": null, "RawMobilePhoneNumber": null, "FaxCountryCode": null, "RawFaxNumber": null, "AddressLine1": null, "AddressLine2": null, "ResourceStartDate": "2007-05-01", "ResourceEndDate": "4712-12-31", "ResourcePartyId": 300100185303176, "ResourceOrganizationName": null, "ResourceOrganizationUsage": null, "ResourceOrgMemRoleEndDate": null, "ResourceParentOrganizationName": null, "ResourceOrgManagerEmail": null, "ResourceManagerName": null, "ResourceManagerFirstName": null, "ResourceManagerLastName": null, "HRManagerEmailAddress": null, "HireDate": "2007-05-01", "ResourceOrgMemRoleStartDate": null, "IndividualRoleCode": "SALES_MANAGER", "IndividualRoleStartDate": null, "IndividualRoleEndDate": null, "ResourceManagerPartyNumber": null, "County": null, "Province": null, "ResourceManagerPartyId": null, "TopResourceFlag": false, "PersonNumber": null, "BusinessUnit": "Vision Corporation Enterprise", "LegalEntity": "Vision Corporation", "JobCode": null, "JobTitle": null, "UserStatus": null, "PersonType": "EMP", "CreateUserAccountFlag": true, "__ORACO__DistributionCentre_Id_c": null, "__ORACO__DistributionCentre_c": null, "__ORACO__Segment_c": null, "links": [ { "rel": "self", "href": "https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/resourceUsers/CDRM_885912", "name": "resourceUsers", "kind": "item", "properties": { "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000009770400000009737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B0200007870000000017371007E0002000000017371007E0002000000027372001B6F7261636C652E6A626F2E646F6D61696E2E4E756C6C56616C75655899C1C58DAABEEB02000149000A6D53514C54797065496478700000000C71007E000871007E00087371007E00020000000171007E000871007E000878" } },... }
Note:
When you are creating a new resource user, the CreateUserAccountFlag controls the user account creation for the resource. The default value for CreateUserAccountFlag is Y. If the flag is set to N, then the role provisioning is suppressed.Note:
The default value of UserStatus is A. You should not include it in the post payload. To suspend a user, update the UserStatus to S using PATCH.Create an Internal Resource without an User Account
The following example shows how to create an internal resource without an user account by submitting a POST request on the REST resource using cURL. For more such example see Manage Sales Resource Lifecycle.
cURL Command
curl --user sales_cloud_user -X POST -d
@example_request_payload.json
https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.19.01/resourceUsers
Example of Request Body
The following shows the contents of the request body in JSON format.
{ "FirstName":"Katty", "LastName":"Smith", "ResourceEmail":"katty.smith@dnd.vision.com", "HireDate":"2018-08-20", "LegalEntity":"Vision Corporation", "BusinessUnit":"Vision Corporation Enterprise", "HRManagerEmailAddress" : "HR.Manager@dnd.vision.com", "ResourceOrgRoleCode":"SALES_MANAGER", "ResourceParentOrganizationName" : "HRManager_Org", "ResourceOrganizationName" : "kSmithOrg", "RawWorkPhoneNumber" : "6504461212", "AddressLine1" : "100 Oracle Parkway", "City" : "Redwood City", "State" : "CA", "PostalCode" : "944065", "Country" : "US", "ResourceStartDate" : "2018-12-05", "CreateUserAccountFlag" : "N" }
Example of Response Body
The following shows the contents of the response body in JSON format.
{ "PartyName": "Katty Smith", "ResourceType": "INDIVIDUAL", "FormattedAddress": "100 Oracle Parkway,REDWOOD CITY, CA 944065", "City": "Redwood City", "Country": "US", "PostalCode": "944065", "FirstName": "Katty", "LastName": "Smith", "ResourcePartyNumber": "Conta855676", "State": "CA", "ResourceEmail": "katty.smith@dnd.vision.com", "RawWorkPhoneNumber": "6504461212", "RawMobilePhoneNumber": null, "RawFaxNumber": null, "AddressLine1": "100 Oracle Parkway", "ResourceOrganizationName": "KSmithOrg", "ResourceOrganizationUsage": "SALES_RESOURCE_ORG", "ResourceOrgMemRoleEndDate": "4712-12-31", "ResourceOrgRoleCode":"SALES_MANAGER", "ResourceParentOrganizationName" : "HRManager_Org", "ResourceManagerFirstName": "Phil", "ResourceManagerLastName": "Gioco", "HRManagerEmailAddress": "HR.Manager@dnd.vision.com", "HireDate": "2018-08-20", "ResourceOrgMemRoleStartDate": "2018-08-20", "ResourceManagerPartyNumber": "100010034246635", "ResourceManagerPartyId": 100010034246635, "PersonNumber": "300100159661235", "BusinessUnit": "Vision Corporation Enterprise", "LegalEntity": "Vision Corporation", "UserStatus": "A", "PersonType": "EMP", "CreateUserAccountFlag": "N", ... }