Hello, hope everyone is doing great!
I'm using this URL to get the details of a movie
`${API_URL}movie/${movieId}?api_key=${API_KEY}`;
for example
https://api.themoviedb.org/3/movie/524434?api_key=###########;
then I'm trying to console log the movie object but I get undefined, and this error
https://api.themoviedb.org/3/movie/[object%20Object]?api_key=###### 404
{"success":false,"status_code":34,"status_message":"The resource you requested could not be found."}
P.S: I'm using the database also to get the list of movies and it works very well!
I'm using this in a ReactJS project
Can't find a movie or TV show? Login to create it.
Want to rate or add this item to a list?
Not a member?
Reply by ticao2 š§š· pt-BR
on January 21, 2022 at 8:30 AM
You gave an example.
https://api.themoviedb.org/3/movie/524434?api_key=THE_KEY
When I make the API Request using my browser the response is correct.
When you make the same API Request using your programming code in ReactJS you get 404 error response.
My conclusion is that there is some error in your programming code.
And it must be one of those tiny little mistakes, like an extra comma.
And this error is probably in the movie ID.
I say this because the error says it didn't find the resource.
Probably only ReactJS users can help you.
I will add ReactJS to your title of this conversation.
ReactJS - 404 when trying to get a movie details
Reply by bash95
on January 21, 2022 at 8:37 AM
Thank you a lot ticao2 š§š· pt-BR
Yeah exactly! I noticed the URL
I tried to print the movieId, and it's correct
Thanks again for your priceless help, I'll be waiting for other responses
Reply by bash95
on January 21, 2022 at 9:14 AM
I know where's my mistake I wrote
instead of
now it's working!
So, I don't know how or whether I can close this discussion XD
Reply by ticao2 š§š· pt-BR
on January 21, 2022 at 10:04 AM
:-)