دعم الموقع

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".

4 ردود (على هذه الصفحة 1 من 1)

Jump to last post

Hi @batifan, you must use your api key for guest session requests. The proper format for the request is:

https://api.themoviedb.org/3/guest_session/{guest_session_id}/rated/movies?api_key={api_key}

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.

@robbie3999 said:

Hi @batifan, you must use your api key for guest session requests. The proper format for the request is:

https://api.themoviedb.org/3/guest_session/{guest_session_id}/rated/movies?api_key={api_key}

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.

Thank you for your help. But what should I put into request header? My header looks like this:

{
      method: "GET",
      headers: {
        accept: "application/json",
        Authorization:
          "Bearer 12121212121211212121212",
      },
    };

"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.

@robbie3999 said:

"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.

Thank you so much. It helps me.

لم تجد الفلم أو المسلسل ؟ سجل دخولك و انشئها

عام

s ركز شريط البحث
p افتح قائمة الملف الشخصي
esc اغلق النافذة المفتوحة
? افتح نافذة اختصارات لوحة المفاتيح

على كافة صفحات الوسائط

b ارجع للخلف (او للصفحة الام عند التطبيق)
e انتقل لصفحة التعديل

على كافة صفحات موسم المسلسل

(السهم الايمن) انتقل للموسم التالي
(السهم الايسر) انتقل للموسم السابق

على كافة صفحات حلقة المسلسل

(السهم الايمن) انتقل للحلقة التالية
(السهم الايسر) انتقل للحلقة السابقة

على كافة صفحات الصور

a افتح صفحة اضافة الصورة

على كافة صفحات التعديل

t افتح محدد الترجمة
ctrl+ s ارسال النموذج

على صفحات المناقشة

n انشى نقاش جديد
w تبديل حالة المتابعة
p تبديل عام / خاص
c تبديل اغلاق / فتح
a افتح الانشطة
r رد على النقاش
l انتقل لأخر رد
ctrl+ enter أرسل رسالتك
(السهم الايمن) الصفحة التالية
(السهم الايسر) الصفحة السابقة

الاعدادات

هل تريد تقييم او اضافة هذا العنصر للقائمة؟

تسجيل الدخول