Trevor Maxwell
Trevor Maxwell

Reputation: 1

Using POST node in KNIME

When trying to get Auth token I get a 401 error.

{
  "messages" : [ {
    "level" : "error",
    "type" : "InvalidRequestException",
    "text" : "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the \"access token\" parameter.",
    "fields" : [ ]
  } ]
}

enter image description here

I would love some help on connecting to an API to retrieve a Token.

I have triple-checked the URL and the credentials. I feel there is another step or setting I need to add.

From the website of the API here is the example:

var settings = {
  "crossDomain": true,
  "url": "(add URL)",
  "method": "POST",
  "headers": {
    "content-type": "application/x-www-form-urlencoded"
  },
  "data": {
    "partner_id": "partner12345",
    "client_id": "id12345",
    "client_secret": "secret12345",
    "grant_type": "client_credentials",
    "scope": "(list of access)"
  }
}

$.ajax(settings).done(function (response) {
  console.log(response);
});

I have tested this in Postman and it works with all the same information that I am testing in KNIME analytics. I have not been able to get the token to generate in KNIME POST request node I get the error above.

If you have any ideas or insights please let me know.

I expect a JSON formatted token to return that I can use as Auth for the GET request to the API.

Upvotes: 0

Views: 244

Answers (0)

Related Questions