Create a REST Endpoint
You can create a client application to communicate with Loftware Enterprise SP to request or send data by using a REST endpoint. For each REST endpoint, you will create and specify a business rule that should be run when the REST endpoint is requested. This business rule can perform actions, process data passed into the data map by the requesting client application, and post return values to the data map to be passed back to the client application. For an example of a REST endpoint and its associated business rule, see Example of a REST Endpoint.
Note: See Controlling Access to System Settings for information about the access needed to view, create, modify, delete, or communicate with REST endpoints.
Before You Begin: Create the business rule that you want the REST endpoint to run.
To create a REST endpoint, use the following procedure.
- In System
- To add a REST endpoint, click New REST Endpoint.
- For Name, enter a name for the REST endpoint.
- For Business Rule, click Browse and select the business rule that should be run when the REST endpoint is requested by a client application.
- For Business Rule Event, enter the XML name of the trigger event for the component set in the business rule that should be run when the REST endpoint is requested by a client application. When the REST endpoint is requested, the business rule is run as if this event has occurred.
- For Response Key, enter the key of the data map entry (path or endpoint) that will be returned for the REST request. The value of this data map entry will be populated by the business rule associated with the REST endpoint.
- For Response Content Type, select type of content to be returned by the REST response.
Tip: If using JSON or CSV response content, the return values are arrays and your business rule must configure the format.
- For Request Method, specify whether the client application should use the GET or POST method to communicate with Loftware Enterprise SP. GET is typically used to request data from Loftware Enterprise SP, while POST is typically used to send data to Loftware Enterprise SP.
Note: Regardless of the request method used, you can also allow the client application to send data to Loftware Enterprise SP as a header value or URL parameter.
- Optionally, for Request Key, enter the key of the data map entry to which the client application will pass string values by using the request body.
- For Request Processor Type, select the type of content to be processed by this endpoint.
- Accept MIME Types auto fills with the MIME types that match the content type selected for Request Processor Type. Optionally, you can enter additional types if your business rule is built to process them.
Note: Requests that contain MIME types that do not match the listed types will fail.
- Optionally, for Character Encoding, select the character encoding for the returned REST response.
- For Description, enter a brief explanation of the purpose of the REST endpoint.
- Click Save
.
For information about using a requesting client application to communicate with a REST endpoint that you have created, see Communicate with a REST Endpoint.