Hi. Wen I make a request to get rated movies for guest session, I recieve such response:
{
"status_code": 7,
"status_message": "Invalid API key: You must be granted a valid key.",
"success": false
}
When I test this response at https://developer.themoviedb.org/reference/guest-session-rated-movies, a message appears: "Sorry, you couldn't be authenticated with those credentials".
.לא מצאת סרט או סדרה? היכנס כדי ליצור אותם
?רוצה לדרג או להוסיף פריט אל רשימה
?לא חבר אתר
תגובה מאת robbie3999
ב-יולי 31, 2023 ב-4:49אחרי חצות יום
Hi @batifan, you must use your api key for guest session requests. The proper format for the request is:
For the second error, it sounds like you might be putting your api key into the header field for the "Try It!" example. Try It only accepts "access token" and not "api key".
If this doesn't address your problem then come back here and we can look at some other things.
תגובה מאת batifan
ב-יולי 31, 2023 ב-6:01אחרי חצות יום
Thank you for your help. But what should I put into request header? My header looks like this:
תגובה מאת robbie3999
ב-יולי 31, 2023 ב-6:21אחרי חצות יום
"accept: application/json" is the only thing in the header. You don't need an authorization header because you are passing the api key in the url.
This describes the authentication methods. Note that you have -two- tokens, one is the api key and the other is the bearer token. Most of the time you can use either one. But if I remember correctly, the guest session calls -require- the api key only. If you try to use the bearer token you get your personal account information instead of the guest session information.
תגובה מאת batifan
ב-אוגוסט 1, 2023 ב-8:36לפני חצות יום
Thank you so much. It helps me.