Twilio Newbie, persistent_action 413 error

raghavendra_kamath_bc2b8b

Raghavendra Kamath

Posted on August 22, 2024

Twilio Newbie, persistent_action 413 error

I am using a trial account of twilio and have setup a webhook to respond to an incoming message with code that looks like this

client.messages.create(
from_='whatsapp:+14155XXX886',
to=user_phone,
body="Please select your gender:",
persistent_action=[
{
"type": "quick_reply",
"text": "Male",
"payload": "male"
},
{
"type": "quick_reply",
"text": "Female",
"payload": "female"
},
{
"type": "quick_reply",
"text": "Other",
"payload": "other"
}
]

Now I am getting an error like

File "/home/django-app/.virtualenvs/django-server/lib/python3.10/site-packages/twilio/base/version.py", line 465, in create
return self._parse_create(method, uri, response)
File "/home/django-app/.virtualenvs/django-server/lib/python3.10/site-packages/twilio/base/version.py", line 436, in _parse_create
raise self.exception(method, uri, response, "Unable to create record")
twilio.base.exceptions.TwilioRestException: HTTP 413 error: Unable to create record: Invalid record: [flowSteps[0].state.apiParameters.persistentActions size must be between 0 and 5]

size is 3 , then why am I getting this error?

💖 💪 🙅 🚩
raghavendra_kamath_bc2b8b
Raghavendra Kamath

Posted on August 22, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

What was your win this week?
weeklyretro What was your win this week?

November 29, 2024

Where GitOps Meets ClickOps
devops Where GitOps Meets ClickOps

November 29, 2024

How to Use KitOps with MLflow
beginners How to Use KitOps with MLflow

November 29, 2024

Modern C++ for LeetCode 🧑‍💻🚀
leetcode Modern C++ for LeetCode 🧑‍💻🚀

November 29, 2024