REST connector

The REST connector is used to provide a connection with a REST service. It can also be used to configure a webhook as an incoming trigger.

The REST connector appears on the process diagram as a pair of curly brackets.

Important: All REST services need to be separate to the Alfresco hosted environment and should be created and managed by customers.

The actions that can be executed using the REST connector are:

GET

The GET action is used to send HTTP GET requests.

The input parameters for GET are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
restUrlEncodedBooleanOptional. Set whether the URL should be encoded or not, for example true.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from GET are:

ParameterTypeDescription
restResultJSONOptional. The response from the REST service call.
restStatusIntegerOptional. The HTTP response status code from the REST service call.
restResponseHeadersJSONOptional. The HTTP response headers from the REST service call.

HEAD

The HEAD action is used to send HTTP HEAD requests.

The input parameters for HEAD are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
restUrlEncodedBooleanOptional. Set whether the URL should be encoded or not, for example true.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from HEAD are:

ParameterTypeDescription
restStatusIntegerOptional. The HTTP response status code from the REST service call.
restResponseHeadersJSONOptional. The HTTP response headers from the REST service call.

POST

The POST action is used to send HTTP POST requests.

The input parameters for POST are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
restUrlEncodedBooleanOptional. Set whether the URL should be encoded or not, for example true.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
requestPayloadJSONOptional. The body of the request.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from POST are:

ParameterTypeDescription
restResultJSONOptional. The response from the REST service call.
restStatusIntegerOptional. The HTTP response status code from the REST service call.
restResponseHeadersJSONOptional. The HTTP response headers from the REST service call.

PUT

The PUT action is used to send HTTP PUT requests.

The input parameters for PUT are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
restUrlEncodedBooleanOptional. Set whether the URL should be encoded or not, for example true.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
requestPayloadJSONOptional. The body of the request.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from PUT are:

ParameterTypeDescription
restResultJSONOptional. The response from the REST service call.
restStatusIntegerOptional. The HTTP response status code from the REST service call.
restResponseHeadersJSONOptional. The HTTP response headers from the REST service call.

PATCH

The PATCH action is used to send HTTP PATCH requests.

The input parameters for PATCH are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
restUrlEncodedBooleanOptional. Set whether the URL should be encoded or not, for example true.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
requestPayloadJSONOptional. The body of the request.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from PATCH are:

ParameterTypeDescription
restResultJSONOptional. The response from the REST service call.
restStatusIntegerOptional. The HTTP response status code from the REST service call.
restResponseHeadersJSONOptional. The HTTP response headers from the REST service call.

DELETE

The DELETE action is used to send HTTP DELETE requests.

The input parameters for DELETE are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
restUrlEncodedBooleanOptional. Set whether the URL should be encoded or not, for example true.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from DELETE are:

ParameterTypeDescription
restResultJSONOptional. The response from the REST service call.
restStatusIntegerOptional. The HTTP response status code from the REST service call.
restResponseHeadersJSONOptional. The HTTP response headers from the REST service call.

OPTIONS

The OPTIONS action is used to send HTTP OPTIONS requests.

The input parameters for OPTIONS are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
restUrlEncodedBooleanOptional. Set whether the URL should be encoded or not, for example true.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from OPTIONS are:

ParameterTypeDescription
restStatusIntegerOptional. The HTTP response status code from the REST service call.
restResponseHeadersJSONOptional. The HTTP response headers from the REST service call.

TRACE

The TRACE action is used to send HTTP TRACE requests.

The input parameters for TRACE are:

ParameterTypeDescription
restUrlStringRequired. URL of the REST endpoint including the protocol and path, for example http://alfresco.com.
restUrlParamsJSONOptional. JSON map of the URL parameter names and values to append to the URL.
requestHeadersJSONOptional. A JSON map of the request header names and values. Values can be fixed values or variables.
circuitBreakerBooleanOptional. Set whether the circuit breaker is enabled, for example true.
timeoutIntegerOptional. The timeout period to wait for the service in milliseconds, for example 910000.

The output parameters from TRACE are:

ParameterTypeDescription
restResultJSONOptional. The response from the REST service call.
restStatusIntegerOptional. The HTTP response status code from the REST service call.

Configuration parameters

The configuration parameters for the REST connector are:

ParameterDescription
EVENT_NOT_MATCH_STATUSOptional. The HTTP response code to return to an external system if no triggers are matched by an incoming webhook request, for example 404.

Note: The configuration parameters for the REST connector are used for configuring webhooks using triggers.

Errors

The possible errors that can be handled by the REST connector are:

ErrorDescription
MISSING_INPUTA mandatory input variable was not provided.
INVALID_INPUTThe input variable has an invalid type.
UNKNOWN_ERRORUnexpected runtime error.
BAD_REQUESTThe server could not understand the request due to invalid syntax.
UNAUTHORIZEDThe request has not been applied because it lacks valid authentication.
FORBIDDENThe server understood the request but refuses to authorize it.
NOT_FOUNDThe server could not find what was requested.
METHOD_NOT_ALLOWEDThe request method is known by the server but is not supported.
NOT_ACCEPTABLEThe server cannot produce a response matching the list of acceptable values.
PROXY_AUTHENTICATION_REQUIREDThe request has not been applied because it lacks valid authentication.
REQUEST_TIMEOUTThe server would like to shut down this unused connection.
CONFLICTThe request conflicts with current state of the server.
GONENo longer available.
INTERNAL_SERVER_ERRORThe server has encountered a situation it doesn't know how to handle.
NOT_IMPLEMENTEDThe request method is not supported by the server and cannot be handled.
BAD_GATEWAYThe server got an invalid response.
SERVICE_UNAVAILABLEThe server is not ready to handle the request.
GATEWAY_TIMEOUTThe server is acting as a gateway and cannot get a response in time.

© 2023 Alfresco Software, Inc. All Rights Reserved.