WDI-SEA / project-2-issues

0 stars 0 forks source link

not being able to get access to API #4

Closed anaismveras closed 2 years ago

anaismveras commented 2 years ago

the API says I see to use cURL but I am using axios and I keep getting an error calling the API, which means I am calling it correctly because the error that I am getting is an error noted in the docs, I am just not sure how to not get this error

{"type":"https://httpstatus.es/401", "status":401, "title":"Unauthorized", "detail":"Access token invalid orexpired"}`

tkolsrud commented 2 years ago

Have you double checked your API key?

tkolsrud commented 2 years ago

also can you link to the docs

anaismveras commented 2 years ago

yea i am copying and pasting the API key but also in the docs there isnt a place to put it in the link for the API https://www.petfinder.com/developers/v2/docs/

TaylorDarneille commented 2 years ago

https://flaviocopes.com/axios-send-authorization-header/

You need to add the header with the bearer token. Check out this link to see how you can add that in axios.

TaylorDarneille commented 2 years ago

resolved!!!