1
votes

I am creating a whatsapp conversational bot. I am trying to accept location via whatsapp.

For this, I have created a tasks with statically generated actions in a autopilot project.

{
    "actions": [
        {
            "collect": {
                "name": "collect_info",
                "questions": [
                    {
                        "question": "Please upload your location details?",
                        "name": "location_data"
                    }
                ],
                "on_complete": {
                    "redirect": "path-to-fn/locate"
                }
            }
        }
    ]
}

Redirect path points to a nodejs function, where I am deriving value like this -

const location = memory.twilio.collected_data.collect_info.answers.location_data.answer;

Issue is, on whatsapp when I am supplying current location, bot is not giving any response in that case. It seems, the "collect" is not accepting the input(current location in whatsapp). However, if I provide any other input(like text, or image), then call is made to the redirect 'fn' as usual.

I want to know, how we can extract location inside a Autopilot static tasks?

Note that, via Twiml, I have found a way to accept location[https://www.twilio.com/blog/glorious-food], but the autopilot task/action way is not working.

Edit. Pasting Debug results here as well - Getting Error - 11200 Whenever I am uploading my location, It seems Twilio is forwarded the request with Latitude and Longitude params to the bot. But bot is responding with "Missing/Invalid Parameters" error.

{
    "code": 20001,
    "status": 400,
    "message": "Missing/Invalid Parameters"
}

Is it that, twilio autpilot doesn't support location right now? If yes,can someone suggest any other way to implement the same. I want to know, how we can extract location inside a Autopilot static tasks?

1

1 Answers

0
votes

I just encountered this also, My guess is that twilio autopilot doesn't support location sharing yet, I also checked to note that whatsapp indeed doesn't post anything in the Body field of the post request which might be a reason autopilot is unable to decode the task to run. Where you able to find a resolution or at least a work around