Sending media as chat participant, Conversations API
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start in twilio/base/domain.py and trace how client.media.v1 builds the media request URL. Confirm that creating Conversations media targets mcs.us1.twilio.com rather than media.twilio.com, and verify the reported 404 no longer occurs for the provided media upload call.
Written by the indexing model from the issue text.
Description
Issue Summary
Issue is that library is executing POST method onto url = https://media.twilio.com/v1/Services/<Service_SID>/Media instead of https://mcs.us1.twilio.com/v1/Services/<Service_SID>/Media. When I change URL in twilio/base/domain.py everything is working good.
Code Snippet
with open(os.getenv('PICTURE'), 'rb') as f:
file = f.read()
auth = account_sid + ":" + auth_token
auth_bytes = auth.encode("ascii")
base64_bytes = base64.b64encode(auth_bytes)
base64_string = "Basic " + base64_bytes.decode("ascii")
media = client.media.v1 \
.create(
method="POST",
headers=
{
"Content-Type": "image/png",
"Authorization": base64_string},
data=file,
uri="/Services/" + os.getenv('DEFAULT_SERVICE_SID') + "/Media")
Exception/Log
Error ::
HTTP 404 error: Unable to create record: The requested resource /Services/<Service_SID>/Media was not found
Technical details:
- twilio-python version: 7.8.0
- python version: 3.9
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 815
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from twilio/twilio-python
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
twilio/twilio-python#932 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
twilio/twilio-python#930 ·
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
twilio/twilio-python#925 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
twilio/twilio-python#916 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 65/100
twilio/twilio-python#883 · 1 comment ·
All issues in twilio/twilio-python
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·