Salesforce

Get Salesforce Case by Number

Checks the status of a case from its case number.

Unverified

Add this first. This tool needs an access token, so add Get Salesforce Access Token to the same bot. The bot calls it first and passes the token in.

What the model is told

Get a Salesforce access token first if you do not already have one. Look up a case by the case number the customer gives you. Returns a records array (see totalSize) with the record ID, subject, status and priority, or an empty records array if the number does not exist. Keep the record ID if you need to update the case.

Request

GEThttps://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/query?q=SELECT+Id,CaseNumber,Subject,Status,Priority+FROM+Case+WHERE+CaseNumber=%27{{caseNumber}}%27+LIMIT+1

Headers

  • AuthorizationBearer {{accessToken}}

Parameters

  • caseNumber stringThe case number as shown to the customer, including leading zeros.
  • accessToken stringThe access_token value returned by Get Salesforce Access Token. Reuse it for the rest of the conversation.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "da381286-8b93-47f0-9d23-728e77048cf0",
    "type": "HTTP_REQUEST",
    "label": "Get Salesforce Case by Number",
    "name": "get_salesforce_case_by_number",
    "customName": false,
    "description": "Get a Salesforce access token first if you do not already have one. Look up a case by the case number the customer gives you. Returns a records array (see totalSize) with the record ID, subject, status and priority, or an empty records array if the number does not exist. Keep the record ID if you need to update the case.",
    "parameters": [
      {
        "name": "caseNumber",
        "type": "string",
        "description": "The case number as shown to the customer, including leading zeros."
      },
      {
        "name": "accessToken",
        "type": "string",
        "description": "The access_token value returned by Get Salesforce Access Token. Reuse it for the rest of the conversation."
      }
    ],
    "config": {
      "endpoint": {
        "method": "GET",
        "url": "https://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/query?q=SELECT+Id,CaseNumber,Subject,Status,Priority+FROM+Case+WHERE+CaseNumber=%27{{caseNumber}}%27+LIMIT+1"
      },
      "headers": [
        {
          "name": "Authorization",
          "value": "Bearer {{accessToken}}"
        }
      ],
      "body": null,
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.