Solved

What is the format to write the Body in HTTP connector for API?

  • 11 April 2022
  • 9 replies
  • 162 views

Userlevel 2
Badge +5

I want to create users in IAM using API. In order to POST the details , I am using below JSON query as the Body. Its working via Postman, but not through SF. I think the format to write JSON query is not correct. Has someone tried it. Please let me know the correct format to use JSON query in Body of an API.

Postman Details
SF input

 

icon

Best answer by Erwin Ekkel 11 April 2022, 15:56

View original

This topic has been closed for comments

9 replies

Userlevel 7
Badge +23

Hi,

Can you show the status code, HTTP status code and content returned?

Also, the Content posted should not have the “[]” characters around the JSON. See: https://docs.thinkwisesoftware.com/docs/indicium/api#performing-crud-operations-functions-and-procedures

Userlevel 2
Badge +5

I updated the JSON format as per your suggestion, and re-run the HTTP connector:
 

Its working in Insomnia

 

No content is returned

 

Userlevel 7
Badge +23

 

 

The Result tab is the tab I'm interested in 😉 could you show that one?

Userlevel 2
Badge +5
sure.. :)
  Http response set-cookie ApplicationGatewayAffinityCORS=14b0db35d742b6b854c8e82c613a990b; Path=/; SameSite=None; Secure,ApplicationGatewayAffinity=14b0db35d742b6b854c8e82c613a990b; Path=/,.AspNetCore.Session=CfDJ8HTtrwtDJMpMvSbm3YJQwdmQfOkygnbVxapogUHloGwJPSj%2B35%2BOqUFdD0PbeEIbNBh0LcDZQ8vkHoBjUur2h%2BjrQPOqC1MbomZRqbdPTgA5KbDhzJRU8zV%2FN1EJv72uNuh6si%2B3V68Maq9uDN%2BFACVJ0hFAaTovKJds2pwPnmca; path=/; secure; samesite=lax; httponly,ARRAffinity=862cb2017d946478a07d3cccc5d4c9c8bb0f73d25b9d5e4ac8320e7d56368284;Path=/;HttpOnly;Secure;Domain=sisarbv-thinklab-indicium-prod.azurewebsites.net:443,ARRAffinitySameSite=862cb2017d946478a07d3cccc5d4c9c8bb0f73d25b9d5e4ac8320e7d56368284;Path=/;HttpOnly;SameSite=None;Secure;Domain=sisarbv-thinklab-indicium-prod.azurewebsites.net:443
Userlevel 6
Badge +16

Can you show the current content input for the http connector? 

Userlevel 2
Badge +5

below is the Content input:
 {
           "usr_id": "a_test_user5"
           ,"first_name":  "Rey"
           ,"sur_name": "naik"
           ,"appl_lang_id": "ENG"
           ,"authentication_type": 3
           ,"email": "email1@test.com"
           ,"allow_change_password": 1
  }

 

below is the Content-Type: application/json

Userlevel 6
Badge +16

that should work:

 

Did you remove the square brackets from the content input for the http connector and did you then synchronize (when using iam) or reload the model (when using the sf)?

Userlevel 2
Badge +5

Hi Erwin!! After IAM synchronization its working!! Thanks a lot!

Userlevel 2
Badge +5

Thanks Mark for you help too!