ReST
Learn how to use the ReST action in DBSync Cloud Workflow
Introduction
The ReST Action in DBSync Cloud Workflow enables users to interact with any ReSTful web service within their workflows. This action is versatile and allows you to send HTTP requests, enabling seamless integration with various external services and APIs. This guide provides step-by-step instructions on setting up, configuring, and using the ReST action effectively.

Prerequisites
An active DBSync Cloud Workflow account.
A fully configured OpenAPI Connector.
The endpoint URL of the ReSTful web service you intend to connect to.
API credentials (if required by the endpoint) and necessary access permissions.
Set Up a ReST Action
Configure the ReST Action
In the Flow screen, drag the Flow Action from the Actions palette on the left and drop to the center of the screen.
Click Configure on the flow panel to configure the flow.
In the Flow configuration panel that opens on the right side, enter the required description for the flow and click Save.
Drag and drop the ReST action from the list of available actions.
Enter the following details:
Select Source: From the dropdown, select the required source.
Select Method: Choose the HTTP method (GET, POST, PUT, DELETE, PATCH, HEAD).
Relative URL: Provide the full URL of the API endpoint.

Configure API :
Parameters: Specific values, like query strings, headers, or path variables that you can set to customize your API requests. They help to define the data that you want to send to or receive from the API. By configuring these parameters appropriately, you can ensure that your request is tailored to meet the needs of the API you're interacting with. Specify any query strings needed by the endpoint.
Headers: Key-value pairs that you can configure to provide essential information to the API, such as authentication credentials, content type, or any other metadata that the server needs to process your request correctly. Set these headers in the Headers tab when setting up your API call. Add custom headers such as Content-Type or Authorization for authenticated requests.
Request: Select between None, Raw, and Binary Request.
Metadata: Data that describes other data and structures involved in the API interaction. It can include details about the schema design, business rules, and processes that govern how the data is structured and utilized.

Executing a ReST Action
Test the Action
Save your workflow configuration.
Click Run
to execute the ReST Action and observe the response.Review the response data and logs to ensure the action works as intended.
Use the Response
Capture Output: Store response data for use in subsequent workflow steps by mapping output fields.
Conditional Logic: Set conditions based on response status codes (For example,
200 OK,400 Bad Request) to control workflow behavior.
Common Use Cases
Retrieve Data from an External API
Select GET as the method.
Provide the Endpoint URL and any necessary headers.
Run the workflow to retrieve data, and map the response fields for use in downstream actions.
Send Data to a Third-Party Service
Select POST or PUT as the method.
Configure the Body with data mapped from previous workflow steps.
Include any required headers (e.g.,
Content-Type: application/json).Test and save the action to send data.
Update Data via PATCH Request
Choose PATCH and specify the Endpoint URL.
Include the partial data in the Body that you want to update.
Save and execute the workflow to make the update.
Advanced Configuration
Dynamic Variables in URLs and Headers
Use Placeholders (for example, {{variable_name}}) in the URL, headers, or body to dynamically insert data at runtime.
Handling Large Payloads
For large payloads, ensure the endpoint supports chunked transfer or increase the timeout setting in the ReST Action to avoid interruptions.
Error Handling and Debugging
Common Issues
401 Unauthorized: Check authentication credentials and token validity.
404 Not Found: Verify that the endpoint URL and resource path are correct.
Timeout Errors: Increase the action timeout or check the network status.
Debugging Tips
Log Responses: Enable response logging to capture the details of API interactions.
Use Test Mode: Run the ReST Action in test mode to monitor real-time response data without affecting production workflows.
Best Practices
Secure API Keys: Store API keys in a secure environment and avoid hardcoding them in workflows.
Optimize API Calls: Minimize API calls by using only necessary data fields and parameters.
Monitor API Limits: Be aware of the rate limits imposed by the API provider to prevent overuse.
The ReST Action in DBSync Cloud Workflow provides a powerful way to connect with and automate data flows involving any RESTful service. By following this guide, users can configure and execute ReST Actions effectively to enhance their workflow automation and data integration processes.
Last updated