Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

404 on any vehicle.request() type #61

Open
DevGW opened this issue Aug 19, 2023 · 0 comments
Open

404 on any vehicle.request() type #61

DevGW opened this issue Aug 19, 2023 · 0 comments

Comments

@DevGW
Copy link

DevGW commented Aug 19, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant