github.com/twilio/twilio-go@v1.20.1/rest/video/v1/docs/CompositionHooksApi.md (about) 1 # CompositionHooksApi 2 3 All URIs are relative to *https://video.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateCompositionHook**](CompositionHooksApi.md#CreateCompositionHook) | **Post** /v1/CompositionHooks | 8 [**DeleteCompositionHook**](CompositionHooksApi.md#DeleteCompositionHook) | **Delete** /v1/CompositionHooks/{Sid} | 9 [**FetchCompositionHook**](CompositionHooksApi.md#FetchCompositionHook) | **Get** /v1/CompositionHooks/{Sid} | 10 [**ListCompositionHook**](CompositionHooksApi.md#ListCompositionHook) | **Get** /v1/CompositionHooks | 11 [**UpdateCompositionHook**](CompositionHooksApi.md#UpdateCompositionHook) | **Post** /v1/CompositionHooks/{Sid} | 12 13 14 15 ## CreateCompositionHook 16 17 > VideoV1CompositionHook CreateCompositionHook(ctx, optional) 18 19 20 21 22 23 ### Path Parameters 24 25 This endpoint does not need any path parameter. 26 27 ### Other Parameters 28 29 Other parameters are passed through a pointer to a CreateCompositionHookParams struct 30 31 32 Name | Type | Description 33 ------------- | ------------- | ------------- 34 **FriendlyName** | **string** | A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. 35 **Enabled** | **bool** | Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. 36 **VideoLayout** | [**interface{}**](interface{}.md) | An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. 37 **AudioSources** | **[]string** | An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. 38 **AudioSourcesExcluded** | **[]string** | An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. 39 **Resolution** | **string** | A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. 40 **Format** | **string** | 41 **StatusCallback** | **string** | The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. 42 **StatusCallbackMethod** | **string** | The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. 43 **Trim** | **bool** | Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. 44 45 ### Return type 46 47 [**VideoV1CompositionHook**](VideoV1CompositionHook.md) 48 49 ### Authorization 50 51 [accountSid_authToken](../README.md#accountSid_authToken) 52 53 ### HTTP request headers 54 55 - **Content-Type**: application/x-www-form-urlencoded 56 - **Accept**: application/json 57 58 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 59 [[Back to Model list]](../README.md#documentation-for-models) 60 [[Back to README]](../README.md) 61 62 63 ## DeleteCompositionHook 64 65 > DeleteCompositionHook(ctx, Sid) 66 67 68 69 Delete a Recording CompositionHook resource identified by a `CompositionHook SID`. 70 71 ### Path Parameters 72 73 74 Name | Type | Description 75 ------------- | ------------- | ------------- 76 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 77 **Sid** | **string** | The SID of the CompositionHook resource to delete. 78 79 ### Other Parameters 80 81 Other parameters are passed through a pointer to a DeleteCompositionHookParams struct 82 83 84 Name | Type | Description 85 ------------- | ------------- | ------------- 86 87 ### Return type 88 89 (empty response body) 90 91 ### Authorization 92 93 [accountSid_authToken](../README.md#accountSid_authToken) 94 95 ### HTTP request headers 96 97 - **Content-Type**: Not defined 98 - **Accept**: Not defined 99 100 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 101 [[Back to Model list]](../README.md#documentation-for-models) 102 [[Back to README]](../README.md) 103 104 105 ## FetchCompositionHook 106 107 > VideoV1CompositionHook FetchCompositionHook(ctx, Sid) 108 109 110 111 Returns a single CompositionHook resource identified by a CompositionHook SID. 112 113 ### Path Parameters 114 115 116 Name | Type | Description 117 ------------- | ------------- | ------------- 118 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 119 **Sid** | **string** | The SID of the CompositionHook resource to fetch. 120 121 ### Other Parameters 122 123 Other parameters are passed through a pointer to a FetchCompositionHookParams struct 124 125 126 Name | Type | Description 127 ------------- | ------------- | ------------- 128 129 ### Return type 130 131 [**VideoV1CompositionHook**](VideoV1CompositionHook.md) 132 133 ### Authorization 134 135 [accountSid_authToken](../README.md#accountSid_authToken) 136 137 ### HTTP request headers 138 139 - **Content-Type**: Not defined 140 - **Accept**: application/json 141 142 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 143 [[Back to Model list]](../README.md#documentation-for-models) 144 [[Back to README]](../README.md) 145 146 147 ## ListCompositionHook 148 149 > []VideoV1CompositionHook ListCompositionHook(ctx, optional) 150 151 152 153 List of all Recording CompositionHook resources. 154 155 ### Path Parameters 156 157 This endpoint does not need any path parameter. 158 159 ### Other Parameters 160 161 Other parameters are passed through a pointer to a ListCompositionHookParams struct 162 163 164 Name | Type | Description 165 ------------- | ------------- | ------------- 166 **Enabled** | **bool** | Read only CompositionHook resources with an `enabled` value that matches this parameter. 167 **DateCreatedAfter** | **time.Time** | Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. 168 **DateCreatedBefore** | **time.Time** | Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. 169 **FriendlyName** | **string** | Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. 170 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 171 **Limit** | **int** | Max number of records to return. 172 173 ### Return type 174 175 [**[]VideoV1CompositionHook**](VideoV1CompositionHook.md) 176 177 ### Authorization 178 179 [accountSid_authToken](../README.md#accountSid_authToken) 180 181 ### HTTP request headers 182 183 - **Content-Type**: Not defined 184 - **Accept**: application/json 185 186 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 187 [[Back to Model list]](../README.md#documentation-for-models) 188 [[Back to README]](../README.md) 189 190 191 ## UpdateCompositionHook 192 193 > VideoV1CompositionHook UpdateCompositionHook(ctx, Sidoptional) 194 195 196 197 198 199 ### Path Parameters 200 201 202 Name | Type | Description 203 ------------- | ------------- | ------------- 204 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 205 **Sid** | **string** | The SID of the CompositionHook resource to update. 206 207 ### Other Parameters 208 209 Other parameters are passed through a pointer to a UpdateCompositionHookParams struct 210 211 212 Name | Type | Description 213 ------------- | ------------- | ------------- 214 **FriendlyName** | **string** | A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. 215 **Enabled** | **bool** | Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. 216 **VideoLayout** | [**interface{}**](interface{}.md) | A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. 217 **AudioSources** | **[]string** | An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. 218 **AudioSourcesExcluded** | **[]string** | An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. 219 **Trim** | **bool** | Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. 220 **Format** | **string** | 221 **Resolution** | **string** | A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. 222 **StatusCallback** | **string** | The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. 223 **StatusCallbackMethod** | **string** | The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. 224 225 ### Return type 226 227 [**VideoV1CompositionHook**](VideoV1CompositionHook.md) 228 229 ### Authorization 230 231 [accountSid_authToken](../README.md#accountSid_authToken) 232 233 ### HTTP request headers 234 235 - **Content-Type**: application/x-www-form-urlencoded 236 - **Accept**: application/json 237 238 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 239 [[Back to Model list]](../README.md#documentation-for-models) 240 [[Back to README]](../README.md) 241