Hi I would like to know why my API is not working. when I try to use it with axios I get an error 401 and I tried verifying it using the authentication on your website and it gives me a status of false
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة ticao2 🇧🇷 pt-BR
بتاريخ أغسطس 14, 2023 في 8:34 صباحا
Take a Test
In the URL below, change THE_KEY to your API Key.
https://api.themoviedb.org/3/movie/550?api_key=THE_KEY
Use this example to do a search using a new tab or window in your browser.
You will receive the basic data of the Movie Fight Club (1999)
https://www.themoviedb.org/movie/550-fight-club
If it works, your Key is OK.
When there is a problem, the TMDb Server sends a message.
Can you tell which message the server sent?
Here is a list of possible messages:
https://developer.themoviedb.org/docs/errors
If it does not work, let us know right here.
رد بواسطة Alpha
بتاريخ أغسطس 15, 2023 في 8:24 صباحا
i face that issue in 2 parts i will attach the code to both for your satisfaction
//CODE
//const API_KEY = "THE_KEY";
const requests = {
fetchTrending: '/trending/all/week?api_key=THE_KEY&language=en-US',
fetchNetflixOriginals: '/discover/tv?api_key=THE_KEY&with_networks=213',
fetchTopRated: '/movie/top_rated?api_key=THE_KEY&language=en-US',
fetchActionMovies: '/discover/movie?api_key=THE_KEY&with_genres=28',
fetchComedyMovies: '/discover/movie?api_key=THE_KEY&with_genres=35',
fetchHorrorMovies: '/discover/movie?api_key=THE_KEY&with_genres=27',
fetchRomanceMovies: '/discover/movie?api_key=THE_KEY&with_genres=10749',
fetchDocumentaries: '/discover/movie?api_key=THE_KEY&with_genres=99',
}
رد بواسطة Alpha
بتاريخ أغسطس 15, 2023 في 8:25 صباحا
رد بواسطة robbie3999
بتاريخ أغسطس 15, 2023 في 11:19 صباحا
Hi @TheKillerAlphaX, if you can manually insert your key and get your code to work, then you have an error in your code. You might want to investigate whether your ${API_KEY} value is getting set properly by printing it out before you use it.
You should --never-- publish your api key in a public forum, it is a private key that should be protected like a password. Please edit the post and replace your key with a string like "xxxx".
To use images you need to read the image basics that describes how to build an image url from the information returned.
رد بواسطة ticao2 🇧🇷 pt-BR
بتاريخ أغسطس 16, 2023 في 8:04 صباحا
@TheKillerAlphaX
I will replace your API Key with THE_KEY expression.
It is not good to show your Key to all forum users.
رد بواسطة ticao2 🇧🇷 pt-BR
بتاريخ أغسطس 16, 2023 في 9:15 صباحا
When I make this API Request I receive the data with poster_path and backdrop_path of the items.
Don't you get a similar response?
رد بواسطة Alpha
بتاريخ أغسطس 16, 2023 في 1:20 مساءا
it does show up for me. but i dont know why when i use it in code it doesnt. and it doesnt show the posters either
رد بواسطة Alpha
بتاريخ أغسطس 16, 2023 في 1:21 مساءا
am really sorry. i didnt know that
رد بواسطة ticao2 🇧🇷 pt-BR
بتاريخ أغسطس 16, 2023 في 5:22 مساءا
I assume you are referring to the issue of showing your API Key to the public.
If not, explain to me what you said.
I ask you two things, if possible.
1 - Post here the response that the TMDb Server sends you.
2 - Post here the API Request that your code is sending to our server.
Not the process of creating or building the Request but the complete Request that is submitted.
رد بواسطة Tboyles244
بتاريخ أغسطس 16, 2023 في 6:23 مساءا
Hey Killer Alpha, i think we are working through the same tutorial, i am having the same issue getting the data to connect. Were you able to figure it out?