Endpoint configuration
Endpoint configuration differs for native and external endpoints. Native endpoints call Triggered or Ultra Tasks that run on the local Snaplex. The Snaplex that receives the request executes the task and returns the response. In contrast, for external endpoints, the Snaplex that receives the request forwards that request to a third-party or another Snaplex. Refer to Request execution flow for more information.
Endpoint configuration includes:
- A name with no spaces that becomes part of the path. For example, a
pet
endpoint from version 3 of the Pet Store specification has an upstream URL of:/api/v3/pet
. - One or more Paths. Each can be defined by a rule or an expression that routes a request to a specific resource. For example, a calculator that accepts JSON or XML input has a different implementation for each format. A routing rule can send a request in JSON format to one and XML format to another.
- One or more Servers to execute the request. If you supply more than one Snaplex, any of them can handle the request.
To apply a Policy to an endpoint, navigate to the Policies tab of the appropriate Service version.
Native endpoints
A native endpoint includes these properties:
- A name with no spaces that becomes part of the Service path.
- A reference to the task. You can select tasks for which you have execute permission. Refer to Assign project permissions for information on permissions.
- A reference to the Server, the Snaplex that handles this endpoint.
- A description and optional tags.
An endpoint must have at least one path and at least one HTTP method. Optionally, you can add advanced routing rules that must return true to execute the endpoint. Advanced routing rules can be an expression or a set of rules. Each path can have the following elements:
- A simple route or a conditional expression.
- Optional path parameters.
- One or more supported HTTP methods. For each method:
- Optional request parameters. Parameters are typically used to identify a resource while the
request body provides content for that resource. For example, the Pet Store has an endpoint to find a
pet by ID. An
integer
petId
is a required request path parameter. - The request media type. This is the required format for the request. For example,
application/json
orapplication/xml
. - Optional response parameters.
- The response media type.
- Response codes. For example, the Pet Store endpoint to get a pet by its ID returns
200
for success,400
for an invalid ID, and404
for a pet not found.
- Optional request parameters. Parameters are typically used to identify a resource while the
request body provides content for that resource. For example, the Pet Store has an endpoint to find a
pet by ID. An
External endpoints
An external endpoint includes these properties:
- A name.
- The upstream URL.
- Options:
- Trust all certificates: The receiving Snaplex trusts all certificates supplied by the server for the external endpoint.
- REST to SOAP: Exposes SOAP endpoints to clients through REST and translates SOAP responses to JSON. Refer to Wrap legacy SOAP APIs in a Service for more information
- A description and optional tags.
Endpoint Paths
An endpoint path routes requests. When you create an endpoint, you must define or more paths for it. Services created from specifications automatically include the endpoint paths. For advanced routing, you can use an expression. For example, you could route a request to a particular path based on content in the request header. To learn more about the purpose and functionality of the path and method definitions, revert to the OpenAPI Specification.
Each endpoint path includes:
- The supported HTTP methods.
- For each method:
- The request body type.
- Response codes.
- Response schema.
- An optional example.
Pet
path POST
method:
The following describe how to perform tasks related to endpoints: