Method: KlaviyoAPI::WebFeedsApi#get_web_feed_with_http_info

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

#get_web_feed_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>

Get Web Feed Get the web feed with the given ID.&lt;br&gt;&lt;br&gt;*Rate limits*:&lt;br&gt;Burst: &#x60;1/s&#x60;&lt;br&gt;Steady: &#x60;15/m&#x60; Scopes: &#x60;web-feeds:read&#x60;

Parameters:

  • id (String)

    The ID of the web feed

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

    the optional parameters

Options Hash (opts):

Returns:

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

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



174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
# File 'lib/klaviyo-api-sdk/api/web_feeds_api.rb', line 174

def get_web_feed_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: WebFeedsApi.get_web_feed ...'
  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 WebFeedsApi.get_web_feed"
  end
  allowable_values = ["name", "url", "request_method", "content_type", "created", "updated", "status"]
  if @api_client.config.client_side_validation && opts[:'fields_web_feed'] && !opts[:'fields_web_feed'].all? { |item| allowable_values.include?(item) }
    fail ArgumentError, "invalid value for \"fields_web_feed\", must include one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/api/web-feeds/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'fields[web-feed]'] = @api_client.build_collection_param(opts[:'fields_web_feed'], :csv) if !opts[:'fields_web_feed'].nil?

  # 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'])

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

  # http body (model)
  post_body = opts[:debug_body]

  # 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 => :"WebFeedsApi.get_web_feed",
    :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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: WebFeedsApi#get_web_feed\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end