Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending media as chat participant, Conversations API #596

Open
AleksaPetrovicRBT opened this issue Mar 29, 2022 · 1 comment
Open

Sending media as chat participant, Conversations API #596

AleksaPetrovicRBT opened this issue Mar 29, 2022 · 1 comment
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap

Comments

@AleksaPetrovicRBT
Copy link

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
@childish-sambino
Copy link
Contributor

This issue has been added to our internal backlog to be prioritized. Pull requests and +1s on the issue summary will help it move up the backlog.

@childish-sambino childish-sambino added type: community enhancement feature request not on Twilio's roadmap status: help wanted requesting help from the community labels Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: help wanted requesting help from the community type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

No branches or pull requests

2 participants