ECE & Watcher: Trouble sending API key to ECE

I am trying to create a Watcher using information from the ECE API as input. However I am having trouble getting authenticated. This is the Input for the watcher:

"input": {
    "http" : {
      "request" : {
        "scheme" : "https",
        "host" : "[URL Here]",
        "port" : 12443,
        "path" : "/api/v1/platform/infrastructure/allocators",
        "method" : "get",
        "headers":{
          "Authorization" : "ApiKey [Key Here]"
        }
      }
    }
  },

The error:

        "_status_code": 401,
        "errors": [
          {
            "code": "root.unauthenticated",
            "message": "The supplied authentication is invalid"
          }
        ]

Which is very odd as I am able to get the expected response using Curl and Postman, both use the same header info as above:

Postman:

Curl Command:

curl -k -X GET -H "Authorization: ApiKey [Key value here]" https://[URL here]:12443/api/v1/platform/infrastructure/allocators

So I was hoping someone here could help me figure out how to properly send my API key to get authenticaed.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

Hello,
This problem happen when you use invalid credentials at a moment .This means that all subsequent executions of the watch will result in errors, even if the credentials are correct.
This issue has been fixed here
The workaround is to restart the elasticsearch cluster to clear the watcher cookies