Showing posts with label API. Show all posts
Showing posts with label API. Show all posts

Tuesday, 7 November 2017

ARC components in Mulesoft's API Console

I am proud to announce that web components that are used to build ARC are now also used to build Mulesoft's API Console.

MuleSoft's API Console is a full-fledged API documentation tool that generates mobile-friendly web documentation based on RAML (Restful API Modeling Language) documents. It is an open source, community driven application that can be easily adjusted to any environment.

Background


While working on atomizing Advanced REST Client to a set of web components internally in the company we've realized that both products can share the same code base. So over a year ago I've started working on new version of the API console. The task was to create a best in class usability for API documentation tool. That includes mobile friendliness, ergonomic design, ease of reading documentation and learning the API structure. From a developer standpoint API console should be easy to use as a standalone application ready to run on a web server but also as a embeddable HTML element that can be added to existing products (like existing web pages with API documentation).

The result


API console is a web application based on web components standard. Therefore it can be used in any web environment and can work with any web framework (though some frameworks - like React - may require additional customizations). We've created a set of tools to make it even easier to build the API console from a RAML file. Our CLI tool can be used to generate production ready standalone website with API documentation or to generate development preview of the documentation while working on RAML. There also is the api-console-builder npm module that can be used in node environment to build the same API console.

Try new API console and design your APIs with RAML. I'll be happy to hear a feedback from you.

Thursday, 31 October 2013

Let's test the prototype!

As you may know lately I have worked on new version of the Advanced Rest Client application. It will change... well, pretty all!

Minor changes will cover:
  • storage - change from deprecated WebSQL to IndexedDb
  • projects to become "requests groups" - old projects are to much complex and unnecessary. In nev version you will have an option to group requests and easily switch between endpoints
  • responses history - it is a new feature, the app will store responses so you can check how your server's response change over time. It also implicate that the app will be useful offline as well.
  • better Google Drive integration - it will use different API to connect to +Google Drive. Thanks to a new Identity API in +Google Chrome you will authorize the app in more user friendly way
  • upgrade to Chrome App! - instead of opening the app in new tab it will open as native-like application. You may even add the application to the task bar or desktop
  • new way hows the requests are made - using new Google Chrome Sockets API the app is able to make a request without a limitations of XmlHttpRequest. You'll be able to set every type of HTTP header. Also I'm planning a raw socket testing implementation.
  • change the +GWT framework to +AngularJS - it is more flexible for HTML5 apps than GWT. And it takes much less time to add new functionality or change existing ones
  • completely new UI

Tuesday, 14 May 2013

Background page for Advanced Rest Client

Hi developers.
Greetings from Googleplex - just befor Google IO ;)

Today I've noticed that you asked me hwy the application use background page. Yes, there are event pages that don't require consistent presence of the application process but it just don't fit.

To know what exactly background page do refer to source file and previous article about ARC API.
Earlier I introduced an API for Rest Client. Now other extensions can cooperate with application - they can run an application with predefined values (like URL, payload, headers list). To make it possible I have to implement handlers for message passing (either for cross-extension communication and for web intents). It require to initialize background page. Without it the application have no place to initialize handlers without actually running the app.

Furthermore, GWT (Google's framework used to develop the application) is not ready to be used with Chrome extensions/applications. Thanks the background page I can actually develop the app using Chrome API (which is required). Without it developing the app would be extremely difficult.

You may have concerns about memory and starting up Chrome itself. Well, there is actually really little code in background page. Most of the function in background page are used when you making a request. It's do nothing when you are not using the app. But still I need to have it loaded in case if related from ARC app would like to use it.

If you have a question post it in an comment. I'll answer you. You may also report an issue if you find one.

Happy RESTing ;)

Sunday, 30 September 2012

Advanced REST client API

API it's a big word for that but in some part you can call it an API :)

If you are an author of an extension and  you would like to use my application now it is possible.
When your application would like to open a request data in Advanced REST client you have two possibilities:

  1. using chrome message passing system
  2. using webIntents (you don't need to have a chrome extension)
You just need to pass request object with following data:
"payload" (required) - message payload: 
  • "create" to open new application window with values; 
  • other payloads may be available in future
"data" - (required) javascript object with any of values:
  • url - (String) request URL to set
  • method - (String) request method to set
  • headers - (String) an RFC string representing request headers example:
    >>> User-Agent: X-Extension
    X-header: header value; second value <<< 
  • payload - (String) data to pass into payload field. Only for http methods that carry payload data
  • encoding - (String) data form encoding
Example of usage:

var message = { 
   'payload': 'create', 
   'data': { 
       'url': 'http://www.google.com/', 
       'method': 'GET', 
       'headers': "User-Agent: Chrome-Extension\nX-extension-id: SomeID" 
    } 
};
Via extensions message passing system:
chrome.extension.sendMessage("hgmloofddffdnphfgcellkdfbfbjeloo", message, function(response) {});


Using webIntents:


window.Intent = window.Intent || window.WebKitIntent;
window.navigator.startActivity = window.navigator.startActivity ||
window.navigator.webkitStartActivity;
 
var params = { 
   "action": "http://webintents.org/view", 
   "type": "application/restclient+data" , 
   "data": message 
}; 
var i = new WebKitIntent(params); 
var onSuccess = function(data) { console.log(data); };
var onFailure = function() { console.log('intent error'); };
navigator.webkitStartActivity(i, onSuccess, onFailure);
For more information check trunk: http://code.google.com/p/chrome-rest-client/source/browse/trunk/RestClient/war/extension/background.js