btholt/complete-intro-to-react-v4

petfinder-client api call failing with 401 error code

twitu opened this issue · 1 comments

twitu commented

Hi, I am receiving an error petfinder error Error: "Request failed with status code 401" for the api calls made in componentDidMount for App class.

I have tried to get it work with petfinder-client installed as a npm package npm install petfinder-client@2.0.2 and from the repo npm install https://github.com/btholt/petfinder-client separately, but both versions give the same error code.

The course website mentions that I do not need an api key to interact with the mockup of the api service. So my .env file is as follows

API_KEY=asdjfhaskdjfhaksjche
API_SECRET=sadiogaioehcajsehcas

How to get the api to work?

Thank you for your help.

1Marc commented

The correct version is 1.0.2 -- this is listed in the package.json in the repo: https://github.com/btholt/complete-intro-to-react-v4/blob/master/package.json#L38