Method: PureCloud::QualityApi#post_forms_with_http_info

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

#post_forms_with_http_info(body, opts = {}) ⇒ Array<(EvaluationForm, Fixnum, Hash)>

Create an evaluation form.

Parameters:

  • body

    Evaluation form

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(EvaluationForm, Fixnum, Hash)>)

    EvaluationForm data, response status code and response headers



1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
# File 'lib/purecloud/api/quality_api.rb', line 1673

def post_forms_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: QualityApi#post_forms ..."
  end
  
  # verify the required parameter 'body' is set
  fail "Missing the required parameter 'body' when calling post_forms" if body.nil?
  
  # resource path
  local_var_path = "/api/v2/quality/forms".sub('{format}','json')

  # 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 => 'EvaluationForm')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: QualityApi#post_forms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end