Difference between revisions of "Requests"

From MSX - Wiki
Jump to navigation Jump to search
 
(18 intermediate revisions by the same user not shown)
Line 1: Line 1:
If JSON files are requested from a server, a version parameter <code>v</code> and a timestamp parameter <code>t</code> are automatically appended. For example, the action <code>content:http://msx.benzac.de/info/data/guide/videos.json</code> will result in following request <code>http://msx.benzac.de/info/data/guide/videos.json?v=0.1.128&t=1612867695816</code>.
+
If JSON files are requested from a server, a version parameter <code>v</code> (which indicates the current Media Station X version) and a timestamp parameter <code>t</code> (which indicates the current timestamp) are automatically appended. Please see following action examples and the corresponding HTTP requests.
 +
* <code>menu:http://msx.benzac.de/info/data/guide/actions.json</code> → <code>http://msx.benzac.de/info/data/guide/actions.json?v=0.1.128&t=1612867695816</code>.
 +
* <code>content:http://msx.benzac.de/info/data/guide/videos.json</code> <code>http://msx.benzac.de/info/data/guide/videos.json?v=0.1.128&t=1612867695816</code>.
  
Since version '''0.1.128''', it is also possible to replace specific keywords inside a JSON URL with the corresponding values. For example, the action <code>content:http://msx.benzac.de/info/data/guide/videos.json?host={HOST}&secure={SECURE}&client={CLIENT}&platform={PLATFORM}&player={PLAYER}&width={WIDTH}&height={HEIGHT}</code> will result in following request <code>http://msx.benzac.de/info/data/guide/videos.json?host=msx.benzac.de&secure=false&client=212.201.104.11&platform=default&player=html5%2Fplugin&width=1280&height=720&v=0.1.128&t=1612868128244</code>.
+
Since version '''0.1.128''', it is also possible to replace specific keywords inside a JSON URL with the corresponding values. Please see following available keywords (please note that the keyword <code>{ID}</code> is only available in version '''0.1.142''' or higher, and the keyword <code>{LANGUAGE}</code> is only available in version '''0.1.160''' or higher).
 +
 
 +
<code>{HOST}</code>, <code>{SECURE}</code>, <code>{CLIENT}</code>, <code>{PLATFORM}</code>, <code>{ID}</code>, <code>{PLAYER}</code>, <code>{LANGUAGE}</code>, <code>{WIDTH}</code>, <code>{HEIGHT}</code>.
 +
 
 +
Please see following action examples and the corresponding HTTP requests.
 +
* <code>menu:http://msx.benzac.de/info/data/guide/actions.json?platform={PLATFORM}</code> → <code>http://msx.benzac.de/info/data/guide/actions.json?platform=default&v=0.1.128&t=1612867695816</code>.
 +
* <code>content:http://msx.benzac.de/info/data/guide/videos.json?platform={PLATFORM}&player={PLAYER}</code> → <code>http://msx.benzac.de/info/data/guide/videos.json?platform=default&player=html5%2Fplugin&v=0.1.128&t=1612867695816</code>.
 +
* <code>slideshow:http://msx.benzac.de/info/data/guide/images.json?width={WIDTH}&height={HEIGHT}</code> <code>http://msx.benzac.de/info/data/guide/images.json?width=1280&height=720&v=0.1.128&t=1612867695816</code>.
 +
* <code>video:resolve:http://msx.benzac.de/services/resolve.php?type=video&host={HOST}&secure={SECURE}&platform={PLATFORM}&player={PLAYER}</code> → <code>http://msx.benzac.de/services/resolve.php?type=video&host=msx.benzac.de&secure=false&platform=default&player=html5%2Fplugin&v=0.1.128&t=1612867695816</code>.
 +
 
 +
'''Note: If you want to use the <code>{LANGUAGE}</code> keyword for the startup data, you have to use the <code>reference</code> property, because the dictionary (which defines the language) is loaded after the startup data. The language at startup (when no dictionary is loaded yet) always has the value <code>"default"</code>.'''

Latest revision as of 08:42, 10 October 2024

If JSON files are requested from a server, a version parameter v (which indicates the current Media Station X version) and a timestamp parameter t (which indicates the current timestamp) are automatically appended. Please see following action examples and the corresponding HTTP requests.

Since version 0.1.128, it is also possible to replace specific keywords inside a JSON URL with the corresponding values. Please see following available keywords (please note that the keyword {ID} is only available in version 0.1.142 or higher, and the keyword {LANGUAGE} is only available in version 0.1.160 or higher).

{HOST}, {SECURE}, {CLIENT}, {PLATFORM}, {ID}, {PLAYER}, {LANGUAGE}, {WIDTH}, {HEIGHT}.

Please see following action examples and the corresponding HTTP requests.

Note: If you want to use the {LANGUAGE} keyword for the startup data, you have to use the reference property, because the dictionary (which defines the language) is loaded after the startup data. The language at startup (when no dictionary is loaded yet) always has the value "default".