A route is the rule which redirects the incoming request to an action. If a request arrives the first route which matches is used. In order to be able to evolve an API it is possible to add multiple versions for the same route. For each version it is possible to specify the allowed request methods. Each method describes the request and response schema and the action which is executed upon request. If a request method is public it is possible to request the API endpoint without an access token.
The path can contain variable path fragments. It is possible to access these variable path fragments inside an action. The following list describes the syntax.
/newsNo variable path fragment only the request to
/newsmatches this route
/news/:news_idSimple variable path fragment. This route matches to any value except a slash. I.e.
/news/12matches this route
/news/$year<[0-9]+>Variable path fragment with a regular expression. I.e. only
/news/2015matches this route
/file/*pathVariable path fragment which matches all values. I.e.
/file/12matches this route
The status affects the behaviour of the API endpoint. The following list describes each status
DevelopmentUsed as first status to develop a new API endpoint. It adds a “Warning” header to each response that the API is in development mode.
ProductionUsed if the API is ready for production use. If the API transitions from development to production all databases settings are copied into the route. That means changing a schema or action will not change the API endpoint.
DeprecatedUsed if you want to deprecate a specific version of the API. Adds a “Warning” header to each response that the API is deprecated.
ClosedUsed if you dont want to support a specific version anymore. Returns an error message with a
410 Gonestatus code
The action contains the business logic of your API endpoint. It i.e. selects or inserts entries from a database or pushes a new entry to a message queue.