SAP Integration Suite - Open Connectors Setup & Testing

Build and test a custom connector in SAP Integration Suite for the ENLYZE Platform API

Build and test a Custom connector in SAP Integration Suite → Open Connectors for the ENLYZE REST API, using an API Token and a PreRequest Hook to inject the upstream Authorization: Bearer <token> header. Then verify calls in API Docs and (optionally) wire the instance into a Cloud Integration iFlow.

Architecture in 90 seconds

Open Connectors introduces two authentication layers you’ll see in UI and cURL:

  1. SAP Open Connectors auth (platform) — the header shown in API Docs like Authorization: User <…>, Organization <…>, Element <…>. This authenticates you to Open Connectors.

  2. Vendor (ENLYZE) auth — the header we add in a PreRequest Hook: Authorization: Bearer <ENLYZE_API_TOKEN>.

Keep them separate: never paste the Bearer token into the API Docs Authorization field. That field is for Open Connectors. The hook takes care of the ENLYZE header.

Prerequisites

  • ENLYZE API token for the target tenant.

  • Access to SAP Integration Suite → Open Connectors with Connector Builder permissions.

    The Set Up Integration Suite Trial is a good tutorial on how to get started with the SAP Integration Suite. Make sure, that you have the right capabiliteis activated in Integration Suite. You need:

    • Build Integration Scenarios

    • Manage APIs

    • Extend Non-SAP Connectivity

    With the Extend Non-SAP Connectivity you can create new connectors.

Step 1: Import the ENLYZE OpenAPI

  1. In Open Connectors → Connectors click Build New Connector

    Use the Import option to create your connector:

  2. Choose Swagger and use the Open API specification to import the configuration: https://app.enlyze.com/api/v2/openapi.json

    Click Continue Import.

  3. Select the resources you need. Recommended baseline:

    • GET /v2/machines, /v2/sites, /v2/variables, /v2/production-runs, /v2/downtimes, /v2/products, /v2/data-sources

    • POST /v2/timeseries (read time series) and POST /v2/machines/{uuid}/productivity-metrics if required

The Element Key must be unique in your tenant.

Step 2: Properties

After the resources are imported, you need to configure the authentication mechanism. We will use a custom authentication where the token is provided at the beginning of the connector setup and is passed to each request via a PreRequest hook.

In Setup → Properties:

  • Base URL: https://app.enlyze.com/api/

  • Pagination Type: cursor

  • Accept/Content-Type: application/json

  • Authentication type: custom

Step 3: Configuration (store the token)

In Setup → Configurations add:

  • Name: API Token

  • Key: api.token (auto)

  • Type: text 128

  • Required: ON

  • Description: ENLYZE API Token (or a more detailed description)

We won’t add a global Authorization parameter. The hook will inject the upstream header on every call.

Step 4: PreRequest Hook (inject Bearer)

In Setup → Hooks → PreRequest Hook, add:

let token = configuration['api.token'];
request_vendor_headers.Authorization = `Bearer ${token}`;
done({"request_vendor_headers":request_vendor_headers,      
      "contintue":true});

Why this works

  • configuration['api.token'] reads your instance token.

  • request_vendor_headers targets the provider-facing headers (sent to ENLYZE).

  • Returning { request_vendor_headers } makes the change effective for the outbound request.

This will add the {“Authorization”:”Bearer XXXXX”} object to all subsequent calls.

Click Save.

Step 5: Test the Connector - Create an Instance

From Resources (or Instances) click Authenticate instance:

  • Name: free text (e.g., Test Instance)

  • API Token: paste the raw token only (no Bearer prefix)

Instance configuration screen:

Create the instance.

Step 6: Test the Connector - via API docs

Open your instance → API Docs and pick a simple endpoint, e.g. GET /v2/machines.

  1. Leave the Authorization field as the prefilled Open Connectors value (User/Organization/Element).

  2. Click Execute.

  3. You should see 200 with JSON. The generated cURL uses a path like:

https://api.openconnectors.<region>.ondemand.com/elements/api-v2/v2/machines
# Header sent to OC (platform auth):
-H "Authorization: User <…>, Organization <…>, Element <…>"

Open Connectors forwards our hook-injected upstream header to ENLYZE:

Authorization: Bearer <your ENLYZE API token>

Tip: Use /v2/sites or /v2/machines for first tests. For time-bounded resources, pass realistic start/end or cursor params.

Test an endpoint:

Successful response:

Troubleshooting

401 "User is not authorized" immediately in API Docs

  • You’re not authenticating to Open Connectors: ensure the API Docs Authorization field shows User…, Organization…, Element… (it’s usually prefilled). Don’t overwrite it with a Bearer token.

401 from ENLYZE (vendor)

  • The upstream header wasn’t added. Recheck the PreRequest Hook, save, and recreate/reauthorize the instance. Verify your token is valid.

Internal error / timeouts when hitting /elements/api-v2/...

  • Ensure the path matches what API Docs shows for your element (for Swagger imports, it’s typically /elements/api-v2/v2/...).

Double /v2 or wrong base

  • Keep Base URL https://app.enlyze.com/api/ and resource paths /v2/... as imported by Swagger.

Appendix — Examples

Example: cURL via Open Connectors instance (API Docs style)

curl -X GET \
  "https://api.openconnectors.<region>.ondemand.com/elements/api-v2/v2/machines"  \
  -H "Accept: application/json" \
  -H "Authorization: User <USER_SECRET>, Organization <ORG_SECRET>, Element <ELEMENT_TOKEN>"

Example: Direct ENLYZE cURL (bypasses Open Connectors)

curl -X GET "https://app.enlyze.com/api/v2/machines" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <YOUR_ENLYZE_API_TOKEN>"

Use the direct call only for local debugging. In SAP you should call through your connector instance so that logs, throttling, and mappings apply.

Last updated