Fusio

Simply build and
manage REST APIs

Fusio is an open source API management platform which helps to build and manage REST APIs. Fusio provides all tools to quickly build an API from different data sources yet it is possible to create complete customized responses.

build

Action handling

Fusio provides a simple way to develop data driven API endpoints. I.e. to execute SQL queries or send data into a message queue.

assessment

API Analytics

Fusio monitors all API activities and shows them on a dashboard so you always know what is happening with your API.

book

Documentation generation

Fusio generates automatically a documentation of the API endpoints based on the provided schema definitions.

layers

JSON Schema

Fusio gives you the option to describe the data schema of the request and response in the flexible JsonSchema format.

account_box

OAuth2 authorization

Fusio uses OAuth2 for API authorization. Each app can be limited to scopes to request only specific endpoints of the API.

swap_horiz

Rate limiting

Fusio provides a way to rate limit every API endpoint to a specific amount of requests per interval.

Rapid development

Fusio provides a simple javascript API to develop data driven API endpoints. In the following we show some common use cases and how to implement them with a few lines of javascript. Please take a look at the V8-API documentation to see a complete overview of all available functions.

var connection = connector.get('mysql-connection');
var row = connection.fetchAssoc('SELECT * FROM acme_news WHERE id = :id', {
    id: request.getUriFragment("id")
});

if (row) {
    response.setBody(row);
} else {
    response.setStatusCode(404);
    response.setBody({
        success: false,
        message: "Entry not found"
    });
}
var connection = connector.get('mysql-connection');
var body = request.getBody();

if (body.title && body.content) {
    var sql = 'INSERT INTO acme_news 
                       SET title = :title, 
                           content = :content, 
                           insertDate = NOW()';
    
    var row = connection.executeUpdate(sql, {
        title: body.title,
        content: body.content
    });

    response.setStatusCode(201);
    response.setBody({
        success: true,
        message: "Entry successful created"
    });
} else {
    response.setStatusCode(400);
    response.setBody({
        success: false,
        message: "Invalid request data"
    });
}
var connection = connector.get('http-connection');
var resp = connection.request("GET", "/old/api");

if (resp.getStatusCode() === 200) {
    var data = JSON.parse(resp.getBody());

    response.setStatusCode(200);
    response.setBody(data);
} else {
    response.setStatusCode(500);
    response.setBody({
        success: false,
        message: "Internal server error"
    });
}
var connection = connector.get('amqp-connection');
var body = request.getBody();

connection.basicPublish('acme_queue', body);

response.setStatusCode(202);
response.setBody({
    success: true,
    message: "Inserted message to queue"
});
var connection = connector.get('mongodb-connection');
var row = connection.findOne("acme_news", {
    id: request.getUriFragment("id")
});

if (row) {
    response.setBody(row);
} else {
    response.setStatusCode(404);
    response.setBody({
        success: false,
        message: "Entry not found"
    });
}
var connection = connector.get('mongodb-connection');
var body = request.getBody();

if (body.title && body.content) {
    var row = connection.insertOne("acme_news", {
        title: body.title,
        content: body.content
    });

    response.setStatusCode(201);
    response.setBody({
        success: true,
        message: "Entry successful created"
    });
} else {
    response.setStatusCode(400);
    response.setBody({
        success: false,
        message: "Invalid request data"
    });
}