I need to Post to an API URL sending my username and password to get a bearer token returned. I’m struggling with the syntax needed to send form data plus these 2 inputs. I’ve used Postman to test my credentials and the URL. I get a 200 status code and the token is returned. However, I haven’t been able to get it to work within Nintex itself.
Can someone please tell me what belongs in the Request headers and Request content boxes to make this work?
If you’d like an example of a “Call a Web Service” action that retrieves a bearer token, here’s a screenshot of an action that utilizes the action to get a bearer token from Nintex.
The bearer token that’s produced is available to be parsed out in the TokenResponse variable. Hopefully this, along with the nintex token api documentation (https://developer.nintex.com/docs/nc-api-docs/1e26b9d25afd4-applications), will help you figure out the format of whatever fields your particular service is needing.
The best method for doing this would be to build out an xtension to store the call procedure, then it can be added to both forms and workflows and Nintex will handle the token handshake for you.
Thanks, both. I appreciate the answers. For this instance though, I’d like the quick and easy answer on how to format form fields to send through the basic fields first, please. I don’t want to build an extension if all I’m trying to do is post a username and password to a URL and retrieve a token as the variable. I’ve hard-coded the token from Postman in my next call and gotten a 200. Can you please share the syntax to do this in the Request headers or Request content fields? Thanks
What service are you calling against? The configuration of Web Services is dependent on what API you’re calling so without what API you’re calling it’s not possible to know what configuration you’d need.
I’d also recommend looking at building an Xtension rather than using a pure web service buildout (I assume you’re calling another web service after this using the bearer token). For the documentation on how to build out Xtensions you can look here: https://help.nintex.com/en-US/xtensions/Home.htm
If you’d like an example of a “Call a Web Service” action that retrieves a bearer token, here’s a screenshot of an action that utilizes the action to get a bearer token from Nintex.
The bearer token that’s produced is available to be parsed out in the TokenResponse variable. Hopefully this, along with the nintex token api documentation (https://developer.nintex.com/docs/nc-api-docs/1e26b9d25afd4-applications), will help you figure out the format of whatever fields your particular service is needing.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.