Hi @siku94, you would need to provide more information for someone to help you. I can speculate from the error code that you have a problem with authentication. Try printing out the value of the strings you are using for the url or the parts of the url.
@siku94, first, you need to edit your post and remove or hide your api key. This is a private key and should not be shared with anyone.
Second, if you cut and past the URL that you have in your get statement (minus the page number) into a browser address bar you can clearly see that it works, the api returns the results. So whatever problem you are having is with your code, your setup, or something you are doing locally. I'm not sure how much help anyone can give you. Perhaps someone with axios experience may come along and can figure out what your problem is.
@abdulrahmanalabed, if you are having a problem, then you need to provide more details like what url is giving you the problem. Please open up another separate discussion instead of adding to this one.
i am getting this error in the tmdb log when i can try the code {
"status_code": 7,
"status_message": "Invalid API key: You must be granted a valid key.",
"success": false
}
i went to images in movies and i added the number 12 in the movie iad and i used my apikey and it gave me the 401 error but when i use the suthentication key it works i tried more than one account all same the api used to work yesterday
robbie3999 的回复
于 2023 年 08 月 02 日 5:42下午
Hi @siku94, you would need to provide more information for someone to help you. I can speculate from the error code that you have a problem with authentication. Try printing out the value of the strings you are using for the url or the parts of the url.
siku94 的回复
于 2023 年 08 月 03 日 11:32上午
i working on a reactJS project i will provide the code component below but evry time i run it it loads first then it gives me error "Request failed with status code 401 AxiosError: Request failed with status code 401 at settle (http://localhost:3000/static/js/bundle.js:83392:12) at XMLHttpRequest.onloadend (http://localhost:3000/static/js/bundle.js:82083:66)"
but still i can see the pictures of the movie cover under the error but still i cant figure out the problem . this is the code ```
``` hope this helps let me know if there is anything i can provide
siku94 的回复
于 2023 年 08 月 03 日 11:35上午
const fetchTrending = async () => { const { data } = await axios.get(
https://api.themoviedb.org/3/movie/popular?api_key=THE_KEY&page=${2}
);};
useEffect(() => { window.scroll(0, 0); fetchTrending(); }, [page]);
return (
export default Trending;
abdulrahmanalabed 的回复
于 2023 年 08 月 03 日 4:38下午
i have been getting error 401 all day too -
robbie3999 的回复
于 2023 年 08 月 03 日 5:19下午
@siku94, first, you need to edit your post and remove or hide your api key. This is a private key and should not be shared with anyone.
Second, if you cut and past the URL that you have in your get statement (minus the page number) into a browser address bar you can clearly see that it works, the api returns the results. So whatever problem you are having is with your code, your setup, or something you are doing locally. I'm not sure how much help anyone can give you. Perhaps someone with axios experience may come along and can figure out what your problem is.
@abdulrahmanalabed, if you are having a problem, then you need to provide more details like what url is giving you the problem. Please open up another separate discussion instead of adding to this one.
abdulrahmanalabed 的回复
于 2023 年 08 月 03 日 5:31下午
i am getting this error in the tmdb log when i can try the code {
"status_code": 7,
"status_message": "Invalid API key: You must be granted a valid key.",
"success": false
}
i went to images in movies and i added the number 12 in the movie iad and i used my apikey and it gave me the 401 error but when i use the suthentication key it works i tried more than one account all same the api used to work yesterday
robbie3999 的回复
于 2023 年 08 月 03 日 7:37下午
The api key does not work on the documentation "Try It" examples, only the access token works there.
ticao2 🇧🇷 pt-BR 的回复
于 2023 年 08 月 03 日 8:24下午
I will replace your API Key with THE_KEY expression.
It is not good to show your Key to all forum users.