Hi Team, I’m able to get responses as expected in slack from my rasa server for responses which don’t don’t include hitting any other api endpoint. So, basically, responses for ‘Hi’, ‘goodbye’, etc. are being seen properly in slack without any issue. Apart from them, responses for custom actions which don’t require hitting some api endpoint are also being seen properly. Now, my problem is whenever I try to fetch a response in slack which reequires hitting an api/url in custom actions, I get 201 created status code from ngrok and no ‘200 OK’ status as shown in the following screenshot -
This problem persists when I’m trying to run the following custom action -
class ActionSlackWorkflowExecution(Action):
def name(self) -> Text:
return "action_slack_workflow_execution"
def run(
self,
dispatcher: CollectingDispatcher,
tracker: Tracker,
domain: Dict[Text, Any],
) -> List[Dict]:
slack_instance_name = tracker.get_slot('instanceName')
print('slack instance name: ',slack_instance_name)
slack_action_name = tracker.get_slot('actionName')
print('slack action name: ',slack_action_name)
data2 = {}
data2["instanceName"]=slack_instance_name
data2["actionName"]=slack_action_name
data = {}
data["ttdCustomerId"]="102"
data["processType"]="dev"
data["userId"]='144432'
data["variables"]=data2
# Note: don't change ttdCustomerId, processType, processType and userID here to test.
jsonData = json.dumps(data)
print("Json Data:",jsonData)
dispatcher.utter_message(text=f"JSON formed: {jsonData}")
API_ENDPOINT2 = 'https://xxxxxxxxxxxxxxxx/api/executeworkflow'
r2 = requests.post(url = API_ENDPOINT2, data = jsonData, headers=apiHeader)
a= r2.json()
print(a)
dispatcher.utter_message(json_message=a)
instanceid=a['workflowInstanceId']
print("Workflow Instance ID: ",instanceid)
dispatcher.utter_message(text=instanceid)
dispatcher.utter_message(text="Your workflow is now under execution.")
dispatcher.utter_message(text=f"The workflowInstanceID is {instanceid}. You can use this instance ID to check the status of your workflow.")
I get no response for this in my slack app at the frontend. Need help. Thanks!