Kodi Community Forum
WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps - 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)
+--- Thread: WebServer HTTP API (HttpApi): for PocketPC and Web-client Remote Control Apps (/showthread.php?tid=8760)

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

- Livin - 2005-05-19

do you have a full command list for the httpapi?

i'd like to try my hand at building a web page.

also, do you have support (or can you add it) for deleting files and folders?


- thor918 - 2005-05-19

deletefile is in the api

look at the list at the bottom of

in fact typing the http command "help" at the xbox
would bring the whole list to you

Quote:/* parse an xbmc http api command */
int cxbmchttp::xbmcprocesscommand( int eid, webs_t wp, char_t *command, char_t *parameter)
if (!strcmp(command, "clearplaylist"))              return xbmcclearplaylist(wp, parameter);  
else if (!strcmp(command, "addtoplaylist"))         return xbmcaddtoplaylist(wp, parameter);  
else if (!strcmp(command, "playfile"))              return xbmcplayerplayfile(wp, parameter);
else if (!strcmp(command, "pause"))                 return xbmcaction(wp,1);
else if (!strcmp(command, "stop"))        return xbmcaction(wp,2);
else if (!strcmp(command, "restart"))        return xbmcexit(wp,1);
else if (!strcmp(command, "shutdown"))      return xbmcexit(wp,2);
else if (!strcmp(command, "exit"))        return xbmcexit(wp,3);
else if (!strcmp(command, "reset"))        return xbmcexit(wp,4);
else if (!strcmp(command, "restartapp"))  return xbmcexit(wp,5);
else if (!strcmp(command, "getcurrentlyplaying"))  return xbmcgetcurrentlyplaying(wp);
else if (!strcmp(command, "getdirectory"))    return xbmcgetdirectory(wp, parameter);
else if (!strcmp(command, "gettagfromfilename"))  return xbmcgettagfromfilename(wp, parameter);
else if (!strcmp(command, "getcurrentplaylist"))  return xbmcgetcurrentplaylist(wp);
else if (!strcmp(command, "setcurrentplaylist"))  return xbmcsetcurrentplaylist(wp, parameter);
else if (!strcmp(command, "getplaylistcontents"))  return xbmcgetplaylistcontents(wp, parameter);
else if (!strcmp(command, "removefromplaylist"))  return xbmcremovefromplaylist(wp, parameter);
else if (!strcmp(command, "setplaylistsong"))    return xbmcsetplaylistsong(wp, parameter);
else if (!strcmp(command, "getplaylistsong"))    return xbmcgetplaylistsong(wp, parameter);
else if (!strcmp(command, "playlistnext"))    return xbmcplaylistnext(wp);
else if (!strcmp(command, "playlistprev"))    return xbmcplaylistprev(wp);
else if (!strcmp(command, "getpercentage"))    return xbmcgetpercentage(wp);
else if (!strcmp(command, "seekpercentage"))    return xbmcseekpercentage(wp, parameter);
else if (!strcmp(command, "setvolume"))      return xbmcsetvolume(wp, parameter);
else if (!strcmp(command, "getvolume"))      return xbmcgetvolume(wp);
else if (!strcmp(command, "getthumb"))      return xbmcgetthumb(wp, parameter);
else if (!strcmp(command, "getthumbfilename"))  return xbmcgetthumbfilename(wp, parameter);
else if (!strcmp(command, "lookupalbum"))      return xbmclookupalbum(wp, parameter);
else if (!strcmp(command, "choosealbum"))      return xbmcchoosealbum(wp, parameter);
else if (!strcmp(command, "downloadinternetfile"))return xbmcdownloadinternetfile(wp, parameter);
else if (!strcmp(command, "getmoviedetails"))    return xbmcgetmoviedetails(wp, parameter);
else if (!strcmp(command, "showpicture"))      return xbmcshowpicture(wp, parameter);
else if (!strcmp(command, "setkey"))        return xbmcsetkey(wp, parameter);
else if (!strcmp(command, "deletefile"))      return xbmcdeletefile(wp, parameter);
else if (!strcmp(command, "copyfile"))      return xbmccopyfile(wp, parameter);
else if (!strcmp(command, "fileexists"))      return xbmcfileexists(wp, parameter);
else if (!strcmp(command, "setfile"))        return xbmcsetfile(wp, parameter);
else if (!strcmp(command, "getguistatus"))    return xbmcgetguistatus(wp);
else if (!strcmp(command, "execbuiltin"))      return xbmcexecbuiltin(wp, parameter);
 else if (!strcmp(command, "config"))              return xbmcconfig(wp, parameter);
 else if (!strcmp(command, "help"))            return xbmchelp(wp);
 else if (!strcmp(command, "getsysteminfo"))    return xbmcgetsysteminfo(wp);
else {
webswrite(wp, "<li>error:unknown command\n");
return 0;

- Livin - 2005-05-20


thank you! :thumbsup:

- nad - 2005-05-22

i have uploaded documentation for the api here: httpapi docs

the docs are still very brief but i will expand on them soon - i promise.


- thor918 - 2005-05-22

it sure is easier to look at that doc than diving in the code Smile

- sijones - 2005-06-06

i am trying to get a .strm to launch using this url,


and am having no joy.

does anybody have any suggestions as to what else i can try?


- thor918 - 2005-06-06

you got the command wrong
"playfile" is the command. i think it is case sensitiv

cvs builds prior to 22 may 2005 only recognise lower case commands. later build are case invariant

- nad - 2005-06-12

just uploaded v1.0 of my client to sourceforge.

added: slideshow functionality
added: new ini settings for root type (i.e video, music, picture) - see ini section below
fixed: xbmc sometimes crashes if certain combinations of commands are sent at high speed. temp fix by inserting a delay (default 200ms) between certain commands.


- pike - 2005-06-13

sorry for "raping" this thread <span id='me'><center>pike slaps pike</center></span>

is there anyway to launch an xbe via http urlstring ? with cvs or with (any?) additional patches

if there is, how ?

- thor918 - 2005-06-13

yes there is. using the builtin xbmc command
i would guess it would be like this.




i think it's the last url.

- Nuka1195 - 2005-06-27

i've tried from two different computers and a friend has tried from a different location to download xbmccontrol.zip from sourceforge.

i have to open it in winrar, windows built-in zip reader won't work and there is a single file called xbmccontrol, no extension. dated 6.27.2005 12:18 pm, file size 205,981 packed 198,138.

i'll re-read this thread, but is there something i missed or is there a problem with the zip file maybe?

edit: nevermind, i was trying to download from your patch page. great app.

- nad - 2005-06-28

nuka1195: thanks.

pike and thor918: command=execbuiltin&parameter=xbmc.runxbe(xbe) is the correct syntax to use, however, if you had tried it you most likely would have found xbmc locking up. yesterday, i uploaded a fix for this bug.


- pike - 2005-06-29

thx nad! closed the sf bug accordingly

- pulp_136 - 2005-06-30

nad, thanks for your effort.

my question is, can i use this with vb6 ? (the only pl that i can sort of use). preferably with your source module, or, if that's not possible, how do i give the http commands from within vb6?

something else: if i use xbmc as a dashboard is there a possibility to launch specific back-up games with your api? i'm thinking of creating a touchscreen control app for the xbmc.

thanks in advance

- nad - 2005-06-30


you can definitely use vb6. however, you won't be able to use my module directly, you will first to port it from vb.net which should be very straightforward. in fact it was something i was planning on doing. i can't remember the vb6 approach to sending http commands i'll look it up and post back here.

you should be able to execute games using the command discussed in the posts in this thread from a couple of days back, i.e.:


where xbe would be the filename of the game you wish to execute.