Skip to content

404 on any vehicle.request() type #61

@DevGW

Description

@DevGW

Trying to create a basic request to get extended attributes using the ruby SDK.

  def vehicle
    @token = params[:token]
    ap @token
    vehicle_ids = Smartcar.get_vehicles(token: @token).vehicles
    ap vehicle_ids
    vehicle = Smartcar::Vehicle.new(token: @token, id: vehicle_ids.first, options: {unit_system: 'imperial'})
    ap vehicle
    # vehicle_attributes = vehicle.attributes
    path = "#{vehicle.attributes.make}/attributes"
    vehicle_attributes = vehicle.request("GET", path)
    ap vehicle_attributes
    vehicle_attributes.to_h.slice(*%I[id make model year]).to_json

    # API calls to get vehicle info
    ap vehicle.odometer
  end

the vehicle.request is erroring out with a 404:

SmartcarError (RESOURCE_NOT_FOUND:PATH - The requested resource does not exist. Please check the URL and try again.):

the path is being written as 'FORD/attributes' - just like it shows in the API documentation.

I get the test vehicles, I get the basic attributes but cannot get the extended attributes, if someone could point me to what I'm doing wrong I would really appreciate it.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions