I’m unable to understand why it fails to connect with backend using webhook. Here’s my fastapi code :
@app.post(“/”)
async def handle_request(request: Request):
# Retrieve the JSON data from the request
payload = await request.json()
# Extract the necessary information from the payload
#based on the structure of the WebhookRequest from Dialogflow
intent = payload['queryResult']['intent']['displayName']
parameters = payload['queryResult']['parameters']
output_contexts = payload['queryResult']['outputContexts']
if intent == "track.order - context: ongoing-tracking":
return JSONResponse(content={
"fulfillmentText": f"Received =={intent}== in the backend. "
})
The error is happening in the intent “track.order – context: ongoing-tracking” , that I have created in the dialogflow.
I have convert HTTP to HTTPS and I also used recent https url but still
I am trying to make a webhook request from dialogflow to my rest api, which runs in python fastapi and ngrok. But it is not working
I use fulfillment in the intent “track.order – context: ongoing-tracking”, and I should get fulfillment message “Received =={intent}== in the backend. ” instead I am getting default intent message.
RealCoder is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.