Creating a REST Method
  • 22 Feb 2024
  • 2 Minutes to read
  • Dark
    Light

Creating a REST Method

  • Dark
    Light

Article summary

REST Methods are specific HTTP calls (e.g. GET, POST, and PUT) that can be made to the URL defined in the REST Service.



Prerequisite

Example

  1. Navigate to System > Integrations > External Services > System REST Service > Add Method to Service. 
  2. On the New REST Service Method window, enter a Name for the new method. For the URL (Relative to Base) field, any URL defined here will be appended to the Service Base URL defined in the REST Service. For example, a base URL of "http://example.com/api/" might be paired with a relative URL of "fetch/users" to navigate to example.com/api/fetch/users. 
  3. Under the HTTP Method option, select the appropriate method. Selecting one of the options will display additional settings to configure. After all the desired configuration options are set, click OK.

Testing

  1. Right-click on the newly created REST Method and select Test Method.
  2.  Click Execute Test to test the newly created REST Method. 

Option Description
Content TypeSpecifies the content type for the method
Request Body Format

Get String from FlowAllows the user to send a string built in a Flow dynamically

Get Binary Data from FlowAllows the user to send raw bytes that are built in a Flow dynamically 

Serialize from Data TypeChoose a data type that'll be serialized to JSON or XML to create the request body

Specify Below (Use {} for variables)Allows custom request body and custom variables
Step Output TypeSpecify how to handle the response returned from the request

Raw ValueReturns the entire response as a raw string

Select Data TypeChoose a data type. The response string (JSON or XML) will be deserialized into the chosen type.

BinaryReturns the raw bytes of the response

NoneReturn is ignored
Show Advanced OptionsAllows a user to set optional configuration options for the service method being created

Override Base URLAllows users to ignore the base URL from the REST Service and instead get the base URL either from a Flow, a static base URL or from an OAuth token. If this option is selected, the relative URL will be appended to this new base URL.

AcceptAccept Header; overrides the default Accept header

Additional HTTP HeadersAllows users to specify other HTTP Header Keys and Values required for the new method

Expect: 100-continueResponse code for method request for servers that either expect code or use code. Can be left as True (default).

Preserve All Headers On RedirectEnables the Authorization Header to be present on method redirects

Override AuthenticationAllows users to specify an authentication that differs from the REST Service. If this option is selected, the authentication will only apply to the created method. If selecting an OAuth authentication, the token can be added using the Use Static OAuth Token option.



For further information on Integrations, visit the Decisions Forum.

Was this article helpful?