What Is an Api in Relation to Kodi Log Uploader
THIS API IS DEPRECATED As of the Dharma release of XBMC, this API is deprecated. |
ane HTTP API Overview
This certificate provides data on XBMC's Application Programming Interface (API). The API operates over the HyperText Transfer Protocol and hence is called "HTTPAPI".
The API commands are also bachelor over ASP and from Python (run into later sections).
Unless otherwise noted, this documentation describes what's available in XBMC eight.x. Any commands that were added or modified at a different version will show a appointment indicating when.
i.1 Getting Started
The XBMC HTTP API provides a mechanism for a networked device (e.1000. a PC or a PDA with WiFi) to collaborate with XBMC. The API provides access to XBMC status information and allows control of XBMC functions.
The API can exist chosen from a standard web browser, which will also brandish whatsoever results. This method is probably the easiest style to experiment with the API commands. Fire up your browser and enter the following into the address field:
http://xbox/xbmcCmds/xbmcHttp?command=getcurrentlyplaying
Information most the media currently beingness played past XBMC will be displayed, if null is being played then "[Naught Playing]" will be displayed.
If you desire to control the volume of XBMC enter the following into your browser'southward address field:
http://xbox/xbmcCmds/xbmcHttp?command=setvolume(80)
"OK" volition exist displayed and the volume will be ready to fourscore% which yous will probably observe is rather tranquillity.
If you find that the to a higher place commands don't work then cheque that:
- XBMC is running.
- The XBMC web server has been turned on. This setting can be institute in Settings, Network, Server.
- The address "xbox" is understood by your browser to point to your Xbox'due south address. You may need to enter the full IP address eastward.g. 192.168.0.one
- Yous didn't mistype the control.
Notation: If you lot are a Windows user, y'all can configure a proper noun for your Xbox's IP address. Use your favorite text editor to edit the file "hosts" inside C:\WINDOWS\system32\drivers\etc\ and add a line at the end with your Xbox'southward IP address.
192.168.0.1 xbox
Relieve information technology (you don't demand to restart). Windows should now redirect "xbox" to your Xbox's IP address. You lot can check to see if information technology works by typing "ping xbox" at the command line.
Another simple exam is to enter xbox as an address in your spider web browser. Try to visit:
http://xbox
This should display the default XBMC web page. If this does not piece of work you may run into an error, or your browser might redirect to Microsoft's xbox.com. If you can't go http://xbox to redirect, yous can always replace "xbox" in the post-obit examples with your Xbox'due south IP address.
i.two Part Syntax
One time you accept the to a higher place working we can look at the structure of the HTTP control line.
All HTTP API commands start with the post-obit:
http://xbox/xbmcCmds/xbmcHttp?command=
(Remember you may need to replace "xbox" with your Xbox's IP address.)
The next function of the line is the command itself, which in the 2 examples above are "getCurrentlyPlaying" and "setVolume". The command is not case sensitive: "SetVolume", "setvolume" and "SETVOLUME" tin likewise exist used.
Many commands have parameter values. To provide command parameters enclose them in parentheses -- "(" and ")" (also note that the old syntax of appending with "¶meter=" however works).
Depending on the command the parameter values may or may not be case sensitive. It is always safest to assume the values are case sensitive. If there are multiple parameters and then each value is separated past a semi-colon ";". The following is an example of a control with 4 parameters.
http://xbox/xbmcCmds/xbmcHttp?control=takescreenshot(exam.jpg;false;0;300;200;90)
To pass a semi-colon as a parameter (rather than a separator) use two semi-colons ";;".
To pass an empty parameter insert a infinite between the semi-colons "; ;".
To pass an empty parameter equally the last (correct near) parameter apply "%20" (if only a space is appended to the end, the browser will remove it and XBMC will not detect the final parameter).
You may encounter like unexpected behavior with other characters besides the space. You can encode whatever graphic symbol that is causing problems using the standard %xx format (RFC1738) earlier passing it to the API.
We recommend using the new role syntax (passing parameters inside parentheses, rather than appending them to the URL with the sometime "¶meter=" syntax) because it is easier for XBMC to recognize the end of the control (i.e. the closing bracket). This is important when issuing commands from a browser environment (e.g. using Javascript), considering a typical way of ensuring the browser does not use a cached response from a previous initiation of a control is to use the syntax:
var url = 'http://xbox/xbmcCmds/xbmcHttp?command=SetPlaylistSong(1)?nocache=' + new Date().getTime();
The date.getTime() always ensures a unique number is included in the generated URL, which ensures that the browser won't use a previously cached response. (XBMC ignores everything afterwards the ")" and hence doesn't get confused by the residual of the line.)
We besides recommend the function syntax for commands without parameters:
var url = 'http://xbox/xbmcCmds/xbmcHttp?command=GetCurrentlyPlaying()?nocache=' + new Date().getTime();
ane.3 Response Structure
The API returns information in a consistent form but which is dependent on the blazon of information returned. Those commands which:
- don't return a value e.g. SetVolume render the standard response OK
- return a single value e.g. GetVolume return only the value
- return multiple values e.g. GetCurrentlyPlaying render multiple lines with each line having the format
- name:value
An mistake in the execution of a command, for instance a missing parameter, is indicated by the response:
Error[:Reason]
i.eastward. all errors are indicated by returning "Error" and depending on the error at that place may be additional information provided.
due east.yard.
Error:Missing parameter
The following is the default response format. To modify the format see the command SetResponseFormat.
Every line in the response is prefixed by the HTML tag <li>. The but exception to this is the GetThumb command where a prefix is not included. The use of this prefix means that the responses are displayed clearly inside a browser but the <li> tag does non require a corresponding close tag i.e. </li> is not required.
Finally, and to create a valid HTML response, the whole response is meridian and tailed with the web server's default header and footer.
1.4 Sample Lawmaking
Probably the easiest way to get up to speed with a new API is to have a look at code. Several of the applications that can be establish hither: HTTPAPI customer apps come with source code. In detail look for the file XBMCHttpInterface.vb which wraps up the majority of the HTTP API within a .Net class. The file can be found inside the bundle XBMCControl. There are also examples that show how to phone call the HTTP API from an Excel spreadsheet and from Visual Bones six.
ii Accessing the HTTP API
The easiest way to access the HTTP API is to type the URL into a web browser, equally described in the overview. This method allows you lot to tweak your command and parameters and receive immediate visual feedback.
To get the most out of the API, though, y'all'll probably desire to incorporate it into a more powerful tool. The web browser HTTP API is available to ASP, Python (for both scripts and plugins), and can be broadcast to control other clients.
Each access method uses a slightly different context, but the commands and parameters are the aforementioned. One time you've learned how to use the HTTP API in the environment of your choice, all the commands listed below are available to you.
two.1 ASP
Access HTTP API commands with ASP using the command "xbmcAPI" in the same mode you would employ "xbmcCommand" (see default.asp in the XBMC web directory for more information). Laissez passer the HTTP API command to xbmcAPI equally a string, containing exactly the same name and the same parameters you would use to call the command from the URL. The only difference is that parameters should be separated with commas instead of semi-colons.
e.g.
Response = xbmcAPI("GetCurrentlyPlaying");
The response structure is also identical (formatted as an HTML document) except that the web server'south default header and footer volition not be nowadays.
2.ii Python
Access HTTP API commands with Python using the function executehttpapi (imported from the xbmc module). Pass the HTTP API command to executehttpapi as a string, containing exactly the aforementioned name and the same parameters you would employ to telephone call the command from the URL. The only divergence is that parameters should be separated with commas instead of semi-colons, just as y'all would do in a regular Python function phone call.
east.g.
import xbmc response = xbmc.executehttpapi("TakeScreenShot(special:\\temp\exam.jpg,false,0,300,200,90)")
The response structure is also identical (formatted as an HTML certificate) except that the web server's default header and footer will not exist nowadays.
2.3 Circulate
The Circulate functionality is not, strictly speaking, function of the HTTP API because it does non use the HTTP protocol. Even so, it is controlled via HTTP API commands and would typically be used as an adjunct to the HTTP API and and then is presented here.
The HTTP API is a "pull" architecture -- that ways HTTP API interacts with XBMC by making calls to XBMC. For an HTTP API client to maintain a dynamic upwards-to-date brandish (e.one thousand. showing the currently playing vocal), the customer must continually poll XBMC for its status.
The Broadcast facility provides the opposite approach -– XBMC makes calls out (i.e. broadcasts or "pushes") to bespeak significant events to any clients that happen to exist listening.
The Broadcast facility uses the UDP circulate protocol with a default port setting of 8278. (We chose 8278 for no other reason than that it was the first unregistered port we stumbled across.) For a client to receive these broadcasts, the client must register to receive them. (The method of doing so volition depend on the language/applied science of the client). XBMC broadcasts on the IP address 255.255.255.255 which is the express broadcast address. Sending a UDP datagram to this address delivers the message to whatsoever host on that circulate network. Because routers never forward messages sent to this accost, simply hosts on the connected network run into these broadcasts. In other words, the client must be on the local network to receive XBMC broadcasts.
XBMC broadcasts are delimited by <b></b> and may consist of a numerical or textual description of the outcome (depening on the event) followed by ";" and the level of the event (e.g. one or 2).
An example Windows client (with source code), XBMC Listener, that listens to these broadcasts can exist constitute here
3 Understanding the Command Tables
This section presents a complete list of HTTP API commands, divided into tables based on functionality. In the tables, each control gets its own 3-column row. The first column contains the function name, followed by parentheses. Within the parentheses are the function's parameters (if whatsoever). When calling these functions, each parameter should exist included in order, separated by semi-colons (for HTTP API URLs) or commas (for Python or ASP calls).
In the offset column, any parameter proper noun in square brackets is optional. Optional parameters typically have default values, but you lot can override these by supplying a different value for custom performance.
The second column contains a brief description of the function, and the third cavalcade contains an instance URL.
A sample entry from the tables below looks like this:
As a reminder, the function syntax for an HTTP API URL looks similar this:
http://xbox/xbmcCmds/xbmcHttp?control=setvolume(50)
If you prefer, you can still use the old syntax:
http://xbox/xbmcCmds/xbmcHttp?command=setvolume¶meter=50
3.ane Example Links
In the third column y'all'll find a sample URL for the function. Assuming you have XBMC running and configured appropriately, clicking on the example link should load the link in your browser window. Depending on your setup and the command y'all're using, you may need to edit the link in your browser's address bar and attempt again. 1 of the nigh common necessary changes is replacing "xbox' with your Xbox'south IP address (e.g. 192.168.i.101). As an example:
http://xbox/xbmcCmds/xbmcHttp?control=GetCurrentlyPlaying -> http://192.168.1.101/xbmcCmds/xbmcHttp?command=GetCurrentlyPlaying
In one case the URL is pointing to your Xbox, near of the examples will work as is. Others (which may refer to a specific file, for example), will crave you to manually alter the link to advisable values for your environs.
3.2 A Note about URL Formatting
Some of the examples utilize the lawmaking "%twenty" in identify of spaces (" "). This is a standard URL code (or "token") that helps URL interpreters recognize the true end of a URL. In the case of this wiki, it helps the certificate formatting go on the entire http:// cord as a unmarried, active link. If you lot are manually typing the command into a spider web browser address bar, or using it from your own code, so you unremarkably blazon spaces without any issues.
3.3 A Annotation about Playlists
In the following tables the Playlist parameter refers to one of the two available media blazon playlists using the value 0 or 1:
0. Music playlist one. Video playlist
These playlists should not exist dislocated with:
- The slideshow playlist. The slideshow commands implicitly refer to the latter.
- User-defined playlist files (e.m m3u files).
4 Command Tables Reference
The commands are presented in five sections. Those commands that:
- retrieve information
- set/alter information
- perform/initiate an action
- perform an action on a file
- don't fit into one of the above and hence are miscellaneous
- HTTPAPI commands and examples
iv.1 Commands that Retrieve Information
Command | Information | Case |
---|---|---|
GetMediaLocation(type; [path]; [option]; [lineStart; [numLines]]) | Type is one of music, video, pictures, files. path is the path. pick is ane of pathsonly, showdate lineStart is the first item in the list to return (beginning entry is 0 not ane) and numLines is the number of items to return. numLines cannot exist specified without specifying lineStart. If numLines is not specified then all entries from lineStart to the cease of the list will exist returned. | http://xbox/xbmcCmds/xbmcHttp?control=GetMediaLocation(music;f:\;pathsonly) Return merely the first x items: http://xbox/xbmcCmds/xbmcHttp?command=Getmedialocation(music;f:\music\;0;ten) Render the next 10 items: http://xbox/xbmcCmds/xbmcHttp?command=Getmedialocation(music;f:\music\;10;10) |
GetShares(blazon; [option]) | Type is one of music, video, pictures, files. option is i of pathsonly, appendone | http://xbox/xbmcCmds/xbmcHttp?command=GetShares(music) |
GetCurrentPlaylist | Retrieves the current playlist identifier. | http://xbox/xbmcCmds/xbmcHttp?command=GetCurrentPlaylist() |
GetCurrentlyPlaying([thumbFilename],[nothingPlayingFilename],[onlyIfChanged],[extended],[slideThumbFilename]) | Retrieves the filename, details and status of the currently playing media. If onlyIfChanged = true then information will only be returned if the media's condition has changed since the last time this command was called. A tag has been added, Changed, that indicates whether the media has inverse since the terminal time this command was called. Additional functionality has been added to help simplify a browser based client's display of the current playing media's thumbnail. If thumbFilename is specified then on calling GetCurrentlyPlaying the current media'southward thumbnail is saved to the file thumbFilename. This filename should include the absolute path on the XBox (from the perspective of XBMC) to where to store the thumbnail. The location should be such that it is exposed by XBMC's web server e.g. special:\\xbmc\spider web\pollex.jpg. nothingPlayingFilename is the thumbnail to display if nothing is currently playing. Again it should include the consummate path to an image file from the perspective of XBMC (nothingPlayingFilename is copied to thumbFilename when GetCurrentlyPlaying is called and nothing is playing). All the client needs to do is point their browser at the served address of thumbFilename. [Added x Feb 2010] If extended is true the command is extended to get additional responses while a slideshow and audo is playing. Prior to this extension the data returned (e.thou. filename) but refered to the slideshow rather than the sound being played. Setting extended to truthful results in values such as SlideFilename (likewise as Filename) being returned. | http://xbox/xbmcCmds/xbmcHttp?control=GetCurrentlyPlaying http://xbox/xbmcCmds/xbmcHttp?command=GetCurrentlyPlaying(special:\\xbmc\web\pollex.jpg) http://xbox/thumb.jpg (this will brandish the thumbnail generated by the in a higher place phone call) |
GetCurrentSlide | Retrieves the file name of the image currently being displayed. | http://xbox/xbmcCmds/xbmcHttp?command=GetCurrentSlide() |
GetDirectory(directory;[mask];[option]; [lineStart; [numLines]]) | Retrieves the contents of the directory specified by directory. If selection = one ( or = showdate) then file modified dates will be appended. mask can accept the following grade: .mp3 or [music] (and the obvious corresponding values for other media types and file extensions) and returns just the matching files. (To specify multiple file extensions utilise the bar "|" character eastward.g. .mp3|.wma.) mask tin can also take the form: "*" or "/" and returns just folders. An empty mask (i.e."") returns all files and folders. lineStart is the first item in the list to return (outset entry is 0 not 1) and numLines is the number of items to return. numLines cannot be specified without specifying lineStart. If numLines is not specified then all entries from lineStart to the terminate of the listing will exist returned. | http://xbox/xbmcCmds/xbmcHttp?command=GetDirectory(F:\music\;.mp3;1) Return just the kickoff 10 items: http://xbox/xbmcCmds/xbmcHttp?command=GetDirectory(F:\music\;.mp3;i;0;10) Return the next 10 items: http://xbox/xbmcCmds/xbmcHttp?control=GetDirectory(F:\music\;.mp3;1;x;10) |
GetGuiDescription | Retrieves various GUI values. (Currently but the screen resolution) | http://xbox/xbmcCmds/xbmcHttp?command=GetGUIDescription() |
GetGuiSetting(type; name) | Retrieves the value of GUI setting proper noun. type specifies whether the setting is of type integer (0), boolean (ane) or bladder (2) which must exist fix correctly or could cause a crash. name is the name of the setting to get the value of. For a list of setting names see GUISettings.cpp. | http://xbox/xbmcCmds/xbmcHttp?command=getguisetting(0;system.shutdowntime) |
GetGuiStatus() | Retrieves diverse data virtually the condition of the GUI. | http://xbox/xbmcCmds/xbmcHttp?command=getGUIStatus() |
GetMovieDetails(mediaPath) | Retrieves details of the movie mediaPath | http://xbox/xbmcCmds/xbmcHttp?command=getMovieDetails(f:\movies\test.avi) |
GetPercentage | Retrieves the current playing position of the currently playing media as a percentage of the media's length. | http://xbox/xbmcCmds/xbmcHttp?control=getpercentage() |
GetPlaylistContents([playlist]) | Retrieves the contents (file names) of the current playlist or the playlist specified past playlist. Playlist takes one of the following values: 0 – Music playlist, 1 – Temporary music playlist, 2 – Video playlist, 3 – Temporary video playlist. (Since 26 Nov 2006: 0 - Music playlist, ane - Video playlist) | http://xbox/xbmcCmds/xbmcHttp?command=GetPlaylistContents(one) |
GetPlaylistLength([playlist]) | Retrieves the length of the electric current playlist or the playlist specified by playlist. | http://xbox/xbmcCmds/xbmcHttp?command=GetPlaylistLength(0) |
GetPlaylistSong([position]) | Retrieves the currently playing vocal number in the playlist. If the optional parameter position is provided the command volition return the file name of the media at location position in the playlist. | http://xbox/xbmcCmds/xbmcHttp?command=GetPlaylistSong() |
GetPlaySpeed | Retrieves the current playing speed. | http://xbox/xbmcCmds/xbmcHttp?command=GetPlaySpeed() |
GetMusicLabel(item) | Retrieves audio data relating to the currently playing media. The specific information to think is specied by info which is an integer corresponding to one of the MUSICPLAYER_* constants that can be establish in GUIInfoManager.h The case retrieves the codec currently being used. | http://xbox/xbmcCmds/xbmcHttp?command=GetMusicLabel(217) |
GetRecordStatus | Retrieves whether XBMC is in record mode. | http://xbox/xbmcCmds/xbmcHttp?command=GetRecordStatus() |
GetVideoLabel(particular) | Retrieves video information relating to the currently playing media. The specific data to remember is specied past info which is an integer respective to ane of the VIDEOPLAYER_* constants that can be institute in GUIInfoManager.h The instance retrieves the rating of the video currently existence played. | http://xbox/xbmcCmds/xbmcHttp?command=GetVideoLabel(270) |
GetSlideshowContents | Retrieves the contents (file names) of the slideshow playlist. | http://xbox/xbmcCmds/xbmcHttp?command=GetSlideshowContents() |
GetSystemInfo(InfoIds) | Retrives System Information by id number(the information on the system info page in xbmc). You can supply multipal numbers if you lot wish to retreive a bunch at a time. This sample will go Version of XBMC & Build Date. For a full list of Id's encounter GUIInfoManager.h. | http://xbox/xbmcCmds/xbmcHttp?command=GetSystemInfo(120;121) |
GetSystemInfoByName(InfoNames) | Retrives System Information past name (the information on the system info page in xbmc). You can supply multipal names if you wish to retreive a bunch at a time. Go downwardly to the "CGUIInfoManager::TranslateSingleString" section in GUIInfoManager.cpp and you will detect all the InfoNames values | http://xbox/xbmcCmds/xbmcHttp?control=GetSystemInfoByName(atmospheric condition.location;weather.temperature) |
GetTagFromFilename(filename) | Retrieves data for the audio file filename | http://xbox/xbmcCmds/xbmcHttp?command=GetTagFromFilename(F:\music\examination.mp3) |
GetThumbFilename(album;location) | Retrieves the file name of the corresponding thumbnail for the music media file with file name anthology and path location | http://xbox/xbmcCmds/xbmcHttp?command=GetThumbFilename(test.mp3;F:\music\) |
GetVolume | Retrieves the electric current volume setting as a percent of the maximum possible value. | http://xbox/xbmcCmds/xbmcHttp?command=GetVolume() |
GetLogLevel | Retrieves XBMC's current log level | http://xbox/xbmcCmds/xbmcHttp?control=GetLogLevel() |
QueryMusicDatabase | Provides a SQL interface to query the XBMC Music Database. WARNING: Some of the read commands can be and so complex or recollect so much data that it can impact the operation of XBMC eastward.g. retrieving all songs from a reasonably large data base can bring xbmc to its knees. | http://xbox/xbmcCmds/xbmcHttp?command=querymusicdatabase(select%20strArtist%20from%20artist%20order%20by%20strArtist) http://xbox/xbmcCmds/xbmcHttp?command=querymusicdatabase(select%xx*%20from%20artist%20where%20strArtist%20LIKE%20'%%the%%') |
QueryVideoDatabase | Provides a SQL interface to the XBMC Video Database. See QueryMusicDatabase for further information. | http://xbox/xbmcCmds/xbmcHttp?command=queryvideodatabase(select%20path.strpath%20from%20path) |
iv.2 Commands that Modify Settings
Command | Data | Example |
AddToPlayList(media;[playlist];[mask];[recursive]) | Adds a file or folder (media is either a file or a folder) to the electric current playlist or the playlist specified by playlist. To specify a file mask utilise mask e.g. .mp3|.wma. If recursive = "ane" and media is a binder so all appropriate media inside subfolders beneath media will be added otherwise simply media within the folder media will be added. Default behaviour is to exist recursive. mask can now also be set to ane of the following values (including the foursquare brackets) [music], [video], [pictures], [files] in which instance XBMC'due south current set of file extensions for the type specified will be used as the mask. | http://xbox/xbmcCmds/xbmcHttp?command=AddToPlayList(F:/music/test2.mp3;i) |
AddToPlayListFromDB(blazon;argument) | Adds a set of items to the playlist using an SQL argument. The type parameter is one of the following: [songs], [movies], [episodes] or [musicvideos]. The argument is an SQL condition after the WHERE clause. | http://xbox/xbmcCmds/xbmcHttp?control=AddToPlayListFromDB(songs;idAlbum=362) |
AddToSlideshow(media;[mask];[recursive]) | Adds a file or binder (media is either a file or a folder) to the slideshow playlist. To specify a file mask use mask e.1000. .jpg|.bmp If recursive = "1" and media is a folder and then all appropriate media inside subfolders below media will be added otherwise only media within the binder media will be added. Default behaviour is to be recursive. mask tin can now too exist set to i of the following values (including the foursquare brackets) [music], [video], [pictures], [files] in which case XBMC's current set of file extensions for the type specified volition exist used as the mask. (Note it only makes much sense for this command to employ a value of [pictures]. | http://xbox/xbmcCmds/xbmcHttp?control=AddToSlideshow(F:\apps\xbmc\media\) |
ClearPlayList([playlist]) | Clears the electric current playlist or the playlist specified by playlist. | http://xbox/xbmcCmds/xbmcHttp?command=ClearPlayList(1) |
ClearSlideshow | Clears the slideshow playlist. | http://xbox/xbmcCmds/xbmcHttp?command=ClearSlideshow() |
Mute | Toggles the sound on/off. | http://xbox/xbmcCmds/xbmcHttp?command=Mute() |
RemoveFromPlaylist(item,[playlist]) | Removes media from the current playlist or from playlist playlist. item tin be either an integer specifying the position in the playlist of the item to be removed or the consummate path (including filename) of the media to exist removed. It is not possible to remove the media if it is currently being played. | http://xbox/xbmcCmds/xbmcHttp?control=RemoveFromPlaylist(f:\test2.mp3;1) |
SeekPercentage | Sets the playing position of the currently playing media every bit a per centum of the media'southward length. | http://xbox/xbmcCmds/xbmcHttp?command=SeekPercentage(l) |
SeekPercentageRelative | Adds/Subtracts the electric current percentage on to the current postion in the song | http://xbox/xbmcCmds/xbmcHttp?command=SeekPercentageRelative(-10) |
SetCurrentPlaylist(playlist) | Sets the electric current playlist to playlist. | http://xbox/xbmcCmds/xbmcHttp?control=SetCurrentPlaylist(1) |
SetGUISetting(type; name; value) | Sets the value of GUI setting proper name to value. Type specifies whether the setting is of blazon integer (0), boolean (i) or bladder (2) which must be set correctly or could crusade a crash. For a total listing of setting names encounter GUISettings.cpp. | http://xbox/xbmcCmds/xbmcHttp?command=SetGUISetting(0;system.shutdowntime;10) |
SetPlaylistSong(position) | Sets the media at playlist position position to be the side by side particular to be played. The example sets the position to the 6th song in the playlist | http://xbox/xbmcCmds/xbmcHttp?control=SetPlaylistSong(5) |
SetPlaySpeed(speed) | Sets the playing speed to the integer speed. | http://xbox/xbmcCmds/xbmcHttp?command=SetPlaySpeed(speed) |
SlideshowSelect(filename) | Sets the slideshow playlist position by specifying the file name of the next prototype to show. | http://xbox/xbmcCmds/xbmcHttp?command=SlideshowSelect(filename) |
SetVolume | Sets the book as a percent of the maximum possible. | http://xbox/xbmcCmds/xbmcHttp?control=SetVolume(l) |
SetLogLevel | Sets XBMC'southward log level | http://xbox/xbmcCmds/xbmcHttp?command=SetLogLevel(1) |
SetAutoGetPictureThumbs | If set to Truthful so media thumbnails volition be automatically created when required. (Default: True.) | http://xbox/xbmcCmds/xbmcHttp?command=SetAutoGetPictureThumbs(simulated) |
Swapplaylistitems(playlist;item1;item2) | Hither item1 and item2 are either offsets in the playlist, or the path to an item. | http://xbox/xbmcCmds/xbmcHttp?command=Swapplaylistitems(playlist.pls;5;2) |
4.three Commands that Generate Actions
Command | Information | Example |
Action | Sends a raw Activeness ID (encounter [ane]) to xbmc. Be careful with this i since it runs the action on the webserver thread and depending on the action could lock the GUI thread. The example sends ACTION_MOVE_DOWN. | http://xbox/xbmcCmds/xbmcHttp?command=Action(4) |
Exit | Reboots to dashboard | http://xbox/xbmcCmds/xbmcHttp?control=Exit() |
KeyRepeat(rate) | Sets whether and how fast a primal sent using SendKey should repeat. rate is the echo rate in milliseconds (e.g. thousand = 1s). rate = 0 stops keys repeating. | http://xbox/xbmcCmds/xbmcHttp?control=KeyRepeat(k) |
Move(deltaX, deltaY) | Moves the currently displayed and ZOOMed (run across zoom command below) image by the distance specified by deltaX and deltaY. The zoom magnification must exist greater than 0 or the command has no effect. | http://xbox/xbmcCmds/xbmcHttp?control=Movement(50;20) |
Intermission | Pauses the currently playing media. If a slideshow and sound is active simply the slideshow is paused. | http://xbox/xbmcCmds/xbmcHttp?control=Pause() |
PauseExSlide | [Added 10 Feb 2010] Pauses the currently playing media unless a slideshow and audio is agile in which case it just pauses the audio. | http://xbox/xbmcCmds/xbmcHttp?command=PauseExSlide() |
PlayListNext | Starts playing the next media in the current playlist. | http://xbox/xbmcCmds/xbmcHttp?command=PlayListNext |
PlayListPrev | Starts playing the previous media in the current playlist. | http://xbox/xbmcCmds/xbmcHttp?command=PlayListPrev |
PlayNext | Starts playing/showing the next media/image in the electric current playlist or, if currently showing a slidshow, the slideshow playlist. | http://xbox/xbmcCmds/xbmcHttp?command=PlayNext() |
PlayNextExSlide | [Added 10 Feb 2010] Starts playing/showing the next media/image in the current playlist or, if currently showing a slidshow, the audio playlist. | http://xbox/xbmcCmds/xbmcHttp?command=PlayNextExSlide() |
PlayPrev | Starts playing/showing the previous media/paradigm in the current playlist or, if currently showing a slidshow, the slideshow playlist. | http://xbox/xbmcCmds/xbmcHttp?command=PlayPrev() |
PlayPrevExSlide | [Added 10 Feb 2010] Starts playing/showing the previous media/prototype in the current playlist or, if currently showing a slidshow, the sound playlist. | http://xbox/xbmcCmds/xbmcHttp?command=PlayPrevExSlide() |
PlaySlideshow([directory];[recursive]) | Starts the slideshow. Directory specifies a folder of images to add together to the slideshow playlist. If recursive has a value of True and then all directories beneath directory are searched for images and added to the slideshow playlist. | http://xbox/xbmcCmds/xbmcHttp?control=PlaySlideshow(F:\pictures;true) |
PlayFile(filename;[playlist]) | Starts playing the media file filename on playlist playlist or if playlist is not specified the electric current playlist. | http://xbox/xbmcCmds/xbmcHttp?command=PlayFile(F:\music\exam.mp3) |
Reset | Resets XBMC | http://xbox/xbmcCmds/xbmcHttp?control=Reset() |
Restart | Restarts XBOX | http://xbox/xbmcCmds/xbmcHttp?control=Restart() |
RestartApp | Restarts XBMC | http://xbox/xbmcCmds/xbmcHttp?command=RestartApp() |
Rotate | Rotates the currently displayed image past 90 degree clockwise. | http://xbox/xbmcCmds/xbmcHttp?command=Rotate() |
SendKey(buttoncode;[LeftTrigger];[RightTrigger];[LeftThumbX];[LeftThumbY] ;[RightThumbX];[RightThumbY]) | Initiates a button, primal or mouse event. Buttoncode specifies the type of event and the other parameters specify boosted data that is specific to each buttoncode value. See fundamental.h for the the listing of keycodes. The case calls the shutdown menu.
| http://xbox/xbmcCmds/xbmcHttp?command=SendKey(0xF053) http://xbox/xbmcCmds/xbmcHttp?command=SendKey(61523) |
ShowPicture(filename) | Displays the image filename. | http://xbox/xbmcCmds/xbmcHttp?control=ShowPicture(F:\apps\xbmc\media\splash.png) |
Shutdown | Shutdown XBOX | http://xbox/xbmcCmds/xbmcHttp?command=Shutdown() |
SpinDownHardDisk | If possible stops the hard disk (saves ability / quieter) | http://xbox/xbmcCmds/xbmcHttp?command=SpinDownHardDisk() |
Stop | Stops the currently playing media. If a slideshow and audio is active merely the slideshow is stopped. | http://xbox/xbmcCmds/xbmcHttp?control=Stop() |
StopExSlide | [Added ten Feb 2010] Stops the currently playing media. If a slideshow and audio is active only the audio is stopped. | http://xbox/xbmcCmds/xbmcHttp?command=StopExSlide() |
TakeScreenshot([filename];[flash];[rotation];[width];[height];[quality];[download];[imgtag]) | Captures the current contents of the Xbox screen. If no parameters and then the action is the aforementioned as initiating a regular screenshot command with the epitome beingness saved in the screenshot directory. If filename is provided so the prototype is saved to filename. If flash=Truthful the screen will flash as the command executes. If resolution, width, height and quality are given then those values are used to define the rotation (in degrees), resolution and jpeg quality of the saved image. If download = True then the image is downloaded to the client as a base64 encoded stream. The command must accommodate to i of: No parameters Filename, flash, rotation, width, height, quality Filename, flash, rotation, width, height, quality, download Filename, flash, rotation, width, pinnacle, quality, download, imgtag NEW: imgtag is new it volition put a Convert Base64 to image tag with the Base64 lawmaking so in firefox browsers it volition show the prototype instead of the Base64 code. | http://xbox/xbmcCmds/xbmcHttp?command=takescreenshot(test.jpg;truthful;0;300;200;ninety;true;imgtag) |
Zoom(magnification) | Zooms the currently displayed image to a level specified by magnifaction. A magnification of 0 is the standard zoom level of none. Magnification can have values upwards to eight. | http://xbox/xbmcCmds/xbmcHttp?command=Zoom(4) |
4.4 Commands that Modify Files
Command | Data | Example |
FileCopy(sourceFilename, destinationFilename) | Copies the Xbox file sourceFilename to the Xbox file desitinationFilename. | http://xbox/xbmcCmds/xbmcHttp?command=FileCopy(F:\apps\xbmc\media\splash.png;E:\pictures\) |
FileDelete(filename) | Deletes the Xbox file filename. | http://xbox/xbmcCmds/xbmcHttp?command=FileDelete(F:\pictures\kim-smith-1024x768–22677.jpg) |
FileDownload(filename;[bare]) | Download a file specified by filename from the Xbox to the client as a base64 stream. If the optional parameter 'bare' is specified the webheader and webfooter won't exist included which results in only a raw base64 stream. | http://xbox/xbmcCmds/xbmcHttp?command=FileDownload(F:\apps\xbmc\default.xbe) |
FileDownloadFromInternet(URL;[filename];[blank]) | Downloads the file with accost URL to the client as a base64 encoded stream. If the filename parameter is nowadays, the downloaded file is likewise saved on the Xbox as the file filename. If the optional parameter 'bare' is specified the webheader and webfooter won't be included which results in just a raw base64 stream. | http://xbox/xbmcCmds/xbmcHttp?command=FileDownloadFromInternet(http://wallpapers.skins.exist/kim-smith/kim-smith-1024x768–22677.jpg;F:\pictures\kim-smith-1024x768–22677.jpg) To test quickly: http://xbox/xbmcCmds/xbmcHttp?command=ShowPicture(F:\pictures\kim-smith-1024x768–22677.jpg) |
FileExists(filename) | Returns True if the Xbox file filename exists otherwise returns False. | http://xbox/xbmcCmds/xbmcHttp?command=FileExists(F:\pictures\kim-smith-1024x768–22677.jpg) |
FileSize(filename) | Returns the file size of filename. | http://xbox/xbmcCmds/xbmcHttp?command=FileSize(F:\pictures\kim-smith-1024x768–22677.jpg) |
FileUpload(filename, contents) | Uploads a file encoded as a base64 string contents to the file filename on the Xbox. The instance creates on the xbox the file f:\examination.txt with the contents hello. | http://xbox/xbmcCmds/xbmcHttp?control=fileUpload(f:\exam.txt;aGVsbG8%3d) |
four.5 Miscellaneous Commands
Control | Information | Instance |
ChooseAlbum(URL) | Retrieves the comprehend prototype and review text of the anthology with URL URL as returned by the LookupAlbum command. The URL must be encoded using the standard %xx format(RFC1738) before being passed to the API. The case here is passing the URL http://www.allmusic.com/cg/amg.dll?p=amg&sql=10:7vz1z87a6yvn | http://xbox/xbmcCmds/xbmcHttp?command=choosealbum(http%3a%2f%2fwww%2eallmusic%2ecom%2fcg%2famg%2edll%3fp%3damg%26sql%3d10%3a7r6cmpea9f8o) |
LookupAlbum(album[;artist;boolRelevance]) | Looks upwards the album with proper noun anthology on an Internet music site and returns the resulting matches as a list with the format: album_name<@@>album_URL If boolRelevance has a value of 1 a relevance score (ranging from ane (perfect) to 0) will as well be returned with the following format: album_name<@@>album_URL<@@@>score When requesting releveance scores information technology is best to include a value for the creative person only it is not necessary. | http://xbox/xbmcCmds/xbmcHttp?command=lookupalbum(On%20an%20Island) http://xbox/xbmcCmds/xbmcHttp?command=lookupalbum(On%20an%20Island;david%20gilmour;1) |
Config(command; parameters) | Provides access to the ASP configuration commands. command is the ASP command and parameters is a semi-colon separated list of parameters to accompany the control. command is 1 of bookmarksize, getbookmark, addbookmark, savebookmark, removebookmark. For further information see: XBMCConfiguration.cpp. Note that the WebServer must be running to employ this control. [Since ten Nov 2007 the WebServer does not need to exist running] | http://xbox/xbmcCmds/xbmcHttp?command=Config(bookmarksize;20) http://xbox/xbmcCmds/xbmcHttp?command=Config(getbookmark;music;name;one) http://xbox/xbmcCmds/xbmcHttp?command=Config(getbookmark;music;path;1) |
WebServerStatus([status]) | If no parameter is provided the function returns the status of the WebServer (On or Off). Where a parameter is provided status must be either on (turns the WebServer on) or off (turns the WebServer off). Note that merely Python scripts tin use the version with the parameter. | http://xbox/xbmcCmds/xbmcHttp?command=WebServerStatus() |
ExecBuiltIn(role) | Executes the XBMC 'congenital-in' function office. For the list of available functions see: the listing of Built In Functions OR ExecBuiltIn Functions | http://xbox/xbmcCmds/xbmcHttp?control=ExecBuiltIn(Notification(WARNING,SHUTTING%20DOWN%20SYSTEM!)) |
Help | Displays a list of some (Not ALL) of the HTTPApi commands | http://xbox/xbmcCmds/xbmcHttp?command=Help() |
SetResponseFormat(format; value) | Sets the format of the response from HTTPApi. Format takes ane of the following: WebHeader – if True then the default spider web server header will be prepended to the response (ignored for Python and ASP responses). WebFooter – if True then the default web server footer will be appended (ignored for Python and ASP responses). Header – A user definable string that volition exist added after the WebHeader (if present) and earlier the main body of the response. Footer – A user definable string that volition be before after the WebFooter (if present) and later the main torso of the response. OpenTag – A user definable cord that will be inserted earlier each element of the chief response. CloseTag – A user definable cord that will be inserted after each chemical element of the main response. Whether to insert this tag subsequently the final element is defined by the CloseFinalTag setting. CloseFinalTag – if True and so the final chemical element will have a endmost tag. WebHeader=Truthful WebFooter=True Header="" Footer="" OpenTag="<li>" CloseTag=[carriage return] CloseFinalTag=Fake OpenRecordSet="" CloseRecordSet="" OpenRecord="" CloseRecord="" OpenField="<li>" CloseField="" It is at present possible to specify multiple formats in a single call to SetResponseFormat. SetResponseFormat without any parameters returns the formatting to the default values (as would restarting xbmc). | http://xbox/xbmcCmds/xbmcHttp?command=SetResponseFormat(WebHeader;Fake) The post-obit sets upwardly an XML formatted response (if viewing the output in a browser you will neeed to use the view source command to see the xml tags). http://xbox/xbmcCmds/xbmcHttp?command=setresponseformat(webheader;simulated;webfooter;false;header;<xml>;footer;</xml>;opentag;<tag>;closetag;</tag>;closefinaltag;true) So the same for the QueryMusicDatabase response: http://xbox/xbmcCmds/xbmcHttp?control=setresponseformat(openRecordSet;<recordset>;closeRecordSet;</recordset>;openRecord;<record>;closeRecord;</record>;openField;<field>;closeField;</field>) Now set everything back to the default: http://xbox/xbmcCmds/xbmcHttp?command=SetResponseFormat() |
getXBETitle(path) | Return the Championship/Description of the specifed XBE | http://xbox/xbmcCmds/xbmcHttp?control=getxbetitle(special:\\xbmc\default.xbe) |
getXBEid(path) | [Returns the id of a specifed XBE | http://xbox/xbmcCmds/xbmcHttp?command=getxbeid(special:\\xbmc\default.xbe) |
4.6 Broadcast Commands
Command | Information | Example |
Broadcast(bulletin;port) | Non sure if there is much point to this command - probably could exist used to examination a client listening for broadcasts. If the port parameter is non specified then the currently set default port will be used. | http://xbox/xbmcCmds/xbmcHttp?control=Circulate(hello_from_xbmc) |
SetBroadcast(level;port) | Sets the brodcast level and port. Leve50 currently takes iii values: 0 - no broadcasts, i - media playback and startup & shutdown events, two - "OnAction" events (e.one thousand. buttons) as well every bit level ane events. [Added Jan 2010] In addition adding 128 to this value changes the format of the broadcast to include the IP address of the XBMC box sending the broadcast. [Added 21 March 2010 (rev 28740)] In addition adding 256 to this value changes the format of the broadcast to include the port number (as well equally the IP address) of the XBMC box sending the broadcast. (Useful for when there are multiple XBMC boxes present.) Port is optional and if specified sets the default broadcast port value. | http://xbox/xbmcCmds/xbmcHttp?command=SetBroadcast(ane) |
GetBroadcast() | Returns the current level and port settings. | http://xbox/xbmcCmds/xbmcHttp?control=GetBroadcast() |
4.7 Name Changes
To make the names of the commands more logical some have been changed. The old names are still recognised merely we strongly advise that y'all use the new names.
One-time Name | New Name |
CopyFile | FileCopy |
DeleteFile | FileDelete |
GetInternetFile | FileDownloadFromInternet |
GetThumb | FileDownload |
GUISetting | SetGUISetting, GetGUISetting |
SetFile | FileUpload |
SetKey | SendKey |
Source: https://kodi.wiki/view/Archive:Web_Server_HTTP_API
0 Response to "What Is an Api in Relation to Kodi Log Uploader"
Post a Comment