thetvdb / v4-api

Founded in 2006, TheTVDB is one of the longest-running community-driven TV and Movie databases. With content metadata across hundreds of thousands of TV series and movies, TheTVDB powers many of the largest media centers in the market. Developers across the world build and rely upon TheTVDB's APIs to power their apps, utilities, and projects, generating millions of API calls per day. In our GitHub repository you will find all of the necessary support and v4 API documentation to make use of TheTVDB's metadata. Come and join us!
140 stars 13 forks source link

GET request receives error "bad request" #273

Open antheaezzell opened 1 year ago

antheaezzell commented 1 year ago

osTicket user reporting that when they logged into the api page Swagger UI (thetvdb.github.io).

They tried to perform the GET request and got error "bad request". They put in 1 or 10 or 10 or 1000 or 10000 in the "since field (lack of explanation of what this means). User also mentioned that they don't know how to put in the correct number into the field "since" it isn't clear on our API page. What does "since" mean ? a date ? a time in milliseconds, in days ? It appears not well explained.

To be more precise, is "since" a UNIX timestamp in seconds so they have to put for example 1580425200 to get updates since 2020-01-31 00:00:00 ? In this case they have an error "bad request" on this url :

https://api4.thetvdb.com/v4/updates?since=1580428800


User was told it is in EPOCH time.

osTicket: https://support.thetvdb.com/scp/tickets.php?id=18692

Additionally, this user struggled with the POST request in a separate ticket: https://support.thetvdb.com/scp/tickets.php?id=18693

{ "series": [247897,95837,363008], "movies": [367], "episodes": 0, "artwork": 0, "people": 0, "list": 0 }

There is an error issue "bad request".

antheaezzell commented 1 year ago

Internal ticket for our review - https://mediamorph.atlassian.net/browse/TVD-3612

cboutonnet commented 1 year ago

Hello, is there something new ? As for the Update issue, I successfully tried requests with epoch time values between today and 2022-11-09 but generated a bad request whre since is the epoch time of 2022-11-08 and before. For example I cannot get updates since epoch time of 2020-01-01 (if th user of my software didn't use it since thise date).

As for the POST request to add favorites, it wors only with series but with one series and I cannot remove a favorite. I cannot add a movie (ex. : 165 Avatar), like this :

{ "series": 0, "movies": 165, "episodes": 0, "artwork": 0, "people": 0, "list": 0 }

I receive a bad request response

antheaezzell commented 1 year ago

@cboutonnet I have added this additional information to the ticket, but unfortunately, our developer hasn't had a chance to address your question yet. Nothing on the API has changed in several weeks though.

cboutonnet commented 1 year ago

Hello @antheaezzell ,

any news? You open the ticket 2 weeks ago. Thank you

antheaezzell commented 1 year ago

@cboutonnet I checked with our developer and the issue is that you are using a timestamp older than 3 months ago. Your assumption that it is a unix time is correct, you just need to use a timestamp in the previous 3 month.

This is not clear in the documentation and the error code returned by the API is not clear enough, so I'll make a ticket to update that in the future.

cboutonnet commented 1 year ago

Thank you @antheaezzell your your quick response. I will upgrade my code in order to only consider updates newer than 3 months ago (aka completly reload all entities if "since" is older than 3 monts ago).

Has your developper an answer about the POST issue (add a favorite series or movie) ? How to remove a favorite ? I think it's one at a time. I succeded for a series but not for a movie

cboutonnet commented 1 year ago

Hi @antheaezzell , any news about the POST issue (add a favorite series or movie) ? How to remove a favorite ? Thank you

antheaezzell commented 1 year ago

Sorry, I have ticketed the issue, but I don't have an answer for you yet @cboutonnet we will look at moving up the priority.

cboutonnet commented 1 year ago

Thank you for your answer. Yes, please, moving up the priority should be appreciated.

Christophe

cboutonnet commented 1 year ago

Hi @antheaezzell, we are now th 10th of april 2023 and I have still no news. Is it too complicated to get an answer ? Thank you

maxifwortman commented 1 year ago

Hi @cboutonnet sorry for the late response, I am just seeing this thread. About your issue with the favorites, there is problem with the payload you are using. It should be the singular name of the entities. So in your case the correct payload for movies favorites will be:

{
    "movie":165
}

This was wrong in the doc, so it was also fixed in there. About your other issue, at this moment we dont have an endpoint to remove favorites.

cboutonnet commented 1 year ago

Thank you for your answer. I can see you have fixed the doc. I will also make the correction in my code