Sending templates with no content variables results in TwilioRestException and Content Variables are invalid

Open
#892 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
api

Research direction

Start by reproducing the documented client.messages.create call with a fully populated call_to_action template that has no variables. Trace how content_sid and Content Variables are sent to Twilio, then verify that a variable-free template succeeds without the invalid-parameter error.

Written by the indexing model from the issue text.

Description

Hi there!

I have created a template on Twilio that is fully filled out. It is a call_to_action template with buttons that lead to links. I have filled in everything and don't have any variables in the template. When I try and send the template to a user as a response using:

message = client.messages.create(
    content_sid=template_sid,
    from_=from_no,
    to=to
)

I get an error:

TwilioRestException: HTTP 400 error: Unable to create record: The Content Variables parameter is invalid.

I have tried to see what could be the reason for this but I can't find anything on why this is happening.

Dominant language
Python
Stars
2.1k
Forks
815
Avg merge
2d 13h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from twilio/twilio-python

All issues in twilio/twilio-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.