Microsoft Dynamics 365

Create Dynamics 365 Case

Logs a new support case for a contact in Dynamics 365.

Unverified

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

What the model is told

Create a support case in Dynamics 365 for an existing contact. Get an access token first if you do not have one. Find the contactid first with Find Dynamics 365 Contact by Email. Summarise the issue in the title and give the detail in the description, and confirm both with the customer. Returns the case including its ticketnumber, which you should tell the customer.

Request

POSThttps://YOUR_ORG.crm.dynamics.com/api/data/v9.2/incidents?$select=incidentid,ticketnumber,title

Headers

  • AuthorizationBearer {{accessToken}}
  • OData-MaxVersion4.0
  • OData-Version4.0
  • Acceptapplication/json
  • Content-Typeapplication/json; charset=utf-8
  • Preferreturn=representation

Body

{
  "title": "{{title}}",
  "description": "{{description}}",
  "caseorigincode": 3,
  "customerid_contact@odata.bind": "/contacts({{contactId}})"
}

Parameters

  • contactId stringThe contactid GUID of the customer, from Find Dynamics 365 Contact by Email.
  • title stringA short summary of the issue.
  • description stringThe full detail of the issue as the customer described it.
  • accessToken stringThe access_token value returned by Get Dynamics 365 Access Token. Reuse it for the rest of the conversation.

Engage payload

{
  "source": "VOICE_AI",
  "tool": {
    "id": "b8300fb1-b40d-42a8-bdbc-f1954edadd11",
    "type": "HTTP_REQUEST",
    "label": "Create Dynamics 365 Case",
    "name": "create_dynamics_365_case",
    "customName": false,
    "description": "Create a support case in Dynamics 365 for an existing contact. Get an access token first if you do not have one. Find the contactid first with Find Dynamics 365 Contact by Email. Summarise the issue in the title and give the detail in the description, and confirm both with the customer. Returns the case including its ticketnumber, which you should tell the customer.",
    "parameters": [
      {
        "name": "contactId",
        "type": "string",
        "description": "The contactid GUID of the customer, from Find Dynamics 365 Contact by Email."
      },
      {
        "name": "title",
        "type": "string",
        "description": "A short summary of the issue."
      },
      {
        "name": "description",
        "type": "string",
        "description": "The full detail of the issue as the customer described it."
      },
      {
        "name": "accessToken",
        "type": "string",
        "description": "The access_token value returned by Get Dynamics 365 Access Token. Reuse it for the rest of the conversation."
      }
    ],
    "config": {
      "endpoint": {
        "method": "POST",
        "url": "https://YOUR_ORG.crm.dynamics.com/api/data/v9.2/incidents?$select=incidentid,ticketnumber,title"
      },
      "headers": [
        {
          "name": "Authorization",
          "value": "Bearer {{accessToken}}"
        },
        {
          "name": "OData-MaxVersion",
          "value": "4.0"
        },
        {
          "name": "OData-Version",
          "value": "4.0"
        },
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "Content-Type",
          "value": "application/json; charset=utf-8"
        },
        {
          "name": "Prefer",
          "value": "return=representation"
        }
      ],
      "body": "{\n  \"title\": \"{{title}}\",\n  \"description\": \"{{description}}\",\n  \"caseorigincode\": 3,\n  \"customerid_contact@odata.bind\": \"/contacts({{contactId}})\"\n}",
      "timeout": null
    }
  }
}

IDs are regenerated on every copy.