How to Install and use joomla rest api step by step - joomla2.5

Please help, I Want to use REST api in joomla 2.5 !! I searched a lot and spend many days in Github and techjoomla. I didn't get it how to install API extension or Plugin and use that...
Even I didn't find any proper documentation to use API. And from where to install It....
Can anyone please explain me step by step how to install API plugin with proper link to download them and proper documentation to use it please...

You mentioned that you are using Joomla 2.5 (which is no longer actively developed or supported). If it is possible for you to upgrade / migrate to Joomla 3.4.x, your options open up.
I ended up developing a RESTful API for Joomla 3.4.x, powered by the Slim PHP micro-framework. Please note that this is a commercial Joomla package, so if you were interested in "free", this isn't it.
The package includes the following:
Services Control Panel component
Joomla "services" add-on library which includes a version of Slim v2.6.2 (along with several other libraries) obtain via composer and normally found in the vendor folder. More on this later...
Services Joomla Plugin
Services REST Plugin
Services Slim Configuration Plugin
Slim JSON API View plugin
Slim JSON API Middleware plugin
You might ask, "What is the point of all these plugins?"
The answer is that it allows for compartmentalization of functionality of the core components and opens the door for an easily extensible services routes architecture. Note that new plugins could easily be added with Joomla ACL restricting access to those new routes, for example.
The Services Control Panel allows for creation of tokens on a per-user basis (or even multiple tokens per Joomla user). It also allows the end user to configure the Slim micro-framework parameters and even include a threshold for the API rate-limiting functionality (currently based on requests-per-minute). Actually, that part is totally awesome as it provides live feedback on the state of the API rate threshold within the response header.
The cAPI Core package ("cAPI", short for "Constant API" because everything needs a product name...) is just that - a core package. There is a host of add-ons currently in development, the first one being a secure LDAP JSON API (which connects to Microsoft Active Directory), with lots more cool add-ons to come.
The whole point of all this is to say that, basically, your request has been answered and now a commercially supported solution has finally arrived. Plus, instead of reinventing the wheel, I based the extension on a popular, existing micro-framework (Slim), making it easier for developers to work with or develop on the core, pluggable, framework.
So, you get the best of Joomla (robust ACL, advanced plugin architecture, wealth of extensions) and Sim (proven, standards-compliant, mature RESTful PHP micro-framework), all in one easy to install package.
Exposing a website via an easily queryable API should not be taken lightly. I would hope anyone choosing to do this would implement 100% HTTPS access and security-harden their server(s).
You can find more information here: http://getcapi.org
Hope this gets you going in the right direction.
Service Endpoints and CORS Ajax calls
/api/v1/user/ - Can be used to log a user in and out and returns the activated Joomla session in the response - This also provides for multimodal authentication (both via token in header or username & password in URL string). Basically, it works with your needs. - You force a user logout like this: /api/v1/user/logout/username/joomlasessionid
Basically, this is tailor-made for driving remote services or, say iOS or Android apps.
/api/v1/content/ - Provides basic ability to create, retrieve and update content - This functionality, while it exists, I would consider it under active development and will become MUCH more robust over time.
I have embedded a sample jQuery Ajax syntax followed by the html for the div container that can display the output. Note that the headers line is optional (depends on the requirements of the API).
jQuery('button').on('click', function() {
var requestUrl= "https://www.annatech.com/api/v1/slim/swagger";
var start = new Date().getTime();
jQuery.ajax({
url: requestUrl,
type: "GET",
success: function (resultData) {
totalTime = new Date().getTime() - start;
jQuery( "#title" ).empty();
jQuery( "#requestUrl" ).empty();
jQuery( "#totalTime" ).empty();
jQuery( "#output" ).empty();
jQuery( "#version" ).empty();
jQuery( "#output" ).append(resultData.info.description).html;
jQuery( "#version" ).append('Version '+resultData.info.version).html;
jQuery( "#title" ).append(resultData.info.title).html;
jQuery( "#requestUrl" ).append(requestUrl).html;
jQuery( "#totalTime" ).append(totalTime+ 'ms').html;
},
error: function (jqXHR, textStatus, errorThrown) {
alert('error');
},
timeout: 120000
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<button>Send CORS</button>
<p>Request URL: <span id="requestUrl"></span></p>
<p>Response Time: <span id="totalTime"></span></p>
<h2><span id="title"></span></h2>
<h3><span id="version"></span></h3>
<div id="output"></div>
It should go without saying that all cAPI Core package improvements are included in the annual subscription fee. Add-ons are (will be) billed and supported separately.
About Documentation
Please note that the documentation is still under development, but if you would like to contact me directly (or through https://www.annatech.com/annatech-llc.html), I can go over the details with you. Also, I would recommend that you look over the Slim micro-framework so you can understand the basic route design http://docs.slimframework.com.
Let me know if you have any other questions.

Related

New web application technology

We're about to start a new project and I've been looking at some of the new web technologies. We want to build a RESTful api which a client can access. To date we've been using python with django/flask to build the api and using jquery for the front end.
I've read quite a bit on javascript frameworks such as emberjs and angular, as well as nodejs solutions like express, meteor and derby. I really like the idea that a site should 'auto update' when the model changes.I'm aware that there are some libraries like gevent which can help facilitate socket level communication, but it seems to be more of a patch than an elegant solution.
Ideally, I don't want to give up a proven technology, ie writing server code in python (or php,ruby whatever) for building my whole app on nodejs. Having a RESTful API is important since we want our services to be open and accessible.
Would it be a bad idea to have 2 servers and 1 client? 1 traditional api server communicating with a javascript framework on the client. Then also run a nodejs server alongside the api server which can somehow talk to the api and if it finds updates, passes it along to the client.
We want to build a RESTful api which a client can access.
Ideally, I don't want to give up a proven technology, ie writing server code in python (or php,ruby whatever) for building my whole app on nodejs.
Then you should probably go with Rails and Ember.js. I'll quote eviltrout (co-founder of discourse) which is build on ember and rails:
One amazing side effect of a rich client side app is you end up with a battle tested API. Our app has consumed our own API since day one, so we know it works.
If we want to create a native client for Android or iOS, it would be a lot easier because we already speak JSON fluently. If people want to build services that use Discourse, they won’t have to result to screen scraping. It’s a huge win for us and the developers that use our platform. 1
However you should keep in mind that ember is as of to date still a very young framework (rc3 v1.0.0).
I don't know what sort of application you are building (in respect to why you would want to use node) How to decide when to use Node.js?

Does joomla/jomsocial provides webservices/API to their core functionality?

I am developing mobile apps using phonegap.
My mobile app will have same functionality as like my joomla-jomsocial website.
I have to access web services using jQuery.ajax as I am using javascript and html only.
Are there any ready web services or APIs in joomla-jomsocial?
Joomla! only recently formed a working group for "Web Services" and I think you won't see any outcomes from that for a while.
As #Riccardo Zom, say your best bet will be to access the barest formats you can from each component type using the format/tmpl parameters.
If you're motivated enough you could extend existing components (core and otherwise) to return the desired format (e.g. json), in that case you should read Louis Landry's note on the changes from 1.5 era XML-RPC feature set to the 1.6/2.5 mechanism.
If you're still looking after that you may be interested in the "Joomla! API - Generic RESTful API framework for Joomla! 2.5" by Rafael Corral, it's a component (com_api) that provides a framework for creating a RESTful API for a Joomla! 2.5 site.
Unless you want to rewrite the whole component logic in your html app, you might be happy with grabbing the component output without all the extra page markup i.e. get the bare html returned from the component: just add &format=raw to the query; if you want libraries and css to be returned as well, instead add &tmpl=component
There is also (limited) support for &format=json in some core components.

Beginning Webservice with Joomla

I am new to joomla 2.5. I need to design application which is to be used by STB(SET TOP BOX) or TV Application. Is it possible to use below features with Joomla 2.5 ?
Authenticate users where credentials are passed from STB or TV via POST method.
Calling Webservices after authentication, custom string format needs to be return instead of JSON or XML.
Is it possible to host file with encryption from developed administrator component ?
Any Ideas? Any good beginners book for Joomla 2.5 ?
Thanks.
yes if you previously download the login page and grab the token, which is a dynamic security feature
no problem there, just make sure you end your controller method with
exit
so the template won't be output.
I can't figure out what you mean. Encrypted files will not be accepted on the Joomla Extension Directory, but you can use them in custom components.
Beginners books: really depends on your php and overall development experience. The reference and plenty of guides are on docs.joomla.org (section developers), but check here first for any questions, there are plenty of answers on Joomla!

How to programatically create a Facebook application via JS SDK or Open Graph API? (createApplication)

I know there are currently two methods that can be used to do this, documented (poorly) on Facebook's Developer site:
The old (depreciated) JavaScript SDK FB.Connect.createApplication
A new FBJS method Facebook.createApplication (only for use on Canvas pages)
The problem is that I not using a Canvas app that runs FBJS, and I am not using the OLD JS SKD. I am trying to do this on a regular old PHP website that uses the current JavaScript SDK and the PHP SDK.
I am doing the usual Open Graph API calls and such with the current SDK, so I understand the basics, I'm just not sure how to proceed to use the OLD SDK, or if (fingers crossed) I even really have to?
So, is there a way to make new Facebook Apps with the current JS SDK? Or with a server side PHP SDK call to the Graph?
And if not, how do I call the old SDK to do this?
Thanks
UPDATE: You still can't do this, but there is an official bug in the Facebook tracker about it: http://developers.facebook.com/bugs/295627350461318
There isn't outside of the OLD SDK as you indicated. It's been removed (what Facebook calls "deprecated"). I put in a feature request recently for them to add it back into the API:
Me:
The Facebook Developer tool is
considerably lacking in features. We'd
like to be able to create a third
party application that adds layers of
functionality to the developer
application, but we'd need to be able
to create and administer applications
via the Graph API.
The Graph API supports querying for
information on existing applications.
To create, administer or delete
applications developers must go to the
Developer Application.
Them:
------- Comment #1 From Jeff Bowen 2010-12-07 16:59:12 (-) [reply]
------- Thanks for the request. We’ll track this on our wishlist

HTML5 Offline storage web framework

I am looking for a web app framework which can automatically generate an HTML5 offline storage based app, so while the users become disconnected they still can view the data which normally is stored on a server
Also currently I am using Django and it would be great if there was a framework which could pull data from Django and present that as an offline app.
From the related questions suggested by stackoverflow, while writing this question, I found one interesting link mentioning that GWT has such functionality, I would like to know more about that if possible and if it can generate an HTML5 offline app
Thanks in Advance
Rather than server-side frameworks, you should be taking a look at JavaScript frameworks.
Dojo Storage will transparently select between providers such as Google Gears, Adobe AIR or plain old HTML 5 local storage. Dojo 1.5 - dojox.storage: http://dojotoolkit.org/api/1.5/dojox/storage
There's also jQuery local storage: http://plugins.jquery.com/project/saveit
... or jStorage, which can act as a storage plugin for jQuery, Prototype or MooTools: http://www.jstorage.info/
With any of these, you should be able to use a quick little AJAX call to pull (JSON perhaps) data from your server and use one of these tools to help minimise your storage code.
You're talking about a standalone app, not a django app.
This can be done with javascript (jQuery, Sproutcore, JavascriptMVC, Pyjamas ...) or Adobe AIR, or...
Pulling data from Django is just a matter of setting up a syncing method, most probably using JSON, to fill up the browser local storage. So this is not django-specific at all.
If you want a standalone django app, this can be done if you bundle in a python desktop app django with a built-in server, that's another question
You could suggest the users to create web apps or use google gears instead... I don't know if this will fill the question, but, i'm in the same way. However, I'm developing an governamental solution who will run only for some kind of people, so, I can have a few control about the user's environment... All you need to do is to use jquery to detect if user has a live connection, or offer to the users a 'preferences' page where you define the behavior of the page itself...
Some info about offline cache: http://diveintohtml5.ep.io/offline.html
PS.: In another post in stackoverflow, I 've found another question: html5 offline caching with php driven sites... The last Post said:
HTML5 offline caching does not work to make your pages interact; it works only to make a
particular page available offline. Basically, it works on a URL-by-URL basis. If you
absolutely need offline functionality, you will be forced to make it work in JS.
Also, make sure your manifest includes all resources used by all pages.
Hope this helps!
Hope it helps!!