Appcelerator Blog

The Leading Resource for All Things Mobile

Arrow API Swagger Interface

9 Flares 9 Flares ×

When you create Arrow Builder APIs, the Arrow Admin Console displays your automatically-generated API docs in the API Docs tab as described here. An example is shown below:

While the API Docs are appropriate for developers, what if you need to programmatically import the APIs into a tool such as the Axway API Manager? Arrow APIs also contain a Swagger definition that can be used this purpose.

Arrow Project Swagger

Your Arrow project Swagger file that describes all of the APIs in the project can be accessed at the following URL:

https://<SUB_DOMAIN_TOKEN>.cloudapp-enterprise-.appcelerator.com/arrow/swagger.json

For example, for my published Arrow Project, the Swagger definition can be found here:

https://cb0ed9de31943f6afc79b235afebae6553aeaf56.cloudapp-enterprise.appcelerator.com/arrow/swagger.json

Individual APIs

Each API also has a separate swagger definition associated with the API itself. This is convenient if you only need access to one API and not the entire set of APIs exposed by your Arrow Project.

For example, if you have a model and associated APIs for account as follows:

var Arrow = require('arrow');
var Model = Arrow.Model.reduce('appc.salesforce/Account', 'Account', {
    fields: {
        Name: {
            type: String,
            description: 'Account Name',
            maxlength: 255,
            required: true,
            optional: false
        },
        Type: {
            type: String,
            description: 'Account Type',
            maxlength: 40
        },
        Phone: {
            type: String,
            description: 'Account Phone',
            maxlength: 40
        }
    },
    actions: [
        'create',
        'read',
        'update',
        'delete',
        'deleteAll'
    ]
});
module.exports = Model;

API docs for this API can be found at the following URL:

https://.cloudapp-enterprise-.appcelerator.com/arrow/docs.html?apis/account.html

The swagger definition for account can be found at the following URL:

https://<SUB_DOMAIN_TOKEN>.cloudapp-enterprise-.appcelerator.com/arrow/docs.json?apis/account.json

Swagger files for the Arrow project and individual API’s can be found here.

9 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 9 Email -- 9 Flares ×

2 Comments

  1. ilay

    Is there a way to highlight the changes in a different colour here? the first html->json change can easily be missed.

    • Erin Bailey

      Thanks for the comment! Didn’t realize you had to scroll. You may need to scroll within the code block as well. Will see if we can fix that.

Comments are closed.

Sign up for updates!

Become a mobile leader. Take the first step to scale mobile innovation throughout your enterprise.
Get in touch
computer and tablet showing Appcelerator software
Start free, grow from there.
9 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 9 Email -- 9 Flares ×