This Blog is written to help out the Beginners who are eager to Integrate the Qualtrics Survey to Chatbot using SAP CAI.
As there are many Blogs available where you can see how to Create a chatbot using CAI, Qualtrics Survey creation and Integration of Qualtrics Survey with Chatbot.
But I didn’t find – what are the steps we need to perform inorder the deploy the survey in SAP Cloud Platform(CF).
Here I’m going to give you a quick steps to deploy your Qualtrics Survey to SAP Cloud Platform.
- Qualtrics Survey ID
- Qualtrics ID API token
- DataCenter where this Qualtrics Survey is Published
- SAP Cloud Platform access with a space created
- SAP Cloud Platform API end point
- Cloud Foundry Command Line Interface (CLI)
Step-1: Publish Your Survey
Once you publish the Survey in Qualtircs – Will have the Survey ID & Data Center in the URL itself.In the below screenshot Highlighted the required parameters.
Where Data Center = “co1” and SurveyID = “SV_6WIK9TUT3XQRzJb” .
Step-2: Get Qualtrics API Token:
Path: Click on Profile Icon – Account Settings – Qualtics IDs
Here you will find the API Token related to your account.Below is the Screenshot for your reference
Step – 3: Login to your SAP Cloud Platform cockpit
Click your Global Account – Click on Cloud Foundary
Here you will see all the details related to your Subaccount. Check your API end point and also the Space(If not Created, Contact your admin to create one for your account)
Step – 5: Install Cloud Foundry Command Line Interface (CLI)
You can install SAP CF CLI from here
Step-6: Creation of Python Webhooks
Will Use the Qualtrics Conversational APIs to create python webhooks which are hosted on SAP
Cloud Platform (CF) to perform the following actions
- call the Qualtrics APIs and create a survey session,
- retrieve the questions and present it to the user
- reads to the answers and uses Qualtrics APIs to record the answer and move on the next question.
You can download the generic python webhook project from here.
- In the webhook project folder mentioned above, you will find a python file(Server.py).
- In this server.py file you will have a place holder to maintain Survey ID, Datacenter and Qualtrics API token which we got from Step-1 & Step-2
- In manifest.yml file, give a name to your application
- In requirements and runtime files, minimum required versions of Python, Json & Flasks are maintained inorder to deploy the survey in SAP Cloud Platform(CF)
Step-7: Push the file to SAP Cloud Platform(CF)
From Step-5 we have already installed Cloud Foundary Command line interface.
- Now open your command prompt(Run – Type cmd – enter)
- They type command cf login <cloud foundry API endpoint which we got in step-3>
- Once you hit enter, it will ask for API endpoint again(if logging in for the first time). Provide the same api endpoint which we got in step-3 and hit enter again.
- Now it will ask for Email and password(Your credentials to login SAP Cloud Platform)
- Once provide credentials are authenticated it will provide the option to select the org(if you have only org, it will be automatically picked else we need to provide the selection manually).
- In similar way we need to select the space also if we have multiple spaces in the selected Org.
- Once every thing is selected will get all the details like API endpoint logged in, User , Org and Space details.
- In cmd prompt (cd) change the path to place where the Python webhook project is stored in your local mission
- Now use the command cf push -f manifest yml <somename> and hit enter
- It will take couple of minutes to deploy your solution
- Once successfully deployed it will give you the details of Url, Buildpack, stack and other details.
- Generated url is urls: qualtrics-survey.cfapps.eu10.hana.ondemand.com
- You can also check in SAP Cloud platform that our application “QualtricsdeploytoSCP”(name given in Step-7 || Point -9) is up and running.
(External blog posts are already available explaining “How to integrate this Survey to CAI chatbot “using the Url and Survey ID we got from above steps mentioned)