REST

REST

Introduction to REST (Representational State Transfer)

REST (Representational State Transfer) is an architectural style for designing distributed systems. It provides a simple and lightweight way to access and manipulate resources over the internet by using a set of well-defined operations such as GET, POST, PUT, and DELETE. To use REST to access resources, ensure that appropriate network access is available by configuring the firewall or network settings.

Provide relevant connection details, such as the endpoint URL, port number, and authentication credentials, to access RESTful web services. Additionally, SSL or other security settings may need to be specified for secure connections. Once the connection is established, the RESTful API can be used to perform various operations on the resources, such as retrieving, creating, updating, or deleting them.

Key Terms and Concepts

Base URL

The base URL is the starting point or root of the API endpoint URLs. It typically includes the domain or IP address of the server hosting the API.

Health Path

The health path is a specific endpoint used to check the health or availability of the API. It provides information about the status of the API service.

Username and Password

Credentials used for authentication to access protected resources in the API. The username and password are usually sent as part of the request, typically using HTTP Basic Authentication.

Web Token Generation Endpoint

An endpoint specifically designed to generate a web token (such as JWT - JSON Web Token) used for authentication and authorization purposes. Clients send a request to this endpoint with the necessary credentials, and the server responds with a generated web token.

Web Token Request Body

The request body is the data sent to the web token generation endpoint when requesting a web token. It typically includes the authentication credentials required for token generation.

Web Token Response Key

The key or property in the response from the web token generation endpoint that contains the generated web token. Clients extract this value from the response to obtain the token for subsequent API requests.

API Request Token Header Key

When making subsequent API requests that require authentication, the web token is typically included in the request header. The API request token header key is the specific key used in the header to hold the web token value.

Endpoint URL

The endpoint URL represents a specific resource or action within the API. It is constructed by appending the endpoint path to the base URL.

Request HTTP Method

The HTTP method specifies the type of operation or action to be performed on the resource. Common methods include GET, POST, PUT, and DELETE.

Headers contain additional information about the request or response. They can include metadata, authentication details, or instructions for the server or client. Headers are sent as part of the HTTP request or response.

Request Timeout

The request timeout is the maximum time the client will wait for a response from the server. If a response is not received within the specified timeout duration, the client may consider the request unsuccessful.

Request Body

The request body contains the data sent by the client to the server in the API request. It can include parameters, JSON payloads, or other relevant data required by the API to process the request.

Template

A template is a predefined structure or format for an API request. It serves as a blueprint or example that developers can use as a reference when constructing their own requests, ensuring consistency and correctness in the API calls.

Establishing a Connection with a REST API

To successfully establish a connection with a REST API, the following parameters must be filled accurately:

REST Connection Parameters

ParameterDescriptionData Type
BaseURLBase URLString
UserName (Optional)Username to connect to serverString
Password (Optional)Password to connect to serverString
HealthPathURL to check health of the serverString
Header (Optional)Header key-value pairs to add to request headersString
WebToken (Optional)Information to retrieve authentication tokens for requestsWeb Token
FlattenModeledValuesWhether to flatten modeled valuesBool
InputsConnection inputsList
OutputsConnection outputsList

Web Token Parameters

ParameterDescriptionData Type
EndpointURL endpoint to retrieve Web TokenString
BodyRequest body for Web Token requestString
TokenKeyThe key to extract token from response bodyString
HeaderKeyThe key of the response header which contains the token (e.g. Authorization)String

Input Parameters

Once the connection with the REST API source has been established successfully, use the "input" page to define the data or dataset. This step involves specifying the necessary details related to the data or dataset, such as its location, type, and structure. Ensure all relevant information is accurately entered on the "input" page to properly define the data or dataset for successful transfer to a REST API endpoint.

ParameterDescriptionData Type
EndpointURLEndpoint to send request toString
HTTPMethodHTTP Method (e.g., GET, POST)String
RequestBody (Optional)Request BodyString
Header (Optional)Header key-value pairs to add to requestString
RequestTimeoutMs (Optional)Request timeout in millisecondsInt

Output Parameters

To transfer the data package created by the user to a REST API endpoint, define an output. This includes specifying the URL of the API endpoint and the corresponding request method, such as POST or PUT. If the API endpoint requires authentication, provide the necessary authentication credentials or tokens.

Before sending the data package, ensure it conforms to the expected data format and structure of the API endpoint. This includes specifying the required fields and data types, as well as any constraints or validation rules on the data. In some cases, map the data from the input format to the output format expected by the API endpoint.

To verify the successful transfer of data, check the response from the API endpoint. This may include status codes, error messages, or confirmation messages indicating that the data has been successfully received and processed. Handle any errors or exceptions that may occur during the data transfer process to ensure reliable and consistent data transfer.

ParameterDescriptionData Type
EndpointURLEndpoint to send request toString
Template (Optional)TemplateString
RequestBody (Optional)Request BodyString
Header (Optional)Header key-value pairs to add to requestString
RequestTimeoutMs (Optional)Request timeout in millisecondsInt
HTTPMethodHTTP Method (e.g., POST, PUT)String

Example of Establishing a Connection with REST API

To establish a connection with a REST API, follow these steps:

  1. Add the address from the REST settings' endpoint section to the base URL. This combined URL will be used for the connection.
  2. Determine the appropriate HTTP method for the specific endpoint, such as GET or POST.
  3. For GET requests, create an input field for the request.
  4. For POST requests, create an output field.
  5. Explicitly specify the endpoint in the output configuration.
  6. Define the desired structure of the data in the template section, serving as a standardized template for the data to be incorporated in the API call.

 

 

 

    • Related Articles

    • Azure IoT Hub

      Azure IoT Hub is a managed service by Microsoft that enables secure communication and management of Internet of Things (IoT) devices and data. It acts as a central hub for devices to send telemetry data, receive messages, and execute commands. To ...
    • ElasticSearch

      Elasticsearch is a popular distributed, open-source search and analytics engine that can be used to store and search for various types of data. Before attempting to establish a connection with Elasticsearch, you must ensure that the server you are ...
    • Azure Event Hub

      Azure Event Hub is a cloud-based service provided by Microsoft for streaming data and events from various sources to a central hub. It is designed to handle large amounts of data in real-time, making it ideal for log processing and telemetry data ...
    • AWS S3

      Introduction to AWS S3 (Amazon Simple Storage Service) Amazon Simple Storage Service (S3) is a scalable, durable, and highly available cloud storage service offered by AWS. S3 provides a simple web services interface that can be used to store and ...
    • AWS Kinesis

      AWS Kinesis is a managed service that enables scalable and real-time data streaming. To utilize AWS Kinesis, users create a Kinesis data stream to receive and store the streaming data. Real-time data analysis can be performed through Kinesis data ...