twilio-python
twilio-python copied to clipboard
Composition Hooks API attribute error
Issue Summary
When creating a composition hook it returns attribute error 'Video' object has no attribute 'Composition_Hook'.
Code Snippet
from twilio.rest import Client
client = Client(api_key_sid, api_key_secret)
compositionHook = client.video.compositionHooks.create(
friendlyName = 'MyFirstCompositionHook',
audio_sources = '*',
video_layout = {
'grid' : {
'video_sources': ['*']}},
status_callback = 'http://my.server.org/callbacks',
format='mp4')
print('Created Composition Hook with SID=%s' % (compositionHook.sid))
Exception/Log
AttributeError at /hook/
'Video' object has no attribute 'compositionHooks'
Request Method: POST
Request URL: http://127.0.0.1:8000/hook/
Django Version: 2.2.9
Python Executable: /Users/azeem/Documents/projects/directpads/env/bin/python
Python Version: 3.9.0
Python Path: ['/Users/azeem/Documents/projects/directpads/directpad-master', '/Library/Frameworks/Python.framework/Versions/3.9/lib/python39.zip', '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9', '/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload', '/Users/azeem/Documents/projects/directpads/env/lib/python3.9/site-packages']
Server time: Sun, 18 Jul 2021 10:30:02 -0500
### Technical details:
* twilio-python version: 6.62.0
* python version: 3.9.0
Hello @divergentsigns,
I was able to recreate your issue.
This was the code that ultimately worked for me:
client = Client(api_key_sid, api_key_secret)
compositionHook = client.video.composition_hooks.create(
friendly_name = 'MixingAllRoomAudiosHook',
audio_sources = '*',
status_callback = 'http://my.server.org/callbacks',
format='mp4')
print('Created Composition Hook with SID=%s' % (compositionHook.sid))
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.
With best regards,
Elmer
Our code samples have been updated to reflect the correct casing for composition hooks and friendly name in the PR linked above.