Method: PureCloud::NotificationsApi#post_channels_channel_id_subscriptions_with_http_info

Defined in:
lib/purecloud/api/notifications_api.rb

#post_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts = {}) ⇒ Array<(ChannelTopicEntityListing, Fixnum, Hash)>

Add a list of subscriptions to the existing list of subscriptions



331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/purecloud/api/notifications_api.rb', line 331

def post_channels_channel_id_subscriptions_with_http_info(channel_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: NotificationsApi#post_channels_channel_id_subscriptions ..."
  end
  
  # verify the required parameter 'channel_id' is set
  fail "Missing the required parameter 'channel_id' when calling post_channels_channel_id_subscriptions" if channel_id.nil?
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_channels_channel_id_subscriptions" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/notifications/channels/{channelId}/subscriptions".sub('{format}','json').sub('{' + 'channelId' + '}', channel_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}

  # HTTP header 'Accept' (if needed)
  _header_accept = ['application/json']
  _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result

  # HTTP header 'Content-Type'
  _header_content_type = ['application/json']
  header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  
  auth_names = ['PureCloud Auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ChannelTopicEntityListing')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: NotificationsApi#post_channels_channel_id_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end