Skip to Content
Technical Articles

SAP CAI – Artificial Intelligence || Freshdesk Integration With SAP Chatbot For Support Projects

Pre-requisite

  • FreshDesk Login and understanding what is Freshdesk
  • SAP CAI – Conversation Artificial Intelligence

 

Introduction to SAP CAI

SAP CAI ( Conversation Artificial Intelligence ) which was earlier called as Recast.AI is a part of SAP “Intelligent Enterprise” portfolio . SAP CAI uses  Artificial Intelligence – Natural Language Processing.

(PS – this deals with the interaction between computers and humans using the natural language. The ultimate objective of NLP is to read, decipher, understand, and make sense of the human languages in a manner that is valuable)

To automate the business process mainly in customer support area and give on-time reply to the request from the users . SAP CAI says it includes Minimum or no coding experience to build your first Chat bot and it goes on deeper the more your explore here .

Why SAP Chat bot when we have Google Assistance , Alexa, Siri and Azure and many others ?

For the simple reasons –

  • Bots in any language- NLP capable of building human-like AI chat-bots in any language.
  • Easy to use -Simple UX, collaboration, Connection
  • Fastest time to market-SAP software suite, you can launch your bot in days

How to build your first chat bot –

You can go through this blog ; and see how the SAP first CAI can be build

You can not only build your first bot , but also connect to your Hana DB to fetch the data. For more details check this blog

 

Story Line – This is a Real Scenario from business

 

Business  are using a Support ticket tool ( Freshdesk in our scenario ) to request their SAP issue, this issue is reported against a Ticket number which user gets in return to track their reported issue.

To check their status / ask some information / or request some updates from the tickets ; there must be someone In-person must be available to answer their quires.

And Being a Support ticket ; the Support team sits on the other side of the world in different time zone Result ? – Business  have to wait long day for even getting the small updates .

 

SAP CAI and Fresh-desk Integration || Architecture –

 

 

Scenario –

Without SAP CAI

User Mr. Joao  – Raised a request to SAP Support team for a “Files” extraction which he needs to send to the customer .

After raising the request ,each time Joao has to wait for the support team to reply on his ticket or until the next day  when both time zone are in sync and they can connect and work on this issue.

The customer asked Joao for the status and progress on his “Files” extraction , this time Joao was out of office ; so he needs to get back to his desk, Login into the System , get the ticket status and reply back to the customer . Joao could only reply half of what customer asked i.e  the status of the ticket but not the progress or the work done as there was no support representative available at the time .

 

 

Here comes the SAP CAI to rescue and resolve on time requires .

With SAP CAI

User Mr. Joao  – Raised a request to SAP Support team for a some “Files ” extraction  which he needs to send to the customer .

After raising the request ,Joao knows that he has a AI support for answering all his queries .The customer asked Joao for the status and progress on his “Files” extraction ,  this time Joao was out of office again  , so connect with SAP CAI over this registered phone. He asked the Chat-bot AI  to give information of this ticket , To which Chat-bot replied with the real time data ,not only this , the chat bot give the Agent name who’s working on it and his contact details. ( PS – CAI is available on Skype for Business/ WhatsApp/ Facebook/ all applications )

 

This Time Joao Connect with SAP CAI  a 24*7 AI chat bot available to resolve the queries .

Chat-bot can be connect to any of the below social media apps –

 

How to Start with building Integration SAP CAI and Freshdesk

 

  1. Create your Chat bot from here
  2. Train your Intent so that it can understand and interact with human
  3. Create your own Skill
  4. Once you build your Skills there are 3 Tabs – Triggers , Requirements and Actions
  5. We set our Trigger to a Condition that , If any phrases from our intent is available in the given user quires , our skills get triggered –
  6. And we Set our Requirement where we tells the Bots to Identify the Number ( Ticket Number ) from the user given input
  7. In Action Tab we are going to define the “Webhook” call which will Call Freshdesk API
  8. Write Python Code on Visual Studio code IDE to achieve two things –
    • Call Freshdesk API with Authentication parameters And
    • Restructure the Response to fit for SAP CAI as the Freshdesk API response is not in the format which SAP CAI requires.
      from flask import Flask, request, jsonify 
      import requests
      import json 
      
      app = Flask(__name__) 
      port = '5000' 
      
      @app.route('/freshdesk', methods=['GET'])
      def freshdesk():
          ticket = request.args.get('ticket')
        
          api_key = "zahid1992@gmail.com"
          domain = "zahid1992"
          password = "Drowssap"
      
          # Id of the ticket to be updated
          ticket_id = ticket
      
          response = requests.get("https://"+ domain +".freshdesk.com/api/v2/tickets/"+ticket_id, auth = (api_key, password))
        
          r_json = response.json()
          print(r_json)
          return jsonify( 
              status=200, 
              replies=[{ 
              'type': 'text', 
              'content': {
                      "Ticket Number": ticket,
                      "Priority" : r_json.get('priority') ,
                      "Status" : r_json.get('status'),
                      "Ticket Description" : r_json.get('subject'),
                      "Ticket type" : r_json.get('type'), 
                  }
              
              }]
          ) 
      
      @app.route('/errors', methods=['POST']) 
      def errors(): 
        print(json.loads(request.get_data())) 
        return jsonify(status=200) 
       
      app.run(port=port)
  9. Now, Test your Chatbot –
  10. Let’s check the Freshdesk Ticket if the Chat-bot gives the correct response .

 

Here we have successfully Integrated the FRESHDESK and SAP CAI to help business get on time real information about the ticket using Rest API .

1 Comment
You must be Logged on to comment or reply to a post.