How to implement Ticketing on Salesforce?

In order to implement Ticketing on Salesforce, you need to move to your Haptik bot, and follow the steps as mentioned below.

Create case(ticket) in Salesforce

Every time the bot hits your Salesforce app, a new case gets generated.

To generate a new case during the bot and user conversation, you should use the CURL request below. Add the python request format of this CURL at any point in the user journey, where you want to have this ticketing functionality. You will have to create a Code Step and add the following CURL to it. 

curl --location --request POST '<BASE_URL>/third_party_integrations/v1/salesforce/create/' \
--header 'username: “put the email id using which you login to SF”
--header 'clientid: “put the consumer key here”
--header 'privatekey: “put the base64 encoded host.key file content here”
--header 'Content-Type: application/json' \
--data-raw '{
      "Description": “value”,
      "Subject": “value”,
      "Type": “value”,
      "Reason": "value",
      "SuppliedEmail": "value",
      "SuppliedName": "value",
      "SuppliedPhone": "value",
      "Priority": "value"
    }'

Now, in order to retrieve the details of the cases, that have been created, the URL will change to <BASE_URL>/third_party_integrations/v1/salesforce/get_data/, and by using the GET method, pass below parameters in the payload -

{
  "object_type": "Case",
  "object_id": "id value"
}

Below is the CURL command to get the Case details from Salesforce - 

curl --location --request GET 'https://<BASE_URL>/third_party_integrations/v1/salesforce/get_data/?object_type=Case&object_id=<id value>'
--header 'username: <Username>' \
--header 'clientid: <Client Id>' \
--header 'privatekey: <Private Key>'

The response will contain various case attributes and values, as shown.

This is how you implement ticketing on Salesforce.

Can’t find what you’re looking for? Email us at support@haptik.ai.