دعم الموقع

Hi, I am trying to add an item to my movie list thanks to this post request. However, I tried everything and can't have a successful response.

When I try this request for example :

 curl --request POST \
  --url https://api.themoviedb.org/4/list/%7B{list_id}%7D/items \
  --header 'authorization: Bearer {Access_token}'\
  --header 'content-type: application/json;charset=utf-8' \
  --data '{"items": [ {"media_type":"movie","media_id":"95"}]}'

The {Access_token} is the "API Read Access Token (v4 auth)" of my API.

Here is the answer I have :

{
  "status_message": "This token hasn't been granted write permission by the user.",
  "error_message": "No matching scope found.",
  "success": false,
  "status_code": 36
}

As I created a session id, I tried to use it as well but didn't work either.

If you have any idea to help me I would be very grateful ! Thanks

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

Jump to last post

You won't be able to write with your read token, so that first error (36) is correct.

You need to generate a new access token that has been authorized by a user to get a token that has write access. This is outlined in this document here. Once step 3 is completed, you will have a new Bearer token that has the proper permission scope.

Hey, I'm having the same problem. I followed the steps in your documentation link: 1. I generated a new authorization token; receiving back:

{
  "status_code": 1,
  "status_message": "Success.",
  "success": true,
  "request_token": "the full request token"
}

Then I proceeded to step 2. Sending the user to TMDb asking him to approve the token. As per instructions in that page, I sent him to https://www.themoviedb.org/auth/access?request_token={request_token}, filling in the request token that I got in the step 1. request. I tried both with the quotations and without.

In both cases I keep getting that the request token is invalid. I've done it in less than the 15 minute announced expiration time.

Please explain what I'm doing wrong?

Hi @silvanet, I am not really able to help based on what you've said but I encourage you to take a look at my test scripts to see what the correct workflow looks like. All of the logic is front end JS, so you can inspect the code to see what I am doing.

Thanks very much.

Sorry, I can see your code but I can't figure out what it's doing. I get a ton of errors from the api in the console, failing to load resources, because the code refers to you site (and no doubt many other files and code).

Here's what I'm seeing, and that doesn't help me a lot:

api.themoviedb.org/4/auth/request_token:1 Failed to load resource: the server responded with a status of 401 () v4_auth.html:1 Access to XMLHttpRequest at 'https://api.themoviedb.org/4/auth/request_token' from origin 'http://dev.travisbell.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

2api.themoviedb.org/4/auth/request_token:1 Failed to load resource: the server responded with a status of 401 () v4_auth.html:1 Access to XMLHttpRequest at 'https://api.themoviedb.org/4/auth/request_token' from origin 'http://dev.travisbell.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

2api.themoviedb.org/4/auth/request_token:1 Failed to load resource: the server responded with a status of 401 () v4_auth.html:1 Access to XMLHttpRequest at 'https://api.themoviedb.org/4/auth/request_token' from origin 'http://dev.travisbell.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

2api.themoviedb.org/4/auth/request_token:1 Failed to load resource: the server responded with a status of 401 () v4_auth.html:1 Access to XMLHttpRequest at 'https://api.themoviedb.org/4/auth/request_token' from origin 'http://dev.travisbell.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

2api.themoviedb.org/4/auth/request_token:1 Failed to load resource: the server responded with a status of 401 () v4_auth.html:1 Access to XMLHttpRequest at 'https://api.themoviedb.org/4/auth/request_token' from origin 'http://dev.travisbell.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

I tried cleaning that up a bit by running it from my localhost on Chrome, but I still got this:

Access to XMLHttpRequest at 'https://api.themoviedb.org/4/auth/request_token' from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Now I'm trying to figure out how to be able to send https requests from Chrome without being blocked.

Thanks a lot for your help, though.

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

عام

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

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

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

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

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

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

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

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

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

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

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

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

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

الاعدادات

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

تسجيل الدخول