JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32) +--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93) +---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174) +---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
|
- erhnam - 2010-09-28 I want to program a php front end to control my XBMC machine. Can anyone here provide me with an example on how to start on this? I tried to capture the result of the GetShares but the array doesn't look very nice. Anyone here knows how to do this so I can use functions like explode and trim. Code: <?php - MKay - 2010-09-28 I think you are using the old HTTP-API. The JSON-RPC-API requires that you send a POST-Request with JSON-formatted data. Have a look at the JavaScript-code of AWX :-) - erhnam - 2010-09-28 Got my first call with php working Code: <?php Append fixed value - pfeifer - 2010-09-29 There is anyway to append at the response a fixed value? Code: Code: For have the followinf response Code: JSON result: { Thanks in advance Pfeifer - dstruktiv - 2010-09-29 pfeifer Wrote:There is anyway to append at the response a fixed value? That's what ID is for, differentiating request/response pairs. Otherwise if it's not for identification then you would append the value AFTER the response comes back. - jitterjames - 2010-09-29 is JSON supported in this version: xbmc-r33778-Dharma_beta2.exe ? If so, is there anything that I need to do to turn it on, or configure it, or does it use the same settings at the http api on xbmc's system / network window? it seems that nightly builds are currently disabled. I am not interested in building xbmc myself, but I would like to start playing with json since I am currently using the http-api and would like to move forward when the time comes... thanks. Info on params - pfeifer - 2010-09-29 I am working very happy with JsonRpc. I need to know the workaround for have only the album_artist and not all the artists included for e.g. in compilation where the album_artist is in my case "Various Artists". How may I modify the following code? Code: {"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "params": { "start": 0, "sort": { "order": "ascending", "method": "artist" } }, "id": 1} Thanks Sandro - MKay - 2010-09-29 jitterjames Wrote:is JSON supported in this version:yes, the Dharma beta2 has JSON-support. You need to enable the webserver like you do with the old http-api. - jitterjames - 2010-09-29 thanks Mkay. Got it working now with xbmc remote 0.3 on same machine as xbmc. Hopefully it'll work as well through the lan. I just needed confirmation, because I thought I already had that version of xbmc installed, but apparently I did not! - erhnam - 2010-09-30 Do you know if this is working or not: Code: curl -i -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "file": "/home/xbmc/Music/Alternative Singles/Air - All I Need.mp3", "id": 1}' http://localhost:9019/jsonrpc I tried this but the output is always zero, while the response of the first command is: Code: { return playlist: Code: { Fixed it. Should be: Code: curl -i -X POST -d '{"jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": { "file": "/home/xbmc/Music/Adele - 19/101-adele-daydreams.mp3"}, "id": 1}' http://localhost:9019/jsonrpc - Anastrophe - 2010-09-30 <oops wrong post> - erhnam - 2010-09-30 A question; When I select the song of an album I also want to queue the rest of the songs. How do you deal with that? The song has a songid, so I can I do a for each to queue every other song with a higher songid? Or do I have problems then with names and the order of the songs? What's the best approach for this? - dstruktiv - 2010-09-30 erhnam Wrote:A question; Song has an album attribute I think. Use that. - jitterjames - 2010-09-30 Will the JSON interface allow calling a script with an argument? I could never get that to work with the http interface, and it would be really sweet! - topfs2 - 2010-10-01 jitterjames Wrote:Will the JSON interface allow calling a script with an argument? At some point yeah, I can't see why not. The reason for it not being there now is mostly that security, while more or less implemented, isn't really turned on. So all insecure stuff (like calling script, alter library) haven't been added yet. |