Identify and Display the Data Your Users Want

Earlier, users searched for what they were looking for by following a navigation path. However, applications now are expected to understand the user and provide relevant data customized for the user. You can use the User Context REST resources to identify and display the data your users want. It shows data by tracking and scoring what is relevant to a user, which in turn drives navigation and search.

The User Context service uses pre-seeded metadata and rules to calculate and assign a relevancy score for each User, Object Type, and Object. The supported objects are Accounts, Activities, Contacts, Leads, Opportunities, Partners, Products, and Product Groups.

For example, Gabriel is a sales representative who is expected to work on a handful of opportunities. The system helps Gabriel by displaying the top 10 relevant Opportunities that he may be interested in. The top 10 Opportunities for the User could be

  • Opportunities that Gabriel was working on for the last two weeks
  • Opportunities that are expected to be closed in the current quarter

This saves Gabriel the time and effort that he would spend on searching for opportunities.

Note:

The relevant opportunities would differ for a Sales Operations User and a Sales Manager.

In this use case, we will use User Relevant Items REST API to

  • Find User Relevant Items
  • Find and Update User Context Data Sources
  • Find and Update User Context Object Types

How to Find User Relevant Items

You can use the User Relevant Items resource to fetch relevant items for users. When you call the service and perform the GET all user Relevant items, you will see a complete list of all relevant items for a given user, list of accounts, contacts, Opty's, Leads, Products etc.

To get the list of relevant items, submit a GET request on the URL for User Relevant Items.

cURL Command

curl --user sales_cloud_user https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userRelevantItems

Example of Response Body

The following shows the contents of the response body in JSON format.

{
    "items": [
        {
            "RelevantItemId": 300100186064807,
            "UserGUID": "352E980CE9686C4EF1E2CD35987EF86C",
            "UserPartyNumber": "100010037456865",
            "ObjectTypeCode": "Account",
            "Score": 148,
            "ObjectId": 300100186039341,
            "ObjectNumber": "CDRM_903991",
            "LastActivityDate": "2020-09-07T06:11:53+00:00",
            "links": [
                {
                    "rel": "self",
                    "href": "https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userRelevantItems/300100186064807",
                    "name": "userRelevantItems",
                    "kind": "item",
                    "properties": {
                        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000001378"
                    }
                },
                {
                    "rel": "canonical",
                    "href": "https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userRelevantItems/300100186064807",
                    "name": "userRelevantItems",
                    "kind": "item"
                },
                {
                    "rel": "child",
                    "href": "https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userRelevantItems/300100186064807/child/UserRelevantItemDetail",
                    "name": "UserRelevantItemDetail",
                    "kind": "collection"
                }
            ]
        },
        {
            "RelevantItemId": 300100186130977,
            "UserGUID": "352E980CE9686C4EF1E2CD35987EF86C",
            "UserPartyNumber": "100010037456865",
            "ObjectTypeCode": "Account",
            "Score": 148,
            "ObjectId": 300100186130805,
            "ObjectNumber": "CDRM_906998",
            "LastActivityDate": "2020-09-07T13:20:38+00:00",
...
}

You can narrow down your search by submitting a GET request with the specific User Relevant Item Id.

cURL Command

curl --user sales_cloud_user https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userRelevantItems/300100211439617

Example of Response Body

The following shows the contents of the response body in JSON format.

{
    "RelevantItemId": 300100211439617,
    "UserGUID": "C207BB06AFF8AC902FC7F9803EB6EB49",
    "UserPartyNumber": "100010025532672",
    "ObjectTypeCode": "Contact",
    "Score": 150,
    "ObjectId": 300100211439573,
    "ObjectNumber": "CDRM_937837",
    "LastActivityDate": "2020-10-07T09:00:15.480+00:00",

...
}

You can also get the details for a particular user relevant item by submitting a GET request on the REST resource using cURL.

cURL Command

curl --user sales_cloud_user https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userRelevantItems/300100211439617 /child/UserRelevantItemDetail

Response Body

The following shows the contents of the response body in JSON format.

{
    "items": [
        {
            "RelevantItemDetailId": 300100211439618,
            "RelevantItemId": 300100211439617,
            "DataSourceCode": "FAVORITE",
            "Score": 150,
            "LastActivityDate": "2020-10-07T09:00:15.480+00:00",
            "UserGUID": "C207BB06AFF8AC902FC7F9803EB6EB49",
            "links": [
                {
                    "rel": "self",
                    "href": "https://fuscdrmsmc297-fa-ext.us.oracle.com:443/crmRestApi/resources/11.13.18.05/userRelevantItems/300100211439617/child/UserRelevantItemDetail/300100211439618",
                    "name": "UserRelevantItemDetail",
                    "kind": "item",
                    "properties": {
                        "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
                    }
                },
                {
                    "rel": "canonical",
                    "href": "https://fuscdrmsmc297-fa-ext.us.oracle.com:443/crmRestApi/resources/11.13.18.05/userRelevantItems/300100211439617/child/UserRelevantItemDetail/300100211439618",
                    "name": "UserRelevantItemDetail",
                    "kind": "item"
                },
                {
                    "rel": "parent",
                    "href": "https://fuscdrmsmc297-fa-ext.us.oracle.com:443/crmRestApi/resources/11.13.18.05/userRelevantItems/300100211439617",
                    "name": "userRelevantItems",
                    "kind": "item"
                }
            ]
        }
    ],
    "count": 1,
    "hasMore": false,
    "limit": 25,
    "offset": 0,
    "links": [
        {
            "rel": "self",
            "href": "https://fuscdrmsmc297-fa-ext.us.oracle.com:443/crmRestApi/resources/11.13.18.05/userRelevantItems/300100211439617/child/UserRelevantItemDetail",
            "name": "UserRelevantItemDetail",
            "kind": "collection"
        }
    ]
}

For more information see User Relevant Items.

How to Find and Update User Context Data Sources

You can use the User Context Data Sources resource to view and update the user context data sources. As an Admin user you can select which Data Sources are important to include for your User Context Relevancy Engine calculation and scoring. For some customers Favorites play a huge role compared to just Recent Items. The admin users can enable or disable data sources as they deem appropriate to have the engine focus on scoring only what is relevant to their needs and user context.

To get the list of user context data sources, submit a GET request on the REST resource using cURL.

cURL Command

curl --user sales_cloud_user https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userContextDataSources

Example of Response Body

The following shows the contents of the response body in JSON format.

{
  "items": [
    {
      "DataSourceCode": "FAVORITE",
      "Enabled": "Y",
      "CreationDate": "2019-11-25T17:10:17+00:00",
      "CreatedBy": "SEED_DATA_FROM_APPLICATION",
      "LastUpdateDate": "2019-11-25T17:10:17.062+00:00",
      "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
      "LastUpdateLogin": "-1",
      "ObjectVersionNumber": 1,
      "links": [
        {
          "rel": "self",
          "href": "https://Host:Port/crmRestApi/resources/11.13.18.05/userContextDataSources/FAVORITE",
          "name": "userContextDataSources",
          "kind": "item",
          "properties": {
            "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
          }
        },
        {
          "rel": "canonical",
          "href": "https://Host:Port/crmRestApi/resources/11.13.18.05/userContextDataSources/FAVORITE",
          "name": "userContextDataSources",
          "kind": "item"
        }
      ]
    },
    {
      "DataSourceCode": "RI",
      "Enabled": "Y",
      "CreationDate": "2019-11-25T17:10:17.080+00:00",
      "CreatedBy": "SEED_DATA_FROM_APPLICATION",
      "LastUpdateDate": "2019-11-25T17:10:17.086+00:00",
      "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
      "LastUpdateLogin": "-1",
      "ObjectVersionNumber": 1,
      "links": [
        {
          "rel": "self",
          "href": "https://Host:Port/crmRestApi/resources/11.13.18.05/userContextDataSources/RI",
          "name": "userContextDataSources",
          "kind": "item",
          "properties": {
            "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
          }
        },
        {
          "rel": "canonical",
          "href": "https://Host:Port/crmRestApi/resources/11.13.18.05/userContextDataSources/RI",
          "name": "userContextDataSources",
          "kind": "item"
        }
      ]
    },
    {
      "DataSourceCode": "RI_PICKER",
      "Enabled": "Y",
      "CreationDate": "2019-11-25T17:10:17.095+00:00",
      "CreatedBy": "SEED_DATA_FROM_APPLICATION",
      "LastUpdateDate": "2019-11-25T17:10:17.099+00:00",
      "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
      "LastUpdateLogin": "-1",
      "ObjectVersionNumber": 1,
      "links": [
        {
          "rel": "self",
          "href": "https://Host:Port/crmRestApi/resources/11.13.18.05/userContextDataSources/RI_PICKER",
          "name": "userContextDataSources",
          "kind": "item",
          "properties": {
            "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000178"
          }
        },
        {
          "rel": "canonical",
          "href": "https://Host:Port/crmRestApi/resources/11.13.18.05/userContextDataSources/RI_PICKER",
          "name": "userContextDataSources",
          "kind": "item"
        }
      ]
    }
  ],
  "count": 3,
  "hasMore": false,
  "limit": 25,
  "offset": 0,
  "links": [
    {
      "rel": "self",
      "href": "https://Host:Port/crmRestApi/resources/11.13.18.05/userContextDataSources",
      "name": "userContextDataSources",
      "kind": "collection"
    }
  ]
}

To Update a User Context Data Source, submit a PATCH request on the REST resource using cURL.

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/userContextDataSources/FAVORITE

Example of Request Body

The following shows the contents of the request body in JSON format.

{
"Enabled" : "Y"
}

Example of Response Body

The following shows the contents of the response body in JSON format.

{
    "DataSourceCode": "FAVORITE",
    "Enabled": "Y",
    "CreationDate": "2019-11-29T21:54:37+00:00",
    "CreatedBy": "SEED_DATA_FROM_APPLICATION",
    "LastUpdateDate": "2020-10-13T08:39:41+00:00",
    "LastUpdatedBy": "SALES_ADMIN",
    "LastUpdateLogin": "B06943A3DB08FE9AE05369B3F20A5B58",
    "ObjectVersionNumber": 3,
...
}

For more information see User Context Data Sources.

How to Find and Update User Context Object Types

You can use the user context object types resource to view and update user context object types. For certain organizations, Accounts and Opty's might be more relevant than Leads. In those situations as an admin user you can choose to enable or disable relevancy engine scoring and feed for certain objects.

You can also use the following child REST APIs of User Context Data Sources:

They allow you to maintain the object and data source configuration and mapping. They can also be used to determine the criteria to query the elastic data store and workspace saved searches.

To get the list of a User Context Data Sources, submit a GET request on the REST resource using cURL.

cURL Command

curl --user sales_cloud_user https://servername.fa.us2.oraclecloud.com/crmRestApi/resources/11.13.18.05/userContextObjectTypes

Example of Response Body

The following shows the contents of the response body in JSON format.

{
    "items": [
        {
            "ObjectTypeCode": "CRMProduct",
            "Enabled": "Y",
            "CreationDate": "2020-03-16T17:26:50.053+00:00",
            "CreatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateDate": "2020-10-13T08:55:53+00:00",
            "LastUpdatedBy": "SALES_ADMIN",
            "LastUpdateLogin": "B1807D2E569D4C47E053D711F10A50BD",
            "ObjectVersionNumber": 5,
             ...
          },
{
            "ObjectTypeCode": "CRMProductGroup",
            "Enabled": "Y",
            "CreationDate": "2020-03-16T17:26:50.053+00:00",
            "CreatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateDate": "2020-06-16T07:31:53.640+00:00",
            "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateLogin": "-1",
            "ObjectVersionNumber": 1,
        
...
        },
{
            "ObjectTypeCode": "Account",
            "Enabled": "Y",
            "CreationDate": "2019-12-19T13:18:27.526+00:00",
            "CreatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateDate": "2020-06-16T07:31:53.640+00:00",
            "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateLogin": "-1",
            "ObjectVersionNumber": 1,
        
...
    },
{
            "ObjectTypeCode": "Activity",
            "Enabled": "Y",
            "CreationDate": "2019-12-19T13:18:27.526+00:00",
            "CreatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateDate": "2020-06-16T07:31:53.640+00:00",
            "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateLogin": "-1",
            "ObjectVersionNumber": 1,
        
...
     },
{
            "ObjectTypeCode": "Contact",
            "Enabled": "Y",
            "CreationDate": "2019-12-19T13:18:27.526+00:00",
            "CreatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateDate": "2020-06-16T07:31:53.640+00:00",
            "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateLogin": "-1",
            "ObjectVersionNumber": 1,
        
...
     },
{
            "ObjectTypeCode": "Lead",
            "Enabled": "Y",
            "CreationDate": "2019-12-19T13:18:27.526+00:00",
            "CreatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateDate": "2020-06-16T07:31:53.640+00:00",
            "LastUpdatedBy": "SEED_DATA_FROM_APPLICATION",
            "LastUpdateLogin": "-1",
            "ObjectVersionNumber": 1,
        
...
     }
}  

To update a User Context Object Type, submit a PATCH request on the REST resource using cURL.

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/userContextObjectTypes/CRMProduct

Example of Request Body

The following shows the contents of the request body in JSON format.

{
"Enabled": "Y"
}

Example of Response Body

The following shows the contents of the response body in JSON format.

    "ObjectTypeCode": "CRMProduct",
    "Enabled": "Y",
    "CreationDate": "2020-03-16T17:26:50.053+00:00",
    "CreatedBy": "SEED_DATA_FROM_APPLICATION",
    "LastUpdateDate": "2020-10-13T08:55:53+00:00",
    "LastUpdatedBy": "SALES_ADMIN",
    "LastUpdateLogin": "B1807D2E569D4C47E053D711F10A50BD",
    "ObjectVersionNumber": 5,

...
}

For more information see User Context Object Types.