Method: KlaviyoAPI::TemplatesApi#update_universal_content_with_http_info

Defined in:
lib/klaviyo-api-sdk/api/templates_api.rb

#update_universal_content_with_http_info(id, universal_content_partial_update_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)> Also known as: update_template_universal_content_with_http_info

Update Universal Content Update universal content. The &#x60;definition&#x60; field can only be updated for text blocks at this time.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;10/s&#x60;&lt;br&gt;Steady: &#x60;150/m&#x60; Scopes: &#x60;templates:write&#x60;

Parameters:

  • id (String)

    The ID of the template universal content

  • universal_content_partial_update_query (UniversalContentPartialUpdateQuery)

    Update a universal content by ID

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

    the optional parameters

Returns:

  • (Array<(Hash<String, Object>, Integer, Hash)>)

    Hash<String, Object> data, response status code and response headers



870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
# File 'lib/klaviyo-api-sdk/api/templates_api.rb', line 870

def update_universal_content_with_http_info(id, universal_content_partial_update_query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: TemplatesApi.update_universal_content ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling TemplatesApi.update_universal_content"
  end
  # verify the required parameter 'universal_content_partial_update_query' is set
  if @api_client.config.client_side_validation && universal_content_partial_update_query.nil?
    fail ArgumentError, "Missing the required parameter 'universal_content_partial_update_query' when calling TemplatesApi.update_universal_content"
  end
  # resource path
  local_var_path = '/api/template-universal-content/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # klaviyo api revision
  header_params['revision'] =  ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2025-04-15"
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/vnd.api+json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(universal_content_partial_update_query)

  # return_type
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']

  new_options = opts.merge(
    :operation => :"TemplatesApi.update_universal_content",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: TemplatesApi#update_universal_content\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end