Issues with the API

A place for developers to advertise their TheTVDB.com enabled app and get help from other developers with the API.
nonya
Posts: 3
Joined: Sat Nov 16, 2019 8:08 am

Sat Nov 16, 2019 9:16 am

I'm having similar problems with route series/{id} returning not found for any episode id.

Sample

https://www.thetvdb.com/series/fairy-gone

Code: Select all

curl -X GET --header 'Accept: application/json' --header 'Authorization: Bearer *****' 'https://api.thetvdb.com/series/359645'

Code: Select all

{
  "Error": "ID: 359645 not found"
}
MediaPolling
Posts: 1
Joined: Sat Nov 16, 2019 12:09 pm

Sat Nov 16, 2019 12:45 pm

I've had a lot of trouble migrating as well. Here's a list of the issues I've hit. I'm hopefully going to check back here to see if I can't be more active in beta testing to help.

1) As people already noted, the V1 APIs have trouble. Searching series via the URL (which didn't even need an API key previously) appears to work, however some fields are no longer returned that way (like 'Network'), at least for the tests I ran. Trying to grab a specific series / episode dump .zipped XML file seems to no longer work at all. This is ok in my app because moving over to REST / JSON is something I realistically had to do anyway, so I did so, but IMHO it should all work or none should work.

2) As people already noted the /series/<id> route appears to no longer work, and errors with 401 Not Found. A specific show that worked yesterday no longer works today, so it appears to be a not a static list of shows that are a problem. As a workaround, I'm now searching via name and returning the specific series info node that matches the ID I need. Hopefully, this will be addressed at some point because that's clunky.

3) Searching through the old interface URL allowed spaces to be translated as "+" as a lot of interfaces translate. However now the API only seems to work with %20, which in itself isn't a problem, but the interfaces I use for URL translation(.NET / Powershell, so [Uri]::EscapeUriString($seriesName) or [System.Net.WebUtility]::UrlEncode($seriesName) doesn't handle cases well when the name contains "+" or "&". An example is Penn & Teller's Fool Us:

PS F:\GREG\OneDrive\tools\MediaPolling> [Uri]::EscapeUriString("Penn & Teller_ Fool Us")
Penn%20&%20Teller_%20Fool%20Us
PS F:\GREG\OneDrive\tools\MediaPolling> [System.Net.WebUtility]::UrlEncode("Penn & Teller_ Fool Us")
Penn+%26+Teller_+Fool+Us
PS F:\GREG\OneDrive\tools\MediaPolling> [Uri]::EscapeUriString("Penn + Teller_ Fool Us")
Penn%20+%20Teller_%20Fool%20Us
PS F:\GREG\OneDrive\tools\MediaPolling> [System.Net.WebUtility]::UrlEncode("Penn + Teller_ Fool Us")
Penn+%2B+Teller_+Fool+Us

It'd be great to provide a link to how this needs to be encoded for these cases --- if there's a resource out there that provides this, I'd appreciate any references.

4) The documentation now nudges people to use JSON over XML, which is fine, but to ease the transition for others coming over from V1, it might be good to spell out what options are supported via the Accept: header for other formats. I tried a few to see if it wouldn't keep allowing XML, but I never was able to find one. That's ok because I've since moved to JSON, but it'd be good to provide a bit more info around this... again, this might be documented somewhere that I missed, so I'd appreciate any pointers.

$webclient.Headers.Add("Accept: application/json")

5) Random: can someone provide an idea or guidance on how long the tokens last for? Is that provided anywhere?

Thanks, and despite these notes I'm a huge fan of the service TheTVDB.com provides!
imthedoctor12
Posts: 9
Joined: Wed Nov 13, 2019 7:10 pm

Sat Nov 16, 2019 7:12 pm

I'm still unclear how to actually specify the API version using the accept header. Can anyone help me understand?
codegrabber
Posts: 22
Joined: Wed Mar 11, 2015 9:47 am

Sun Nov 17, 2019 12:17 am

imthedoctor12 wrote:
Sat Nov 16, 2019 7:12 pm
I'm still unclear how to actually specify the API version using the accept header. Can anyone help me understand?
Normally you should be able to set the 'Accept' header with the correct version.

Eg (php):

Code: Select all

$headers['Accept'] = 'application/vnd.thetvdb.v3.0.0';
imthedoctor12
Posts: 9
Joined: Wed Nov 13, 2019 7:10 pm

Sun Nov 17, 2019 9:38 am

Thank you codegrabber. I was afraid I was doing something wrong. Now I'm more concerned that it's not working correctly on the API side. When I send Accept:application/vnd.thetvdb.v2.2.0 in postman, the response header still indicates it's coming from 3.0.0, which still seems to be having issues finding data.
aussieconvict
Posts: 6
Joined: Sat Nov 16, 2019 12:37 am

Sun Nov 17, 2019 11:43 pm

Mediapolling,

Some feedback on some of your questions below.
1) As people already noted, the V1 APIs have trouble. Searching series via the URL (which didn't even need an API key previously) appears to work, however some fields are no longer returned that way (like 'Network'), at least for the tests I ran. Trying to grab a specific series / episode dump .zipped XML file seems to no longer work at all. This is ok in my app because moving over to REST / JSON is something I realistically had to do anyway, so I did so, but IMHO it should all work or none should work.
The V1 API (via the URL) appears to be back up and running correctly for me.
2) As people already noted the /series/<id> route appears to no longer work, and errors with 401 Not Found. A specific show that worked yesterday no longer works today, so it appears to be a not a static list of shows that are a problem. As a workaround, I'm now searching via name and returning the specific series info node that matches the ID I need. Hopefully, this will be addressed at some point because that's clunky.
The /series/{id} route also appears to be returning the correct results again. I have not tested this extensively but all requests I had been struggling with previously are now returning successfully.
5) Random: can someone provide an idea or guidance on how long the tokens last for? Is that provided anywhere?
The tokens are valid for 24 hours.This is mentioned in the introduction section on Authentication on the Swagger page.

https://api.thetvdb.com/swagger#/
Tracy
Posts: 20
Joined: Wed Oct 24, 2018 2:16 pm
Location: Brighton, UK

Mon Nov 18, 2019 4:43 am

Hi

Existing db entries seem to be returning correct data now.

However, new series entries are still missing data.

ie: https://api.thetvdb.com/series/372402 returns:

Code: Select all

{
  "data": {
    "id": 372402,
    "seriesId": "",
    "seriesName": null,
    "aliases": [],
    "season": "1",
    "poster": "",
    "banner": "",
    "fanart": "/series/372402/backgrounds/62000563.jpg",
    "status": "Continuing",
    "firstAired": "2019-11-17",
    "network": "SVT",
    "networkId": "413",
    "runtime": "30",
    "language": "en",
    "genre": [
      "Crime",
      "Documentary"
    ],
    "overview": null,
    "lastUpdated": 1574075558,
    "airsDayOfWeek": "Sunday",
    "airsTime": "10:00 PM",
    "rating": null,
    "imdbId": "",
    "zap2itId": "",
    "added": "2019-11-18 11:11:32",
    "addedBy": 67298,
    "siteRating": 0,
    "siteRatingCount": 0,
    "slug": "militarligan"
  }
}
If you go to the website, you find that there is only a Swedish translation, not an English one. I thought every entry had to have an English entry.
danhi
Posts: 21
Joined: Sun Aug 14, 2011 3:04 pm

Mon Nov 18, 2019 2:50 pm

So, is the issue with using username/userkey going to be fixed, or should I put out a new release removing this information? Do you understand the data issues enough at this point to know that apps won't need to rev to deal with whatever the problem is? I just don't like putting out revisions to my app on a frequent basis.
WastidLeprechaun
Posts: 6
Joined: Sat Nov 16, 2019 3:46 am

Fri Nov 22, 2019 1:57 pm

imthedoctor12 wrote:
Sun Nov 17, 2019 9:38 am
Thank you codegrabber. I was afraid I was doing something wrong. Now I'm more concerned that it's not working correctly on the API side. When I send Accept:application/vnd.thetvdb.v2.2.0 in postman, the response header still indicates it's coming from 3.0.0, which still seems to be having issues finding data.
I found this to be the case also. If you figure out how to reach to older endpoints, let me know please.
niallobr
Posts: 5
Joined: Sat Nov 23, 2019 7:50 am

Sun Nov 24, 2019 7:36 am

Having a problem grabbing a poster via swagger where poster exists on the website.

https://www.thetvdb.com/series/the-wheel-of-time

https://artworks.thetvdb.com/banners/se ... 999612.jpg

Request URL

Code: Select all

https://api.thetvdb.com/series/355730/images/query?keyType=poster
Response Body

Code: Select all

{
  "Error": "No results for your query"
}
Also missing from results when I try GET /series/355730.

Anything I can do?
Post Reply