trakt / api-help

Trakt API docs at https://trakt.docs.apiary.io
184 stars 7 forks source link

Bug in add to watchlist API #335

Closed Mihai-B closed 2 years ago

Mihai-B commented 2 years ago

Making a post request to https://api.trakt.tv/sync/watchlist and body:

{
    "shows": [
        {
            "ids": {
                "trakt": 155536
            }
        }
    ]
}

Returns a response: status code: 201 Body:

{
    "added": {
        "movies": 0,
        "shows": 0,
        "seasons": 0,
        "episodes": 0
    },
    "existing": {
        "movies": 0,
        "shows": 0,
        "seasons": 0,
        "episodes": 0
    },
    "not_found": {
        "movies": [],
        "shows": [],
        "seasons": [],
        "episodes": [],
        "people": [],
        "users": []
    }
}

But it does not add the show to the watchlist.

Is it the API or am I doing something wrong here ?

reboot commented 2 years ago

Maybe that is just a problem in the post and not in the actual request, but there is a closing } missing in your JSON after the Trakt-Id.

Mihai-B commented 2 years ago

It was just a problem in the post. I updated it now and I also formated a bit the JSONs.

Mihai-B commented 2 years ago

I have also tried with the full show body as described in the API docs. SO the example body looks like this:

{
    "shows": [
        {
            "ids": {
                "trakt": 169009,
                "tmdb": 110492,
                "slug": "peacemaker-2022",
                "imdb": "tt13146488",
                "tvdb": 391153
            },
            "title": "Peacemaker",
            "year": 2022
        }
    ]
}

Still nothing is added to the watchlist on Trakt

tysonkerridge commented 2 years ago

Based on your examples I wasn't able to reproduce your issue. Have you got other endpoints that you're hitting that are working correctly, or are they all not working? You may need to include the headers and such that you're sending in order for others to help further.

Mihai-B commented 2 years ago

Hi tysonkd I have the endpoints for add rating, mark as watched, check in, etc, they all work. But this one does not... Out of curiosity, what do you receive as response when you add something to the watchlist ?

Edit: I do want to mention that they used to work.

Mihai-B commented 2 years ago

I found the issue. I was missing the content type header.... my bad