Project

General

Profile

Changes to JSON API

Added by Sascha Schmidt about 11 years ago

Hi,

I've read about some changes within the json api.
Is there any documentation regarding JSON functions, operations and results?

For example:

curl --data "op=listTags" 'http://client:[email protected]:9981/channeltags'

Still delivers the right informations for me (all channel tags).

But:

curl --data "op=list" 'http://client:[email protected]:9981/channels'

gives me a

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML><HEAD>
<TITLE>1 Unknown returncode</TITLE>
</HEAD><BODY>
<H1>1 Unknown returncode</H1>
</BODY></HTML>

Thanks
Sascha


Replies (6)

RE: Changes to JSON API - Added by Adam Sutton about 11 years ago

Sascha,

The JSON API is going through significant changes, and as yet is not well defined, however part of the changes are about producing a fully defined spec that is more applicable for general usage (i.e. it will be defined and compatibility will be maintained).

For now, if you're using the new code in master, you need /api/channel/list, to retrieve a key/val set of channels (key = channel UUID, and val = Channel name). If you want to drill down further you can request each idnode with "/api/idnode/load?uuid=UUID". I think I did include a means of getting multiple entries, and I thought there was a way to get a more full channel list (to avoid the 2 stage).

But any comments on what people would like to see in the API is very welcome.

Adam

RE: Changes to JSON API - Added by Sascha Schmidt about 11 years ago

Yeah, thanks! This is what I was looking for.
But, the old list had the positive aspect that I could see which tags a channel has.

For building application access to tvheadend I need an easy way (with less requests to tvh) to create a bouqet/channel list. I'm using the tags to create bouqets where channels are located in. Additionally with informations of channel icon, ...

Perhaps someone knows the 2nd way to get a full featured channel list (you mentioned)...

Greets
Sascha

RE: Changes to JSON API - Added by Sascha Schmidt about 11 years ago

[...] tvheadend/src/api/api_channel.c gave me the hint: "channel/grid"

 curl 'http://client:[email protected]:9981/api/channel/grid'

... results in a complete channel list with all informations I need. The only thing I'm wondering about is that the list is not complete. A lot of channels are missing. Is it a "paged" output?

RE: Changes to JSON API - Added by Sascha Schmidt about 11 years ago

Fetching additional channelinfo is a real pain. Someone has a hint to fetch icons, ...?

curl 'http://client:[email protected]:9981/api/idnode/load?uuid=<channel uuid>'

Will fetch detailed infos. But I really don't know which structure this json-object has.

RE: Changes to JSON API - Added by nicolas Hovnanian almost 11 years ago

Sascha Schmidt wrote:

[...] tvheadend/src/api/api_channel.c gave me the hint: "channel/grid"

[...]

... results in a complete channel list with all informations I need. The only thing I'm wondering about is that the list is not complete. A lot of channels are missing. Is it a "paged" output?

Hi you must change limit like :

http://client:[email protected]:9981/api/channel/grid&limit=200'

by default it's 50

RE: Changes to JSON API - Added by nicolas Hovnanian almost 11 years ago

How can we get epg for specific channel ??

Before we did :

http://192.168.2.27:9981/epg?start=0&limit=5&channel=TF1

for "TF1" Channel, now "&channel=TF1" is not accepted and send me back all channels epg (with limit 5) (tried also with uuid but not reconize also)

Thx by advance

    (1-6/6)