My API key was working until last month. However, When I checked my API key this month, I got 401 error with this message "Invalid API key: You must be granted a valid key". Can you explain me why my API key Invalid?
Un film, une émission télévisée ou un artiste est introuvable ? Connectez-vous afin de créer une nouvelle fiche.
Vous souhaitez évaluer ou ajouter cet élément à une liste ?
Pas encore membre ?
Réponse de ticao2 🇧🇷 pt-BR
le 16 décembre 2023 à 21h11
Better make sure your API Key has been canceled.
And the safest way is to do the test 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.
If it does not work, let us know right here.
Réponse de tmdb88890333
le 18 décembre 2023 à 19h04
I got this error message instead of basic data of the Movie Fight Club
{"adult":false,"backdrop_path":"/hZkgoQYus5vegHoetLkCJzb17zJ.jpg","belongs_to_collection":null,"budget":63000000,"genres":[{"id":18,"name":"Drama"}],"homepage":"http://www.foxmovies.com/movies/fight-club","id":550,"imdb_id":"tt0137523","original_language":"en","original_title":"Fight Club","overview":"A ticking-time-bomb insomniac and a slippery soap salesman channel primal male aggression into a shocking new form of therapy. Their concept catches on, with underground \"fight clubs\" forming in every town, until an eccentric gets in the way and ignites an out-of-control spiral toward oblivion.","popularity":85.845,"poster_path":"/pB8BM7pdSp6B6Ih7QZ4DrQ3PmJK.jpg","production_companies":[{"id":711,"logo_path":"/tEiIH5QesdheJmDAqQwvtN60727.png","name":"Fox 2000 Pictures","origin_country":"US"},{"id":508,"logo_path":"/7cxRWzi4LsVm4Utfpr1hfARNurT.png","name":"Regency Enterprises","origin_country":"US"},{"id":4700,"logo_path":"/A32wmjrs9Psf4zw0uaixF0GXfxq.png","name":"The Linson Company","origin_country":"US"},{"id":25,"logo_path":"/qZCc1lty5FzX30aOCVRBLzaVmcp.png","name":"20th Century Fox","origin_country":"US"},{"id":20555,"logo_path":"/hD8yEGUBlHOcfHYbujp71vD8gZp.png","name":"Taurus Film","origin_country":"DE"}],"production_countries":[{"iso_3166_1":"DE","name":"Germany"},{"iso_3166_1":"US","name":"United States of America"}],"release_date":"1999-10-15","revenue":100853753,"runtime":139,"spoken_languages":[{"english_name":"English","iso_639_1":"en","name":"English"}],"status":"Released","tagline":"Mischief. Mayhem. Soap.","title":"Fight Club","video":false,"vote_average":8.44,"vote_count":27672}
Also, when I check my api authentication, Still I got this message. "status_message": "Invalid API key: You must be granted a valid key."
If My api Key got canceled, Can I ask why it has been canceled?
Réponse de ticao2 🇧🇷 pt-BR
le 19 décembre 2023 à 07h24
Sorry I do not understand.
You did the test I indicated above and
Choose one of the possibilities.
Réponse de tmdb88890333
le 19 décembre 2023 à 18h58
Sorry, Now I understand.
The answer is 1,
I received the correct Fight Club Movie's basic "data", instead of go to https://www.themoviedb.org/movie/550-fight-club this page.
Réponse de ticao2 🇧🇷 pt-BR
le 20 décembre 2023 à 07h20
With this test we know that your API Key is still valid.
How or where did you do this check?
It was using "Try it!" in the Documents?
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 checked in another way, please let us know which way it was.
Réponse de kmcowan
le 20 décembre 2023 à 12h01
Hello TMDB Support ...
I am also receiving this message.
"status_message": "Invalid API key: You must be granted a valid key.",
Please advise. I did take the test above and it failed.
https://developer.themoviedb.org/reference/authentication-validate-key
Réponse de ticao2 🇧🇷 pt-BR
le 20 décembre 2023 à 12h59
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.
Réponse de kmcowan
le 20 décembre 2023 à 13h29
Yes, I tried both the aforementioned test above, as test as the authentication test page. I'm unable to get a 200 response now, although this key used to work.
Réponse de ticao2 🇧🇷 pt-BR
le 20 décembre 2023 à 14h03
Tested API Key and it didn't work
Create a new topic requesting it with the title: Regenerate API Key.
It will be in this new topic that you will receive the information that your API Key has been regenerated.
Or
Go to this page in your profile.
https://www.themoviedb.org/settings/api
If you already have it and want it to be changed or regenerated,
request it here by clicking on "Regenerate Key":
Réponse de kmcowan
le 20 décembre 2023 à 14h41
Thank you. I was able to regenerate the key.
Réponse de tmdb88890333
le 20 décembre 2023 à 18h40
It was "Try it" for "API key Auth".
Even the result of test shows my API Key is still valid, still I got fail error message on my portfolio, movie db page. "Failed to load resource: the server responded with a status of 400 ()"
Also, my "API Key Auth" is show still failed on "API Reference - Authentication" page.
Réponse de ticao2 🇧🇷 pt-BR
le 21 décembre 2023 à 10h56
I don't know if I understood correctly, but...
Then your API Key is valid.
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:
Nothing works on the DOC pages if the "API Key Auth" option is selected.
Only works with the "Access Token Auth" option.
Réponse de Markysan
le 22 décembre 2023 à 05h58
My API Key is not working. Please help. {"status_code":7,"status_message":"Invalid API key: You must be granted a valid key.","success":false}I
Réponse de ticao2 🇧🇷 pt-BR
le 22 décembre 2023 à 08h36
Read this conversation from the beginning.
First do the test indicated here:
https://www.themoviedb.org/talk/657d0eeeb7fbbd06e430013f#657e58cd8f26bc1f50751e92
If your API Request worked correctly, read this second explanation:
https://www.themoviedb.org/talk/657d0eeeb7fbbd06e430013f#6582dc0a8586785635f65e85
If your problem has not yet been resolved, follow these instructions:
https://www.themoviedb.org/talk/657d0eeeb7fbbd06e430013f#65833a81ea7b0e51fa270f0f