Hi!
I'm new here and haven't set up any API keys on a site of my own yet
but I was browsing around and decided to test my API key
here: https://developer.themoviedb.org/reference/intro/authentication
using my access token I get a 200 response,
but when I use my API-key it gives me a 401 and this message: 401 Invalid API key: You must be granted a valid key.
I've tested that the fightclub endpoint works for me with my given API key but I don't get why the one on the page doesn't.
Nu găsiți un film sau un serial? Autentificați-vă pentru a-l crea.
Doriți să evaluați sau să adăugați acest articol într-o listă?
Nu sunteți membru?
Răspuns de ticao2 🇧🇷 pt-BR
pe data de 12 august 2024 la ora 8:49 AM
I assume you are testing/using "Try it!" in the documentation.
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.
It is a birth defect since the migration to this service.
I don't know if it can be fixed. I'm not a programmer.
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.