Would you like to contribute to the Titanium docs? To get started, sign up for an account on the Appcelerator Wiki and sign our CLA.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

APIs are defined as Swagger 2.0 documents which can contain one or more Endpoint definitions. The API swagger document must be formatted as JSON and contained within the /endpoints directory of your app. 

When API Builder reads these API swagger definitions, it will create the specified routes for each Endpoint. The implementation of the business logic for each API endpoint Endpoint is handled by the Flow associated with that endpointEndpoint. This is delegated to Flows which are specified on a per-Endpoint level.

...

 

Property

Description

Required

Type

Default

Example

x-enabled

If the API should be bound to the app on load.

No

object

{ "enabled": true }

{ "enabled": false }

x-flow

The name of the Flow to be executed when the endpoint is hit.

Yes

string

 

"greetflow"


Example

This example endpoint example API below is similar to the one that comes with every Arrow Project. It contains an Endpoint which takes a username, invokes the flow called “greetflow”, and returns a greeting. However, since it has an x-enabled flag set, the endpoint Endpoint will be disabled, and no requests will be able to be made to it.

...