Can't get new UserAPI methods to work via test page

nzmike wrote 9 years ago: 1

I signed up for Bronze (for now, until I see if the API is useful to me), went to the new API test page and authorized it (and yes, I have an API key on the dashboard) but no matter which method I try (with the "Try It Out" button) I just get a 401 response saying "invalid username or key". So I'm confused - is there something else I'm meant to do to get these methods working via the test page? What I'd expect to see is the full URL including the API key but all I see is an unadorned URL like this:

http://api.tvmaze.com/v1/user/follows/shows/3256

And the Response Body is as follows.

{ "name": "Unauthorized", "message": "Invalid username or API key", "code": 0, "status": 401 }

Can someone please point me in the right direction or check this out for me please?

Thanks,

Mike


david wrote 9 years ago: 1

Are you absolutely sure you're using your username (nzmike) as username, and your API key as password?

Alternatively you could easily test with curl: curl http://username:apikey@api.tvmaze.com/v1/user/follows/shows/3256

nzmike wrote 9 years ago: 1

Hi David, when I authorised it I must have put my site password in sorry - one of the fields says "Password" so that's what I entered. (You might want to change that to "Password (API Key)" for dummies like me that don't read properly.) I just reauthorised with my API key and it works now - apologies for wasting your time.

In terms of the new API in future I'd really like to see the capability to manipulate a show by season - i.e: get all episodes (with the acquired/watched/skipped flag) and to be able to set the flag for a whole season as well. Occasionally I'll add in a show to TVMaze that I've overlooked (like Breaking Bad for example) where I watched the first few seasons prior to adding it in, so I'd like to be able to select a season from my app and update the flag for the whole season. I know you must have a million other things to do first but I believe that would be useful.


david wrote 9 years ago: 1

No problem, it's not very clear but the "password" label is quite hardcoded into Swagger.

I'll keep your requests in mind, thanks!

nzmike wrote 9 years ago: 1

David,

Further to my request I wanted to try and explain why I (and others I'm assuming) would want "season view" API methods.

In my app which runs across any Windows 10 device I have a list of all the shows I'm following - this I can now get from the new API so all good.

If I click on a show a second panel shows the program info (description, image, cast etc) which I can get from the existing API.

The final panel shows the seasons and episodes along with a watched flag at both season and epsiode level - but without a "season view" (or entire show view) I will have to call the "marked episodes" service once for every single episode in every season so I can indicate to the user if the episode is watched or not (and populate a check box so they can change it). This is going to be really slow (and cause so many more hits to the website) hence why I think this is something that is needed sooner rather than later. What I'm seeing is that you can request all marked episodes for all shows (which is way too much info to get every time) or one single episode for a single show - but nothing in between. So a whole show view with season number and ID, episode season, number and ID and the watched flag would be ideal and/or the same based on passing in a season Id or number for a show.

I'm assuming other people are doing similar sorts of apps to mine or are going to want to show which episodes have been watched or not so I would hope this is something that can be seriously considered. As I said, I do appreciate you guys must have a long list of tasks but for me this is a really big hole in the new API that needs to be filled.

Thanks for listening/reading - hope it all makes sense :-)

PS: If you think it would be useful I could copy this into a new thread topic in case others want to contribute/agree/disagree/flame me.


david wrote 9 years ago: 1

I think it would be very useful (and pretty easy to do) to add a show_id filter to the GET user/episodes endpoint. It'd give you the same data as it does now, but only for that specific show.

While this wouldn't return any season information directly, that should largely solve your use case right? (Since you already have episode id's locally you can match season information based on the ID's yourself)

nzmike wrote 9 years ago: 1

Yes, that would definitely work for me David - we'd get a JSON node for each episode right? I could just match the episode ID back to the show information I already have from the normal APi..

Any idea when you might be able to implement this?


david wrote 9 years ago: 1

It's up! (Might have to force refresh the apidoc before you see it)

nzmike wrote 9 years ago: 1

Many thanks for that, it does make a huge difference. I'm at work now so will have to look tonight.

Try 30 days of free premium.