Sprijin Bază de date filme (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 răspunsuri (pe pagina 1 din 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?

Nu găsiți un film sau un serial? Autentificați-vă pentru a-l crea.

Globale

s focalizează bara de căutare
p deschide meniul profilului
esc închide o fereastră deschisă
? deschide fereastra cu scurtături de la tastatură

Pe paginile media

b mergi înapoi (sau la părinte atunci când este cazul)
e mergi la pagina de editare

Pe paginile sezoanelor filmelor seriale

(săgeată dreapta) mergi la sezonul următor
(săgeată stânga) mergi la sezonul precedent

Pe paginile episoadelor filmelor seriale

(săgeată dreapta) mergi la episodul următor
(săgeată stânga) mergi la episodul precedent

Pe toate paginile de imagini

a deschide fereastra pentru adăugarea de imagini

Pe toate paginile de editare

t deschide selectorul de traduceri
ctrl+ s trimite formularul

Pe paginile de discuții

n crează o discuție nouă
w comută starea de vizionare
p comută publică/privată
c comută închisă/deschisă
a deschide activitatea
r răspunde la discuție
l mergi la ultimul răspuns
ctrl+ enter trimite mesajul
(săgeată dreapta) pagina următoare
(săgeată stânga) pagina precedentă

Setări

Doriți să evaluați sau să adăugați acest articol într-o listă?

Autentificare