Configure the REST API Connector
Configure HTTP and HTTPS requests, authentication, headers, body encoding, response handling, and troubleshooting with the REST API Connector.
The REST API Connector sends HTTP or HTTPS requests from SIA Connect to an external API. Use it to retrieve a response at a configured interval or to send data when a mapping writes to an item.
This guide explains how to configure an instance and items, add authentication and headers, control request-body encoding, interpret responses, and troubleshoot requests.
A request can create, change, or delete data in the target system. Confirm the endpoint and HTTP method before enabling an item.
Before you begin
Make sure that:
- The REST API Connector is installed.
- SIA Connect can reach the API host through its configured network and DNS settings.
- You know the API base URL, endpoint path, HTTP method, authentication requirements, headers, and body format.
- The API credentials have only the permissions required for the intended request.
- You have a safe test endpoint or test record available when the request changes data.
Store Basic authentication credentials in the instance fields. API keys and bearer tokens must be added as headers. Protect exported configurations and diagnostic logs that may contain credentials or request data.
Understand when requests are sent
| Operation | When the request is sent | Request body | Result |
|---|---|---|---|
| Read an item | At the item's configured read interval | The body configured on the item | The response body from a successful request becomes the item value. |
| Write to an item through a mapping | When the mapping writes a value to the item | If the item Body is empty, the mapped value is used. If Body contains content, the configured content is used instead. | The response body from a successful request becomes the item value. |
Create a REST API instance
- In the Edge Portal, open Instances.
- Select Create instance.
- Select the REST API Connector.
- Enter a unique name for the instance.
- Enter the API base URL in Address.
- Configure the remaining instance parameters.
- Select Create.
Instance parameters
| Parameter | Description |
|---|---|
| Address | The base URL of the API, including http:// or https://. For example, https://api.example.com/v1. |
| Connection timeout | The maximum time, in seconds, allowed when establishing the connection. The default is 10. This setting does not limit the total time taken to receive a response. |
| Default headers | Headers added to every request from the instance. Use the brace format described in Add request headers. |
| Username | The username for HTTP Basic authentication. Basic authentication is enabled when this field contains a value. |
| Password | The password for HTTP Basic authentication. |
Add request headers
Enter each header inside braces using {Header-Name: value}. Place multiple headers directly after one another.
{Accept-Language: en-US}{X-API-Key: example-key}Default headers from the instance and headers from the item are combined. Use default headers for values required by every item. Use item headers for endpoint-specific values.
For bearer-token authentication, add an authorization header:
{Authorization: Bearer example-token}An entry with a missing closing brace is ignored. Do not include real credentials in screenshots, examples, or support requests.
Create a REST API item
- Open the REST API instance.
- Open the Items tab.
- Select Create item.
- Enter a unique item name.
- Enter the endpoint path and select the HTTP method.
- Configure any item-specific headers, request body, and body encoding.
- Configure the read and write behavior required for the item.
- Select Create.
Item parameters
| Parameter | Description |
|---|---|
| Endpoint | The path added to the instance Address. For example, /measurements. |
| Header | Headers used by this item. Enter them using the same brace format as the default headers. |
| Body | The request body. Leave this empty when a mapped value must be used as the body of a write request. |
| Encoding | Controls whether the body is sent unchanged or URL encoded. The default is Auto. |
| Type | The HTTP method. Select GET, POST, PUT, or DELETE. |
The Connector joins the instance Address and item Endpoint with one slash. For example, https://api.example.com/v1 and /measurements become https://api.example.com/v1/measurements.
Configure a request that runs at an interval
Use an item with read enabled when the request must run at regular intervals.
- Create or edit the item.
- Select the required HTTP method.
- Enter the endpoint path.
- Add any required headers and body.
- Enable reading and configure a suitable read interval.
- Save the item.
- Check the item value and status after the first request.
For a successful HTTP response with a status from 200 through 299, the complete response body is stored as the item value. The Connector does not extract individual properties from a JSON response.
Send mapped data to an API
Use a writable item and a mapping when another item value must trigger the request.
- Create or edit the REST API item.
- Select POST or PUT, as required by the API.
- Enter the endpoint and required headers.
- Leave Body empty if the incoming mapped value must become the request body.
- Enable writing and save the item.
- Create a mapping from the source item to the REST API item.
- Trigger a test value and check the REST API item's value, status, and events.
If the item Body contains content, that content is sent instead of the mapped value. This behavior is useful when a mapping should trigger a fixed request.
Choose the body encoding
| Encoding | Behavior | Use when |
|---|---|---|
| Auto | A body structured as key=value&key=value is URL encoded. Other content is sent unchanged. |
The Connector should identify a form body automatically. This is the default. |
| None | The UTF-8 body is sent unchanged. | The API expects JSON, XML, plain text, or already encoded content. |
| URL encode | Each key and value in a key=value form body is percent encoded. |
The API expects an HTML form-style body. |
For a URL-encoded form request, add the following item header:
{Content-Type: application/x-www-form-urlencoded}When the final request body is valid JSON, the Connector automatically adds Accept: application/json and Content-Type: application/json. Request bodies are sent as UTF-8, including non-ASCII characters.
Interpret responses
| Result | Connector behavior | Recommended action |
|---|---|---|
200 to 299
|
The request succeeds and the response body becomes the item value. | Confirm that the returned content is the expected value. |
300 to 399
|
The request fails. Redirects are not followed automatically. | Configure the final API URL shown by the service. |
400 to 499
|
The API rejects the request. For a mapped write, the error is associated with the mapping when available. | Check the URL, authentication, headers, method, body, and permissions. |
500 or higher |
The remote service reports a server error. | Check the service status and its server-side logs. |
| Connection or transport error | The request does not receive an HTTP response. | Check DNS, routing, firewall rules, protocol, port, and availability. |
A failed HTTP request is reported as Code: status response, where status is the HTTP status and response is the body returned by the API.
Verify the configuration
- Use a known safe request and test value.
- Confirm that the instance and item do not report errors.
- Check that the API received the expected method, URL, headers, and body.
- Confirm that the response body appears as the item value.
- For a mapped write, verify that the request runs only when the intended mapping is triggered.
- Set a read interval that respects the API's rate limits.
Troubleshoot the REST API Connector
The host cannot be resolved or reached
Confirm that the Address contains the correct scheme and hostname. Test name resolution and network access from SIA Connect. Check its DNS configuration, default route, firewall rules, and the API port. Increase the connection timeout only when establishing the connection legitimately takes longer.
The API returns 401 or 403
Check the credentials and permissions. Enter Basic authentication credentials in the instance Username and Password fields. For a bearer token or API key, confirm the required header name, prefix, and token value.
The API returns 404
Check the combined instance Address and item Endpoint. Confirm the API version and path. Remember that the Connector adds one slash between the two values.
The API returns a redirect
The Connector does not follow redirects automatically. Replace the Address or Endpoint with the final URL supplied by the API.
The API returns 400, 415, or 422
Check the request method, body format, body encoding, and Content-Type. Use None or Auto for JSON. Use URL encode and add Content-Type: application/x-www-form-urlencoded when the API expects form data.
A header is missing from the request
Confirm that every header uses the complete {Header-Name: value} format. Check both the instance Default headers and the item Header fields.
The mapped value is not sent
Clear the REST API item's Body field. A configured body takes precedence over an incoming mapped value.
The response contains JSON but individual values are unavailable
The Connector stores the complete response body as text. It does not extract JSON properties into separate items. Process or transform the response in another component when individual fields are required.
The API reports too many requests
Increase the item read interval and check the API's rate-limit requirements. Avoid enabling polling when the request only needs to run after a mapped value changes.
Characters are displayed incorrectly by the receiving service
The Connector sends request bodies as UTF-8. Confirm that the API expects UTF-8 and add an appropriate Content-Type header with a UTF-8 charset if the service requires it.
An HTTPS endpoint uses a certificate
Security limitation: The current Connector does not validate the remote TLS certificate. Use only trusted endpoints and networks. Do not treat a successful HTTPS connection as proof of the remote server's identity.
More diagnostic information is required
Review the system logs for the requested URL, HTTP status, and transport error. Debug logs can include request headers, bodies, and responses. Restrict access to the logs and remove or rotate exposed credentials after troubleshooting.