How to automatically generate a web UI from a REST API - api

Is there any solution to automatically generate a web UI from a REST API?
I found Swagger codegen but it generates a client for the API, not a UI.
I need a basic UI, allowing directly from the browser to use the different endpoints and display the response prettily. Something like a basic Postman that would be directly integrated into my website.
I don't have constraint about how the generation is done. Can be done once at build time, or at runtime on server side or on client side.

I've heard good things about retool.com, it seems to do what you need.

Related

Create Azure Api App from Swagger meta data

I have created some APIs in API management layer, which are essentially proxies between the calling client and an underlying web api.
I did this by importing the swagger file of the underlying API, and then adding the newly created API to a Product, repeating this for each separate proxy that I needed. This means then that the underlying API could be called but not without the subscriber key of the product that the newly created API was attached to.
Is it possible to do something similar with API apps, i.e. creating API apps using just the swagger file from the underlying API in the azure portal, that act as proxies between the calling client and an underlying web api (as below)?
Do you mind expanding on why do you need to have API Apps acting as proxies?
I am not aware of such capability for API Apps specifically. There are Swagger-based code generation tools available, for example on http://swagger.io/open-source-integrations/. So perhaps you will be able to find something that would work for you.

How to pass login credentials to SSRS using Web API?

Background
I am currently working with an application that uses Web API. We he have implemented custom token based authentication. Our front end is primarily HTML5, CSS3, and Javascript. Although it is an MVC application we are only really using mvc for routing, because Web API handles much of everything else. We are evaluating SSRS as a possible reporting solution. We would like to keep our Website session-less as it currently stands.
Question
I have not been able to find a good implementation of SSRS with Web API. I basically want a simple Web API route that constructs the URL to the report server while passing parameters. I was able to find several resources on making a request and passing parameters via a URL. I am struggling with Authentication. How do I send the credentials to the report server via URL. In WebForms there is an interface called IReportServerCredentials that allows you to do this. Is there anything like this for WebAPI. Is there another solution for logging in via a URL? We want to either send the credentials directly with this call, or somehow tap into our current WebAPI Token Based Authentication.
On a side note if anyone knows a report viewer that will work on the client side I would appreciate it. Since our frontend is technically an MVC application I have been evaluating this one:
-https://github.com/ilich/MvcReportViewer
That being said it is not ideal for what we are currently trying to accomplish.
Any help is much appreicated! I am very new to SSRS, so please forgive my ignorance towards the subject.

Creating a content hub and client application using Piranha CMS

First off, I need to mention that I'm not sure if what I'm trying to achieve is even supported by Piranha CMS (that's partly what I'm trying to determine here). They mention the ability to create a standalone content hub on their website, but my assumptions of what is possible with that model might be incorrect. What I've already done is created an ASP.NET MVC application that is hosting Piranha CMS and I've published it to Azure websites for testing purposes--that part works as expected. The content management interface is the only user facing piece here--it is meant only to serve as the content hub for the client application (just the one for now as this is just proof of concept work).
I am now trying to build a client ASP.NET MVC application that pulls content from the hub. This is where I'm thinking that my assumptions may have been wrong. I was thinking that I'd be able to install the Piranha CMS nuget package(s) on the client as well, and I'd be able to configure the framework to get content from the hub in the same way that it would if the content were hosted on the client site. I realize that I could get the content from the hub using Piranha's REST api, but what I want to do is to be able to use the more friendly entity model based api for this.
So my question is whether it is possible (within reason) to setup Piranha CMS in the way that I've described. If it is, how exactly do I configure the client such that it is aware of the location of the content hub?
There are currently no .net client api consuming the rest services as the simplest scenario would be to deploy .net applications together with the server. In the setups I've done native apps & html5 knockout/angular applications have used the rest api's for getting json data. You should however be able to white such a module, performing the HTTP calls and the deserializing the json without any problems.
Regards
HÃ¥kan

RESTful API - Custom Application - C#, Java, php?

This is really basic.I want to implement a RESTful web API.
Now I know you can write custom applications and scripts to integrate with the API.
What I need to know:
In what languages can you write this API? C#, Java, php?
When building/programming a program that implements this API, is this the client and the software that issued the API the server? (eg. Dropbox would be the server and the custom app that integrates with the Dropbox API is the Client?
Thank you.
A REST API can be built in any programming language that allows you to handle HTTP requests (or can be attached to a Web server as a handler for requests). The two methods I've been using:
Stand-alone Windows service implementing a REST service using WCF
WEB server Apache + PHP
You are correct about the terminology. A program consuming a service is called the client, a program providing a service is called the server (while actually in the PHP approach, Apache would be the server as it is taking the request and having the script handle it).
Additional nitpicking: JQuery is not a language, but a framework to help you use some JavaScript features more easily.
On your comment Recap:
Close :-) The Client transfers JSON/XML/whatever to a server using HTTP requests. The Client can be written in any language that can perform HTTP requests.
On the server side, there needs to be some application that handles the HTTP requests (service), also written in any language, as long as it "speaks" HTTP.
The API is the definition of which operations are possible, for example, adding user accounts, getting the current time, etc. (this is what you define - what do you want your service to do?).
The JSON/XML/whatever that you transfer is the workload, the parameters for the API call. For example, if you want to add a new user to your system, the workload could be the new user name, the real name, the eMail address and some other details about the user. If the API call returns the current server time, you might not need any parameters at all, but you get back JSON/XML/whatever from the service.
The actual call being made is determined by the URL you call. For example, the URL for adding a user could be http://localhost/myrestservice/adduser and you'd perform a POST request against that URL with the required workload. For the time example, the URL could be http://localhost/myrestservice/getservertime and you'd perform a GET request against that URL.
I suggest that you read about how REST services actually work before you start, as I see some question marks on your face ;-)
Short:
API = available operations (=> URLs)
Parameters to API calls = JSON/XML/Plain Text/whatever
Client = calls the service through HTTP
Service = handles the calls, replies to client in response to HTTP requests
If you are a php programmer and familiar with Codeigniter framework then go here : Working with RESTful Services in CodeIgniter.
visit also : Rest Tutorial
First of all, you should begin with learning what is a RESTful API.
http://en.wikipedia.org/wiki/Representational_state_transfer
http://www.restapitutorial.com/
http://rest.elkstein.org/
In what languages can you write this API? C#, Java, php, jQuery?
You can write an API in any language. What can help is the framework you'd be using. JQuery is not a language, but a framework for integrating Javascript application in every web browser, so it won't help.
I'd advice you to use a microframework to write your first RESTful API, because they usually are easy to use and help focus on the important (bottle/flask in python, express in javascript, silex in php, spark in java or nina in C#)
When building/programming a program that implements this API, is this the client and the software that issued the API the server? (eg. Dropbox would be the server and the custom app that integrates with the Dropbox API is the Client?
You're right, the server is providing you the service, hence the API. The client is user to that API, and implementing it into something useful.
As most of the people stated already, you can do this in just about any language.
Might I suggest that you look into NodeJS? If so, check out Restify: http://mcavage.github.io/node-restify/
There's a nice community behind NodeJS and I think it's quite open to newcomers. Just try not to pick up bad habits from JavaScript pitfalls. If you're new to programming, I'd suggest reading some intro book.
good luck!

Auto-generate an API Explorer for WCF services

If you have ever used the Flickr API, you'll be familiar with their API Explorer. It is an awesome tool, that allows you to view the documentation for each API method, and the killer feature, being the execution of that API method (with a form to populate any request parameters). It even picks up when you are logged in, and completes the authentication part on your behalf. Gowalla has a similar API Explorer that is also really good.
Are there are tools for WCF that will auto-generate such an API Explorer, free or commercial?
Currently, we use Fiddler to build the JSON requests, but I would like to publish these service contracts, and allow potential developers to play around with them via a web based API explorer.
I am aware of the WCF Web HTTP Service Help Page, which I am using (and is awesome), but it is the API Explorer part that I am interested in.
You may want to look at I/O Docs - an open-sourced interactive documentation system for RESTful web APIs that any API owner can use to deploy for their own documentation. It runs on Node.js and uses Redis as a data store.
https://github.com/mashery/iodocs
Example: developer.klout.com/iodocs, developer.rottentomatoes.com/iodocs
It uses JSON schema based files to define API endpoints, method and parameters. Based on these JSON files, it generates a client interface that developers can use to learn and explore your API. API calls can be executed directly from the documentation interface, producing formatted responses.
It's Open-sourced, so you can be assured of regular updates and improvements. In fact this past weekend, Brandon West from SendGrid (who use I/O docs to power their documentation), created and open sourced the UI to create/edit the JSON schema files for I/O Docs. So you don't have to manually create the JSON files anymore.
https://github.com/brandonmwest/iodoctor
Not exactly what you were looking for, but....
WCF provides something called the WCF Test Client, for this purpose.
If you install Visual Studio, you get it. For example, for VS2008, installed in the usual place, you can find the WCF Test Client (WcfTestClient.exe) in the following location:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\
Take a look at Apigee: http://apigee.com/