Create a resource user

post

/crmRestApi/resources/11.13.18.05/resourceUsers

Request

Header Parameters
  • 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".
  • 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.
  • 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.
Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
Show Source
Nested Schema : Resource Role Assignments
Type: array
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.
Show Source
Nested Schema : resourceUsers-ResourceRoleAssign-item-post-request
Type: object
Show Source
Back to Top

Response

Supported Media Types

Default Response

The following table describes the default response for this task.
Headers
  • 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".
  • 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.
Body ()
Root Schema : resourceUsers-item-response
Type: object
Show Source
Nested Schema : Resource Role Assignments
Type: array
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.
Show Source
Nested Schema : resourceUsers-ResourceRoleAssign-item-response
Type: object
Show Source
Back to Top

Examples

The following example shows how to create a resource user by submitting a POST request on the REST resource using cURL.

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",
...
}
Back to Top