danielwerg / r6api.js

🍫 Node.js wrapper around Rainbow Six Siege APIs
https://npm.im/r6api.js
MIT License
109 stars 19 forks source link

FetchError: invalid json response #32

Closed TalOrenshtein closed 4 years ago

TalOrenshtein commented 4 years ago

Hi, I tried to use the API and get an ID and got this error:

FetchError: invalid json response body at https://connect.ubi.com/ubiservices/v2/profiles/sessions reason: Unexpected token < in JSON at position 0

Example: let user=await r6.getId('uplay',"randomUsername"); it does work at the official tracker (after I log in ofc).

How can I fix this?

danielwerg commented 4 years ago

What version you are using? Newest version using this as login https://public-ubiservices.ubi.com/v3/profiles/sessions, v3 instead of v2.

Try updating to latest version

TalOrenshtein commented 4 years ago

Oh yeah, just updated that, I'm kinda new to node and I just realized that the package.json forced me to stay at the older version. Thanks.