Response is null when calling a POST API from Expression Rule that uses an OpenAPI Connected System to get a Token

I have created a Connected System that uses OpenAPI.  I then created an Integration that uses the OpenAPI CS to call a User Authentication API that returns a service token.  That token is then used to authenticate  other APIs that are available for the application.  Every API must have the token referenced in the header in order to authenticate. 

I am trying to create an Expression Rule that can be used as a wrapper to call the User Authentication API and return the token.  I would like to use this rule as the Header value when creating additional integrations for the other APIs so that the authentication can occur every time the integration is called.  When I test the expression rule, I get an error that reads: "The jsonText parameter must not be null or empty."

Here is a screen shot of the Integration, which works when I manually insert a valid bearer token:

Here is the expression rule that fails:

It seems like the API is not being called because the response is always null.  I had to modify the call to the Integration to include the onSuccess and onError parameters.  I have tried using those values as well, but they are also null. 

I can't understand why the Integration works when I use the Test Request option on the Integration screen, but it does not work when called from an Expression Rule.

Can anyone help me understand how I should configure the Expression Rule for it to work?  If so, would you be willing to share an example?

Thanks!

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data