Salesforce

Add Comment to Salesforce Case

Adds a comment to an existing case.

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. Add a comment to an existing case, for example extra detail the customer has just given you. You need the case record ID, so use Get Salesforce Case by Number first. Confirm the wording with the customer. Returns the new comment ID in the id field, with success set to true.

Request

POSThttps://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/sobjects/CaseComment

Headers

  • Content-Typeapplication/json
  • AuthorizationBearer {{accessToken}}

Body

{
  "ParentId": "{{caseId}}",
  "CommentBody": "{{comment}}",
  "IsPublished": false
}

Parameters

  • caseId stringThe Salesforce record ID of the case, from Get Salesforce Case by Number.
  • comment stringThe comment text, up to 4,000 bytes.
  • 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": "aecb9cec-aa5b-410e-8919-607a4fa3b203",
    "type": "HTTP_REQUEST",
    "label": "Add Comment to Salesforce Case",
    "name": "add_comment_to_salesforce_case",
    "customName": false,
    "description": "Get a Salesforce access token first if you do not already have one. Add a comment to an existing case, for example extra detail the customer has just given you. You need the case record ID, so use Get Salesforce Case by Number first. Confirm the wording with the customer. Returns the new comment ID in the id field, with success set to true.",
    "parameters": [
      {
        "name": "caseId",
        "type": "string",
        "description": "The Salesforce record ID of the case, from Get Salesforce Case by Number."
      },
      {
        "name": "comment",
        "type": "string",
        "description": "The comment text, up to 4,000 bytes."
      },
      {
        "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": "POST",
        "url": "https://YOUR_INSTANCE.my.salesforce.com/services/data/v67.0/sobjects/CaseComment"
      },
      "headers": [
        {
          "name": "Content-Type",
          "value": "application/json"
        },
        {
          "name": "Authorization",
          "value": "Bearer {{accessToken}}"
        }
      ],
      "body": "{\n  \"ParentId\": \"{{caseId}}\",\n  \"CommentBody\": \"{{comment}}\",\n  \"IsPublished\": false\n}",
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.