@@ -252,6 +252,87 @@ def modify_call(account_id,
252252 ApiResponse . new ( _response )
253253 end
254254
255+ # Makes a PUT request to /api/v2/accounts/{accountId}/calls/{callId}/bxml
256+ # @param [String] account_id Required parameter: Example:
257+ # @param [String] call_id Required parameter: Example:
258+ # @param [String] body Required parameter: Example:
259+ # @return [void] response from the API call
260+ def modify_call_bxml ( account_id ,
261+ call_id ,
262+ body
263+ )
264+ # Prepare query url.
265+ _query_builder = config . get_base_uri ( Server ::VOICEDEFAULT )
266+ _query_builder << '/api/v2/accounts/{accountId}/calls/{callId}/bxml'
267+ _query_builder = APIHelper . append_url_with_template_parameters (
268+ _query_builder ,
269+ 'accountId' => { 'value' => account_id , 'encode' => false } ,
270+ 'callId' => { 'value' => call_id , 'encode' => false }
271+ )
272+ _query_url = APIHelper . clean_url _query_builder
273+
274+ # Prepare headers.
275+ _headers = {
276+ 'content-type' => 'application/xml; charset=utf-8'
277+ }
278+
279+ # Prepare and execute HttpRequest.
280+ _request = config . http_client . put (
281+ _query_url ,
282+ headers : _headers ,
283+ parameters : body . to_json
284+ )
285+ VoiceBasicAuth . apply ( config , _request )
286+ _response = execute_request ( _request )
287+
288+ # Validate response against endpoint and global error codes.
289+ case _response . status_code
290+ when 400
291+ raise ApiErrorException . new (
292+ 'Something\'s not quite right... Your request is invalid. Please' \
293+ ' fix it before trying again.' ,
294+ _response
295+ )
296+ when 401
297+ raise APIException . new (
298+ 'Your credentials are invalid. Please use your Bandwidth dashboard' \
299+ ' credentials to authenticate to the API.' ,
300+ _response
301+ )
302+ when 403
303+ raise ApiErrorException . new (
304+ 'User unauthorized to perform this action.' ,
305+ _response
306+ )
307+ when 404
308+ raise ApiErrorException . new (
309+ 'The resource specified cannot be found or does not belong to you.' ,
310+ _response
311+ )
312+ when 415
313+ raise ApiErrorException . new (
314+ 'We don\'t support that media type. If a request body is required,' \
315+ ' please send it to us as `application/xml`.' ,
316+ _response
317+ )
318+ when 429
319+ raise ApiErrorException . new (
320+ 'You\'re sending requests to this endpoint too frequently. Please' \
321+ ' slow your request rate down and try again.' ,
322+ _response
323+ )
324+ when 500
325+ raise ApiErrorException . new (
326+ 'Something unexpected happened. Please try again.' ,
327+ _response
328+ )
329+ end
330+ validate_response ( _response )
331+
332+ # Return appropriate response type.
333+ ApiResponse . new ( _response )
334+ end
335+
255336 # Pauses or resumes a recording.
256337 # @param [String] account_id Required parameter: Example:
257338 # @param [String] call_id Required parameter: Example:
0 commit comments