Versions Compared

Key

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

...

Parameter Name

Description

Default Value

Label

Required. The name for the API policy.

HTTP Redirect

When this policy should be applied

An expression enabled field that determines the condition to be fulfilled for the API policy to execute.

For example, if the value in this field is request.method == "POST", the API policy is executed only if the request method is a POST.

N/A

HTTP Redirect Properties

The controls for HTTP redirection. Click (blue star) to add redirect properties to the policy. If none are entered, the policy uses the original message body originating from the clientEach property defines a condition to return a HTTP redirect response. Each property also include fields for specifying the redirect URL, content-type, and message body for the HTTP response. To remove the redirect property, click - and click Validate and Save.

N/A

Use User-Agent Content

Select this checkbox to redirect an HTTP user-agent with the user-agent’s original request contents, such as the content type, message body, and query parameters.

Note: Deselecting this checkbox does not remove the redirect property.

N/A

Condition*

Enter an expression to prompt an HTTP redirect when it evaluates to True. If you set the expression to False, the condition is nullifiedAn expression that evaluates to False will not prompt an HTTP redirect response.

N/A

Response Status*

Select one of the following:

  • 300 - Multiple Choices. The request has more than one possible response. The user agent or user should choose one of them. (There is no standardized way of choosing one of the responses, but HTML links to the possibilities are recommended so the user can pick.)

  • 301 - Moved Permanently. The URL of the requested resource has been changed permanently. The new URL is given in the response.

  • 302 - Found. This response code means that the URI of requested resource has been changed temporarily. Further changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests.

  • 303 - See Other. This is used for caching purposes. It tells the client that the response has not been modified, so the client can continue to use the same cached version of the response.

  • 307 - Temporary Redirect. The server sends this response to direct the client to get the requested resource at another URI with the same method that was used in the prior request. This has the same semantics as the 302 Found HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.

  • 308 - Permanant Redirect. This means that the resource is now permanently located at another URI, specified by the Location: HTTP Response header. This has the same semantics as the 301 Moved Permanently HTTP response code, with the exception that the user agent must not change the HTTP method used: if a POST was used in the first request, a POST must be used in the second request.

N/A

Redirect URL

Click (blue star) to specify a functionan expression to build a valid URL.

Note: Some functions in the dropdown list might not be applicable and therefore will not work.

Alternatively, you can disable the Expression field to enter the URL for the redirection. Example: https://docs-snaplogic.atlassian.net/wiki/search?text=client

N/A

Content-Type

Click (blue star) to specify a function. For expressions containing a semi-colon (;), you can use escape() to allow the expression to compile. For example: escape("text/xml; charset=utf-8")

You can add other content types recognized by IANA, such as:
application/alto-error+json escape("application/alto-error+json; charset=windows-1252")

Note: Some functions in the dropdown list might not be applicable and therefore will not work.

Alternatively, select the content type from the dropdown:

  • application/json.

  • application/xml.

  • text/html.

  • text/plain.

  • text/xml.

N/A

Message Body

Enter a message for the API caller.

Example:

Code Block
{
"Hello":"World"
}

N/A

Status

Specifies whether the API policy is enabled or disabled. 

Enabled

...