Skip to content

Overview

Concepts and Principles

Development

Overview

IDEs

API Explorer

Releases

Release Notes

TORO Integrate

Coder Studio

Coder Cloud

Bug Reports

Search

URL Alias Endpoint

The URL Alias Endpoint binds short, easy to remember URL paths to the methods inside your services, scripts and code. This makes your APIs look much nicer to your customers, and allows for URLs to invoke different code over time without changing the URL itself. This endpoint has no requirements in terms of method signatures for code being invoked. All services that are invoked through this endpoint are available in the TORO Integrate root context /api.

Properties

Properties Default Description
URL (required) The URL pattern to be used by the service.
Service (required) The service to execute under this alias.
Parameters The available parameters from the service.
Method The HTTP method used to match the request.
Secured false If true, only authorized users can hit the URL.
Users The users allowed to execute the URL alias.
Groups The groups allowed to execute the URL alias.
Run As 'Anonymous' The user to run the service in behalf of. This is logged to Tracker.
Log to Tracker false Flag determining whether executions should be logged to Tracker.
Document Type The document type to be registered to Tracker when this endpoint is triggered.

Examples

Examples: Gloop as a Service

Consider the following example:

Example Integrate Endpoint configuration

This endpoint exposes the configured service under the URL GET /api/sendJMSMessage, with request parameters jmsQueue and messageContent. These request parameters correspond to the input of the Gloop service:

Example service input

Sending the request GET /api/sendJMSMessage?jmsQueue=queue://news&messageContent=Hello invokes the underlying service.

More Gloop

The distribution ships with an Integrate Package called examples, which contains services (including the above example) demonstrating more use cases.

Examples: Groovy as a Service

We can replicate the above example in Groovy. Consider the following snippet:

1
2
3
4
5
6
7
8
class JMSExamples {

    String sendJms(String jmsQueue, String messageContent) {
        messageContent.publishTo(jmsQueue)
        'Sent!'
    }

}

Configuring this as a service of the endpoint above will expose it as well under the same URL: GET /api/sendJMSMessage?jmsQueue=queue://news&messageContent=Hello.

publishTo what?

The method publishTo used in this snippet is a Groovy extension to the String class. This allows developers to conveniently publish, in this case, a String to a JMS destination, in one line.