The Movie Database 支持

Hello,

I have a problem , so i try to remove selected movie from watch list using following call "POST /account/{account_id}/watchlist". In last parameter in request body i pass "false", as i understood that's mean that i remove item from list , but actually item doesn't remove.

Below you can see the response: { "status_code": 12, "status_message": "The item/record was updated successfully." }

In params i pass : "session_id" and "api_key" In header Content-Type : "application/json" In request body : "media_id" as String value, "media_type" also as String value and "favorite" as Boolean value.

My end point: https://api.themoviedb.org/3/account/11/favorite?session_id=XXXXXXXXXXXXXXXX&api_key=XXXXXXXXXXXXXXX

Thank you in advance for help, Kind regards, Brad.

4 回复(第 1 页,共 1 页)

Jump to last post

Hi Brad,

I just gave this a spin and had no problems adding and removing items from my favourite list. Here's an example request to remove the item from my favourite list:

https://api.themoviedb.org/3/account/11/favorite?session_id=###&api_key=###

POST Body:

{ "media_type": "movie", "media_id": 284054, "favorite": false }

Are you making sure your values for media_id and favorite are a integer and boolean?

HI Travis,

That how look my endpoint :
https://api.themoviedb.org/3/account/11/favorite?session_id=######&api_key=#######

And i have the same body as you wrote above but actually i receive The same message as in previous time.

{ "media_type": "movie", "media_id": 284054, "favorite": false }

I can mark movie as favorite, but i can remove it from favorite, but the main difference between two calls is last value of the body, we have to change just boolean value from TRUE to FALSE.

But it's not working ... May bу there are anything else can be wrong? Kind regards, Brad.

Are you able to run these cURL commands? Here's the 4 that I just ran that are working properly:

Add to my favourite list:

$ curl -X POST \
>   "https://api.themoviedb.org/3/account/548/favorite?api_key=###&session_id=###" \
>   -H 'Content-Type: application/json' \
>   -d '{ "media_type": "movie", "media_id": 284054, "favorite": true }'

{
  "status_code": 12,
  "status_message": "The item/record was updated successfully."
}

Check my favourite list, notice 284054 is first in my list. Also note that I added a sort_by=created_at.desc param to make sure I am getting items sorted that are newest added first.

$ curl -X GET \
>   "https://api.themoviedb.org/3/account/548/favorite/movies?api_key=###&session_id=###&sort_by=created_at.desc"

{
  "page": 1,
  "results": [
    {
      "adult": false,
      "backdrop_path": "/b6ZJZHUdMEFECvGiDpJjlfUWela.jpg",
      "genre_ids": [
        28,
        12,
        14,
        878
      ],
      "id": 284054,
      "original_language": "en",
      "original_title": "Black Panther",
      "overview": "King T'Challa returns home from America to the reclusive, technologically advanced African nation of Wakanda to serve as his country's new leader. However, T'Challa soon finds that he is challenged for the throne by factions within his own country as well as without. Using powers reserved to Wakandan kings, T'Challa assumes the Black Panther mantel to join with girlfriend Nakia, the queen-mother, his princess-kid sister, members of the Dora Milaje (the Wakandan 'special forces') and an American secret agent, to prevent Wakanda from being dragged into a world war.",
      "poster_path": "/uxzzxijgPIY7slzFvMotPv8wjKA.jpg",
      "release_date": "2018-02-13",
      "title": "Black Panther",
      "video": false,
      "vote_average": 7.3,
      "vote_count": 9139,
      "popularity": 44.814
    },
    {
      "adult": false,
      "backdrop_path": "/mVr0UiqyltcfqxbAUcLl9zWL8ah.jpg",
      "genre_ids": [
        9648,
        878,
        53
      ],
      "id": 335984,
      "original_language": "en",
      "original_title": "Blade Runner 2049",
      "overview": "Thirty years after the events of the first film, a new blade runner, LAPD Officer K, unearths a long-buried secret that has the potential to plunge what's left of society into chaos. K's discovery leads him on a quest to find Rick Deckard, a former LAPD blade runner who has been missing for 30 years.",
      "poster_path": "/gajva2L0rPYkEWjzgFlBXCAVBE5.jpg",
      "release_date": "2017-10-04",
      "title": "Blade Runner 2049",
      "video": false,
      "vote_average": 7.3,
      "vote_count": 5636,
      "popularity": 31.401
    },
    ...
  ],
  "total_pages": 4,
  "total_results": 79
}

Then I remove the item:

$ curl -X POST \
>   "https://api.themoviedb.org/3/account/548/favorite?api_key=###&session_id=###" \
>   -H 'Content-Type: application/json' \
>   -d '{ "media_type": "movie", "media_id": 284054, "favorite": false }'

{
  "status_code": 13,
  "status_message": "The item/record was deleted successfully."
}

And finally call my list one last time to see that the item is removed:

$ curl -X GET \
>   "https://api.themoviedb.org/3/account/548/favorite/movies?api_key=###&session_id=###&sort_by=created_at.desc"

{
  "page": 1,
  "results": [
    {
      "adult": false,
      "backdrop_path": "/mVr0UiqyltcfqxbAUcLl9zWL8ah.jpg",
      "genre_ids": [
        9648,
        878,
        53
      ],
      "id": 335984,
      "original_language": "en",
      "original_title": "Blade Runner 2049",
      "overview": "Thirty years after the events of the first film, a new blade runner, LAPD Officer K, unearths a long-buried secret that has the potential to plunge what's left of society into chaos. K's discovery leads him on a quest to find Rick Deckard, a former LAPD blade runner who has been missing for 30 years.",
      "poster_path": "/gajva2L0rPYkEWjzgFlBXCAVBE5.jpg",
      "release_date": "2017-10-04",
      "title": "Blade Runner 2049",
      "video": false,
      "vote_average": 7.3,
      "vote_count": 5636,
      "popularity": 31.401
    },
    ...
  ],
  "total_pages": 4,
  "total_results": 78
}

I have the same issue, I just change the favorite to false for removing the specific movie from my favorite movies list but it is not working... can you help me out in it?

找不到电影或节目?登录并创建它吧。

全站通用

s 聚焦到搜索栏
p 打开个人资料菜单
esc 关闭打开的窗口
? 打开键盘快捷键窗口

在媒体页面

b 返回(或返回上级)
e 进入编辑页面

在电视季页面

(右箭头)下一季
(左箭头)前一季

在电视集页面

(右箭头)下一集
(左箭头)上一集

在所有图像页面

a 打开添加图片窗口

在所有编辑页面

t 打开翻译选择器
ctrl+ s 提交

在讨论页面

n 创建新讨论
w 切换关注状态
p 设为公开 / 私密讨论
c 关闭 / 开放讨论
a 打开活动页
r 回复讨论
l 跳转至最新回复
ctrl+ enter 发送信息
(右箭头)下一页
(左箭头)前一页

设置

想给这个条目评分或将其添加到片单中?

登录

还不是会员?

注册加入社区