<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jsonp Archives - MIDAS - Room Booking System | Blog</title>
	<atom:link href="https://mid.as/blog/tag/jsonp/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>...Making your facilities work for you!</description>
	<lastBuildDate>Tue, 11 Feb 2025 14:14:47 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>Upcoming New Features in the MIDAS API</title>
		<link>https://mid.as/blog/new-features-in-the-midas-api/</link>
					<comments>https://mid.as/blog/new-features-in-the-midas-api/#respond</comments>
		
		<dc:creator><![CDATA[midas]]></dc:creator>
		<pubDate>Wed, 05 Jul 2017 14:47:46 +0000</pubDate>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[jsonp]]></category>
		<guid isPermaLink="false">https://mid.as/blog/?p=2081</guid>

					<description><![CDATA[<p>To coincide with our next release of MIDAS, v4.16, we&#8217;ll also be releasing an update to the optional MIDAS API. Our optional API access addon offers a programmatic and bi-directional interface to a MIDAS scheduling system. The API can be used to extract data from a MIDAS system. This data can then be processed and [&#8230;]</p>
<p>The post <a href="https://mid.as/blog/new-features-in-the-midas-api/">Upcoming New Features in the MIDAS API</a> appeared first on <a href="https://mid.as/blog">MIDAS - Room Booking System | Blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:66.66%">
<p>To coincide with our next release of MIDAS, <a href="//mid.as/blog/tag/v4-16/">v4.16</a>, we&#8217;ll also be releasing an update to the optional <a href="//mid.as/api">MIDAS API</a>.</p>



<p>Our optional <a href="https://mid.as/glossary/api" class="dfn">API</a> access addon offers a programmatic and bi-directional interface to a MIDAS scheduling system.</p>



<p>The API can be used to extract data from a MIDAS system. This data can then be processed and used within your website and applications.</p>



<p>The API can also be used to make changes to settings and data within a MIDAS system. For instance, the API could be used to automate the adding of new bookings.</p>



<p>Or, the API can be used to interface MIDAS with other 3rd party software apps&#8230;. the possibilities are near endless!</p>
</div>



<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:33.33%"><figure class="wp-block-post-featured-image"><img fetchpriority="high" decoding="async" width="742" height="586" src="https://mid.as/blog/wp-content/uploads/2021/08/api-abstract.png" class="attachment-post-thumbnail size-post-thumbnail wp-post-image" alt="API" style="object-fit:cover;" srcset="https://mid.as/blog/wp-content/uploads/2021/08/api-abstract.png 742w, https://mid.as/blog/wp-content/uploads/2021/08/api-abstract-300x237.png 300w" sizes="(max-width: 742px) 100vw, 742px" /></figure></div>
</div>



<p>To further increase the power and usefulness of the MIDAS API, we&#8217;re adding a couple of significant features in the forthcoming API update:</p>



<h2 class="wp-block-heading">NEW: Command Line Support</h2>



<p>Until now, all calls to the API had to be made via HTTP transactions. With the next update, you&#8217;ll also be able to make API calls directly from the command line! (self hosted editions only). API calls made in this way have the added benefit of being significantly more efficient and faster (assuming the call is made from the command line on the same server as the MIDAS system), as they do not require an HTTP transaction to be conducted.</p>



<p>To make API calls from the command line, simply call &#8220;api.pl&#8221; (located within your server&#8217;s MIDAS directory) and pass API parameters and values via command line switches.</p>



<p>For example, to retrieve the currently installed version of MIDAS from the Windows command line (cmd):</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="//mid.as/img/windows-command-line-api-call.png" alt="A MIDAS API call made from the Windows Command line (cmd)"/></figure>
</div>


<p>&#8230;or from Windows PowerShell:</p>


<div class="wp-block-image">
<figure class="aligncenter"><img decoding="async" src="//mid.as/img/windows-powershell-api-call.png" alt="A MIDAS API call made from Windows PowerShell"/></figure>
</div>


<h2 class="wp-block-heading">NEW: Optional JSONP Support</h2>



<p>By default, the MIDAS API outputs in <a class="dfn" href="https://mid.as/glossary/json">JSON</a> format. However following feedback from API users, we&#8217;re also introducing optional JSONP support with the next update to the API.</p>



<p>If you don&#8217;t know what JSONP is, then you probably don&#8217;t need it!</p>



<p>JSONP is a method commonly used to bypass the cross-domain policies in web browsers. Typically, modern browsers won&#8217;t allow you to make AJAX (Asynchronous Javascript) requests from one domain to another domain perceived to be on a different server.</p>



<p>For instance, if your MIDAS system is running on server A, and you wish to make client-side API calls through Javascript, you would typically only be able to make such AJAX requests from pages residing on server A itself. Attempting to initiate an AJAX request for server A from server B would be blocked by the user&#8217;s browser.</p>



<p>JSON and JSONP behave differently on the client and the server. JSONP requests are not dispatched using the XMLHTTPRequest and the associated browser methods. Instead, a &lt;script&gt; tag is created, the source of which is set to the target URL. This script tag is then added to the DOM (normally inside the element).</p>



<p>JSONP support in the MIDAS API (which is disabled by default) can be enabled via the API settings screen.</p>



<div style="color: red; background-color: rgba(255,0,0,.2); border: solid yellow thin; padding: 5px;"><small><b>WARNING:</b> Before enabling JSONP support, you should instead look to use <a href="https://www.html5rocks.com/en/tutorials/cors/">CORS (Cross Origin Resource Sharing)</a> wherever possible, as JSONP has <a href="https://stackoverflow.com/questions/613962/is-jsonp-safe-to-use">inherent security risks</a> as it injects Jasacript code directly into your web pages</small></div>



<p>With JSONP support enabled, you&#8217;d then be able to pass the name of a Javascript function in a &#8220;callback&#8221; parameter along with your API calls.</p>



<p>Consider a simple API call to retrieve the version number of MIDAS (passing the &#8220;<code>action</code>&#8221; parameter with a value of &#8220;<code>get_setting</code>&#8220;, and a &#8220;<code>setting</code>&#8221; parameter with a value of &#8220;<code>version</code>&#8220;). The typical JSON response would be:</p>



<p><code style="color: orange;">{"version":"4.16"}</code></p>



<p>Now consider the same API call, with JSONP support enabled, and an additional &#8220;<code>callback</code>&#8221; parameter passed with a value of &#8220;<code>myfunction</code>&#8220;. The JSONP response would then be:</p>



<p><code style="color: orange;">myfunction({"version":"4.16"})</code></p>



<p>The &#8220;<code>callback</code>&#8221; parameter must contain the name of an existing Javascript function on the calling page.</p>



<p>Upon receiving the JSONP response, the user&#8217;s browser will execute the &#8220;myfunction&#8221; Javascript function, passing the JSON data <code>{"version":"4.16"}</code> to it accordingly.</p>
<p>The post <a href="https://mid.as/blog/new-features-in-the-midas-api/">Upcoming New Features in the MIDAS API</a> appeared first on <a href="https://mid.as/blog">MIDAS - Room Booking System | Blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mid.as/blog/new-features-in-the-midas-api/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)
Database Caching 2/34 queries in 0.012 seconds using Disk

Served from: mid.as @ 2026-04-07 16:54:34 by W3 Total Cache
-->