https://api.themoviedb.org/3/movie/550?api_key=MY_API_KEY works, but only Access Token Auth works for https://developer.themoviedb.org/reference/trending-movies. Using API Key on any of the Try it examples in https://developer.themoviedb.org/ does not work.
Error Message:
{
"status_code": 7,
"status_message": "Invalid API key: You must be granted a valid key.",
"success": false
}
Trying different methods, https://api.themoviedb.org/3/trending/movie/day?language=en-US?api_key=MY_API_KEY does not work either.
The error message that appears below the authorization header field says "Sorry, you could not be authorized with those credentials."
It looks like this.
لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها
هل تريد تقييم او اضافة هذا العنصر للقائمة؟
لست عضو؟
رد بواسطة superboy97
بتاريخ يوليو 13, 2023 في 5:39 صباحا
The syntax of this query is wrong. It should be : https://api.themoviedb.org/3/trending/movie/day?language=en-US&api_key=MY_API_KEY
A question mark is used in front of the parameters, but an ampersand is used between the parameters.
رد بواسطة Mayday0458
بتاريخ يوليو 13, 2023 في 7:12 صباحا
That worked! Thanks, I got it now.
Why does the problem occur in the Try it examples then?
رد بواسطة robbie3999
بتاريخ يوليو 13, 2023 في 9:24 صباحا
Hi @Mayday0458, the "Try It!" examples only work when you select the "Access Token Auth" authentication for use in the header.
What happens when you select "API Key Auth" is it inserts your API Key into the Authorization header, which doesn't work. I would consider this a bug, it probably should either not allow you to select "API Key Auth" or convert the example to one that uses the API Key in the url.
رد بواسطة davidirvine
بتاريخ يوليو 15, 2023 في 7:53 صباحا
Having the same issue...
رد بواسطة robbie3999
بتاريخ يوليو 15, 2023 في 10:27 صباحا
Hi @davidirvine, the "Try It!" examples only work when you select the "Access Token Auth" authentication for use in the header.
What happens when you select "API Key Auth" is it inserts your API Key into the Authorization header, which doesn't work. I would consider this a bug, it probably should either not allow you to select "API Key Auth" or convert the example to one that uses the API Key in the url.
رد بواسطة davidirvine
بتاريخ أغسطس 12, 2023 في 5:41 مساءا
yeah... i understand now..
thanks for the reply... a bug for sure!