Custom Auth Action-Can't edit contracts-getting . Resolve request body template: Substitution values invalid in action config. Reference ${input.<variable>} evaluated to null when attempting to render at BodyTemplate error

Hello,
My understanding is that in order to submit a webservice request to our customer's API, The API first needs to be authenticated to Genesys Cloud, and then the request to the customer's API must send the API key and secret. It seems like a dual authentication.

The request works fine in Postman:

I have created a custom auth action, which publishes automatically after being created with uneditable contracts:

The configuration for the action is editable, and I have actually created two actions:

  1. using code authorization for Genesys Cloud authentication
    and
  2. using client credentials for Genesys Cloud authentication

Config for Code Authorization:


Here, the variables that are supposed to come from architect are in the request body template; however, I can't edit the contracts to allow for variables from Architect to go to the data action.

Config for client credentials:

Same problem as with Code Authorization: the variables that are supposed to come from architect are in the request body template; however, I can't edit the contracts to allow for variables from Architect to go to the data action.

When I try to test both of these data actions, I get the same error:

The reason seems to be that I cannot edit the contracts to allow for input variables.
I'm not sure if I'm missing something, if I need to use an AWS lambda function for it to work, or if there needs to be another approach.

Thanks

Auth actions don't have inputs (which I'm assuming is what we're looking at in your screenshots); they pull "inputs" from the credentials using the ${credentials.*} notation (like you're doing in the headers). The error your seeing in the last screenshot is because you don't have an input value, so the velocity template fails to parse (that's what the message in the error is telling you).

Unfortunately, you covered up everything in your postman example (including the keys in the body), so I can't really tell what's going on there. I would imagine there is some information that needs to be exchanged with the Login URL as part of the POST body; if that's the case, then you would want to include that information as part of your credential, and use the {credential.*} notation to pull it into that auth action.

Thanks for your response. :slightly_smiling_face:
The mistake I had been making was thinking that the API backend was somehow oauth, when it's actually just an API key/secret pair. A regular user-defined custom web services integration action (not oauth) is what was needed. With this integration/action combination, it is working fine.

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