Skip to main content
Nintex Community Menu Bar
Answer

API Authorization Request: Can I send credentials in body vs headers?

  • March 28, 2024
  • 2 replies
  • 136 views

Forum|alt.badge.img+1

I’m trying to set up a REST service broker to integrate with USPS’ address validation API.  In order to get the token, this is the code example USPS provides: 

curl -X 'POST' "https://api.usps.com/oauth2/v3/token" \     --header 'Content-Type: application/json' \     --data '{		"client_id": "$CLIENT_ID",		"client_secret": "$CLIENT_SECRET",		"grant_type": "client_credentials"		}'When I added these values as Resource Parameters and attempt to set up the service instance, I’m redirected for validation and receive the following error:
{"fault":{"faultstring":"Raising fault. Fault name : Raise-Fault-Request-Body-Missing","detail":{"errorcode":"steps.raisefault.RaiseFault"}}}When I attempt this in Postman, I’m able to send the parameter values in the body and then I successfully retrieve a bearer token.  However, I’m not sure how to do that in K2 Cloud.  Is there a way that I can specify the resource parameters need to be sent in the body, vs header parameters? TYIA!

Best answer by TinTex

Did you setup the client_credentials outbound flow similar to the following?

 

2 replies

Forum|alt.badge.img+11
  • Nintex Employee
  • Answer
  • March 28, 2024

Did you setup the client_credentials outbound flow similar to the following?

 


Forum|alt.badge.img+1
  • Author
  • Novice
  • March 28, 2024

Ah, thank you.  I think I was missing the extension