Good day,
I have been unable to use the API key that was assigned to me since I registered on your website.
When I try to use the API in your website's API Reference page, it returns an error message that says: {
"status_code": 7,
"status_message": "Invalid API key: You must be granted a valid key.",
"success": false
}
The Access Token displays some results when I change my options to it.
What I really need is the API key.
How can this be fixed?
The "Try Out" function on the API reference page doesn't work with API key. You need to paste your query in a separate tab of your browser to ckeck it.
If I add the API to my JS code, I also get the same feedback every time. "Invalid API key: You must be granted a valid key."
If you could give me a guideline on how to best use it, I'll be glad to follow it.
The response I am getting:
"Failed to load resource: the server responded with a status of 401 ()
Main.jsx:19 Error fetching data: AxiosError".
when I copy the address in the requestPopular ( requestPopular: https://api.themoviedb.org/3/tv/popular?api_key=${key}language=en-US&page=1,
) and load it on my browser independently, I get this feedback "{
"status_code": 7,
"status_message": "Invalid API key: You must be granted a valid key.",
"success": false
}"
Meanwhile, my API key has already been inserted in the address.
رد بواسطة superboy97
بتاريخ نوفمبر 16, 2024 في 6:21 صباحا
If you want help about the API, you will have to provide us with the complete query you have sent to us, as well as the response you have got.
رد بواسطة IkePaschal
بتاريخ نوفمبر 16, 2024 في 11:47 صباحا
Good day, I have been unable to use the API key that was assigned to me since I registered on your website. When I try to use the API in your website's API Reference page, it returns an error message that says: { "status_code": 7, "status_message": "Invalid API key: You must be granted a valid key.", "success": false } The Access Token displays some results when I change my options to it. What I really need is the API key. How can this be fixed?
رد بواسطة superboy97
بتاريخ نوفمبر 16, 2024 في 12:00 مساءا
The "Try Out" function on the API reference page doesn't work with API key. You need to paste your query in a separate tab of your browser to ckeck it.
رد بواسطة IkePaschal
بتاريخ نوفمبر 16, 2024 في 12:06 مساءا
If I add the API to my JS code, I also get the same feedback every time. "Invalid API key: You must be granted a valid key." If you could give me a guideline on how to best use it, I'll be glad to follow it.
رد بواسطة superboy97
بتاريخ نوفمبر 16, 2024 في 12:08 مساءا
If you want help about the API, you will have to provide us with the complete query you have sent to us, as well as the response you have got.
رد بواسطة IkePaschal
بتاريخ نوفمبر 16, 2024 في 12:39 مساءا
This is the query: const [movies, setMovies] = useState([]); const key = "my API key is in here";
const requests = { requestPopular:
https://api.themoviedb.org/3/tv/popular?api_key=${key}language=en-US&page=1
, }; useEffect(() => { axios .get(requests.requestPopular) .then((response) => { setMovies(response.data); console.log(response.data); }) .catch((error) => { console.error("Error fetching data:", error); }); }, []);The response I am getting: "Failed to load resource: the server responded with a status of 401 () Main.jsx:19 Error fetching data: AxiosError". when I copy the address in the requestPopular ( requestPopular:
https://api.themoviedb.org/3/tv/popular?api_key=${key}language=en-US&page=1
, ) and load it on my browser independently, I get this feedback "{ "status_code": 7, "status_message": "Invalid API key: You must be granted a valid key.", "success": false }" Meanwhile, my API key has already been inserted in the address.رد بواسطة superboy97
بتاريخ نوفمبر 16, 2024 في 12:42 مساءا
There is a separator missing between your API key and the language parameter.
رد بواسطة IkePaschal
بتاريخ نوفمبر 16, 2024 في 12:49 مساءا
Thanks a lot. I just added the separator to the code, and my code is displaying just fine in the console tab. I really appreciate the help.
رد بواسطة superboy97
بتاريخ نوفمبر 16, 2024 في 2:31 مساءا
By the way, next time, create your own topic instead of hijacking the topic of someone else.