Closed felixsieh closed 3 years ago
Hi @felixsieh :wave:
I think that error may be coming from a different call site. The client.exchangeRefreshToken
method makes an HTTP request to our OAuth service and the error message you specified is only returned by our API service. The error message could be caused by an invalid "token" argument to the getVehicleIds
or getUserId
methods or the Vehicle
constructor.
Hopefully that helps! :D
Feel free to e-mail support@smartcar.com if you need further help and our lovely support team will help you out
Hi there:
So I'm currently integrating with smartcar connect using the node js sdk and providing the clientId and secret to the config as follows:
when I try to get a token by doing this: client.exchangeRefreshToken(tokenData.RefreshToken)
It's throwing this error _Unhandled rejection StatusCodeError: 401 - {"error":"authenticationerror","message":"Invalid authorization header. Format is Authorization: Bearer [token]"}
Is this because the client id and secret are not valid? I get the impression that it is requesting me to add the token to the header but I thought the client config above should build that under the hood. Can you please help?
Thanks,