customerio-ruby icon indicating copy to clipboard operation
customerio-ruby copied to clipboard

Customerio::BaseClient does not support GET endpoints - "::InvalidRequest: Invalid request method :get when fetching collections"

Open ishields opened this issue 9 months ago • 1 comments

It appears that the customer io client does not support GET requests. The endpoint to fetch collections is a GET and so this fails.

Example usage: @client.request_and_verify_response(:get, "/v1/api/collections")

Endpoint I am trying to use. https://docs.customer.io/journeys/collections/#retrieve-a-list-of-all-your-collections

# /.rvm/gems/ruby-3.4.2/gems/customerio-5.3.0/lib/customerio/base_client.rb:68
def request_class(method)
      case method
      when :post
        Net::HTTP::Post
      when :put
        Net::HTTP::Put
      when :delete
        Net::HTTP::Delete
      else
        raise InvalidRequest.new("Invalid request method #{method.inspect}")
      end
end

ishields avatar Apr 11 '25 15:04 ishields

opened fix for this https://github.com/customerio/customerio-ruby/pull/118

ishields avatar Apr 14 '25 13:04 ishields