Chilkat Online Tools

lianja / Salesforce Platform APIs / Relevant Items

Back to Collection Items

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loHttp = createobject("CkHttp")

// Adds the "Authorization: Bearer <access_token>" header.
loHttp.AuthToken = "<access_token>"
loHttp.SetRequestHeader("Content-Type","application/json")

loSbResponseBody = createobject("CkStringBuilder")
llSuccess = loHttp.QuickGetSb("https://domain.com/services/data/v{{version}}/sobjects/relevantItems",loSbResponseBody)
if (llSuccess = .F.) then
    ? loHttp.LastErrorText
    release loHttp
    release loSbResponseBody
    return
endif

? "Response status code = " + str(loHttp.LastStatus)
? loSbResponseBody.GetAsString()


release loHttp
release loSbResponseBody

Curl Command

curl -X GET
	-H "Authorization: Bearer <access_token>"
	-H "Content-Type: application/json"
https://domain.com/services/data/v{{version}}/sobjects/relevantItems

Postman Collection Item JSON

{
  "name": "Relevant Items",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{_endpoint}}/services/data/v{{version}}/sobjects/relevantItems",
      "host": [
        "{{_endpoint}}"
      ],
      "path": [
        "services",
        "data",
        "v{{version}}",
        "sobjects",
        "relevantItems"
      ],
      "query": [
        {
          "key": "lastUpdatedId",
          "value": "",
          "description": "Optional. Compares the entire current list of relevant items to a previous version, if available. Specify the lastUpdatedId value returned in a previous response.",
          "disabled": true
        },
        {
          "key": "sobjects",
          "value": "",
          "description": "Optional. To scope the results to a particular object or set of objects, specify the name for one or more sObjects.",
          "disabled": true
        },
        {
          "key": "sobject.lastUpdatedId",
          "value": "",
          "description": "Optional. Compares the current list of relevant items for this particular object to a previous version, if available. Specify the lastUpdatedId value returned in a previous response.\nNote\nYou can only specify this parameter for the sObjects specified in the sobjects parameter.",
          "disabled": true
        }
      ]
    },
    "description": "Gets the current user’s most relevant items. Relevant items include records for objects in the user’s global search scope and also most recently used (MRU) objects.\nRelevant items include up to 50 of the most recently viewed or updated records for each object in the user’s global search scope.\nNote\nThe user’s global search scope includes the objects the user interacted with most in the last 30 days, including objects the user pinned from the search results page in the Salesforce Classic.\n\nThen, the resource finds more recent records for each most recently used (MRU) object until the maximum number of records, which is 2,000, is returned.\nThis resource only accesses the relevant item information. Modifying the list of relevant items is not currently supported\nhttps://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_relevant_items.htm"
  },
  "response": [
  ]
}