ardevd / jlrpy

Python library for interacting with the JLR Remote Car API
MIT License
84 stars 29 forks source link

Gettings user vehicles returns 400 syntactically incorrect #90

Closed scsinke closed 3 years ago

scsinke commented 3 years ago

Thnx for providing this lib, keep up the good work.

I'm trying to fetch all vehicles using the documenter, but running in to some errors. This is my request:

> GET /if9/jlr/users/<<My userID>>/vehicles?primaryOnly=true HTTP/1.1
> Host: if9.prod-row.jlrmotor.com
> User-Agent: insomnia/2021.2.2
> Content-Type: application/json
> X-Device-Id : <<My deviceID>>
> Authorization: Bearer <<My Bearer token>>
> Accept: */*

and this is the response:

< HTTP/1.1 400 Bad Request
< Date: Sat, 15 May 2021 14:57:57 GMT
< Content-Type: text/html;charset=utf-8
< Content-Length: 987
< Connection: keep-alive
< Age: 0

// body:
<html><head><title>JBoss Web/2.1.13.GA-patch-02 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 400 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The request sent by the client was syntactically incorrect ().</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.13.GA-patch-02</h3></body></html>

// body without html
< type: Status report
< message: 
< description: The request sent by the client was syntactically incorrect ().

You have any advice?

ardevd commented 3 years ago

Not able to replace the issue I'm afraid. Though it does seem like the InControl service is having some issues at the moment. I currently can't even authenticate. I'll give it a day and try again.

How are you sending your request exactly? And the user ID is the 11 character one obtained from the profile information?

scsinke commented 3 years ago

I figured it out. I had an extra space in my X-Device-Id header.