Hello, my API key isnt working anymore for some reason. I tried regenerating a new one, it worked for like a minute and staterted giving a 404 error. Requests on the developer page give this: { "status_code": 7, "status_message": "Invalid API key: You must be granted a valid key.", "success": false } and a stastus 401: this request is not associated with an endpoint in the api definition. Could you please help me out
Kan βn rolprent of TV-program nie vind nie? Teken aan om dit te skep.
Wil u hierdie item gradeer of tot βn lys toevoeg?
Nie βn lid nie?
Antwoord deur ticao2 π§π· pt-BR
op 17 Januarie 2024 om 11:22 VM
Are you submitting your API Requests using the "Try it" feature on the developer pages in the documents?
https://developer.themoviedb.org/reference/intro/getting-started
Or are you sending it directly via your browser's URL?
Or are you sending it using code you are developing?
If you're always using the developers' page, then...
The "Try it!" option in DOCs it only works with the "Access Token Auth" option.
It doesn't work if you select the "API Key Auth" option.
Your API Key validation test is done using your Token.
https://developer.themoviedb.org/reference/authentication-validate-key
If your Token works then your API Key must also work.
If you want to test your API Key directly, follow the instructions below.
Take a Test
Using a computer, desktop or notebook.
On some mobile devices this test may not work correctly.
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.
Antwoord deur vemilyus
op 17 Januarie 2024 om 12:09 NM
@ticao2 The problem is that even if the
API Key Auth
option is selected the API Key is still sent via theAuthorization
header instead of the query parameterapi_key
.Antwoord deur ticao2 π§π· pt-BR
op 18 Januarie 2024 om 10:43 VM
I think I didn't explain it correctly in my previous comment.
Never select the "API Key Auth" option in the "Try it" dropdown.
This documentation feature is defective.
Does not work.
In the dropdown, always leave the "Access Token Auth" option selected.
Antwoord deur vemilyus
op 18 Januarie 2024 om 10:46 VM
Thank you for the clarification!
Antwoord deur kennylima
op 19 Januarie 2024 om 2:52 VM
it worked locally for some hours after i sent the message enough to be deployed, however, when i started my local server again, i got 404 not found error. i tried your https://api.themoviedb.org/3/movie/550?api_key=THE_KEY hack and this worked tho.
Antwoord deur ticao2 π§π· pt-BR
op 19 Januarie 2024 om 7:14 VM
I didn't quite understand your answer.
If the problem is solved, forget what I'm going to say.
If it hasn't been resolved, please answer the questions I asked.
Antwoord deur kennylima
op 19 Januarie 2024 om 7:42 VM
Yes, i am sending it via code for a project.
i tried your suggestion: https://api.themoviedb.org/3/movie/550?api_key=THE_KEY. It worked and gave me the fight club info
however, it doesn't work for my code.
Antwoord deur ticao2 π§π· pt-BR
op 19 Januarie 2024 om 8:02 VM
Can you tell us which of these errors is occurring?
See the list of TMDb server error warnings here.
https://www.themoviedb.org/documentation/api/status-codes
In your case:
Antwoord deur kennylima
op 20 Januarie 2024 om 4:35 VM
its 404 not found
Antwoord deur ticao2 π§π· pt-BR
op 20 Januarie 2024 om 7:24 VM
Which of the two?
I believe it is when the item ID (movie or TV show) has an error.
Try searching for another ID.
Your TOKEN usage session was not created correctly or has a problem.
Antwoord deur TanmayH
op 26 Augustus 2024 om 12:11 NM
I am facing the same issue. I tried the test that you mentioned before using my API key. But when I use it in my code then it doesn't work. It gives me a 401: Invalid API Key error.
Antwoord deur ticao2 π§π· pt-BR
op 26 Augustus 2024 om 4:29 NM
The problem must be in the code that is building your API Request, or something like that,
and is sending the Request to the TMDb Server.
It is very common to find people here with this type of problem.
A little mistake, a copy and paste with an extra space, or less character, an exchange of characters,
a quote left, use a dash when it should be underline, in short a typo and the answer can be that.
Even if the API Key is correct. The Requisition is that it has a little mistake.
I will place 6 API requests here. The first 5 with error.
You can see that the API Key is correct but the answer is Invalid API key or could not be found.
My suggestion is to check if there is any way for you to view the API Request that your APP is sending to the TMDb server.
Not the construction of the code, but the requisition built, final.
If possible, post the Request here.
If this is not possible, then you need to check in your code if there is a mistake, like the mistake in the examples above.
The error is usually in this segment of the API Request: ....?api_key=12345....
Antwoord deur gabrielSDourado
op 26 Augustus 2024 om 5:10 NM
By testing the API using postman, I get the answer "status_code": 7, "status_message": "Invalid API key: You must be granted a valid key.", "success": false
Antwoord deur ticao2 π§π· pt-BR
op 26 Augustus 2024 om 5:43 NM
I suggest you search here on the forum for something about Postman.
https://www.themoviedb.org/talk/search?advanced_search=&query=Postman&with_category=5047958519c29526b50017d6&with_status%5B%5D=closed&with_status%5B%5D=open
Or open a new topic with your question, putting the word Postman in the title.
Something like: Postman - Invalid API Key. Or something similar.
That way you can more easily find other Postman users who might be able to help.