Skip to main content
Solved

JSON Call - assigning a server connection / url with credentials

  • Nov 16, 2022 3:29 PM UTC
  • 9 replies
  • 387 views

Forum|alt.badge.img+1

Hi All,

 

I have a question about the connection in JSON Call.

I had given the url (GraphQL url )to connect in the url section,

and in the http headers section, I had given the Authorization in Name and credentials in value.
The same thing works in Postman but not in JSON calls.

Please make any suggestions.

 

Thanks

Avi

Best answer by AKislyakov

With JSON Call you have two options:

  • Register a Generic Server connection and provide credentials there. And then reference that server in Url Resource section of JSON Call step
     
  • You can set URL in the Url section of JSON Call. In that case you have to manually supply properly encoded Authorization header. E.g. to use basic authentication, you have to provide Base64 encoded user and password. (wiki)
View original

9 replies

fbarretto
Space Explorer
Forum|alt.badge.img+3
  • Space Explorer
  • Nov 16, 2022 3:31 PM UTC

Hi @AvinashV0407 , can you share the postman request? error it shows in IDE? Even how you configured the json call request?


Forum|alt.badge.img+2
  • Ataccamer
  • Answer
  • Nov 16, 2022 4:39 PM UTC

With JSON Call you have two options:

  • Register a Generic Server connection and provide credentials there. And then reference that server in Url Resource section of JSON Call step
     
  • You can set URL in the Url section of JSON Call. In that case you have to manually supply properly encoded Authorization header. E.g. to use basic authentication, you have to provide Base64 encoded user and password. (wiki)

fbarretto
Space Explorer
Forum|alt.badge.img+3
  • Space Explorer
  • Nov 16, 2022 4:45 PM UTC

Example of generic server configuration

 


Forum|alt.badge.img+2
  • Ataccamer
  • Nov 16, 2022 4:56 PM UTC

That’s a Kafka server (you can notice Implementation field), Generic Server looks like this

 


Forum|alt.badge.img+1
  • Author
  • Data Voyager
  • Nov 17, 2022 6:42 AM UTC
Screenshots which are working in Postman.
1.Body with GraphQL Query

 

 

2.Header with authorization Details
3.After Execution Result

 


Forum|alt.badge.img+1
  • Author
  • Data Voyager
  • Nov 17, 2022 6:44 AM UTC
JSON Call Url details
​​​​​​

 

In Header provided the authorization details to connect to url

 


Forum|alt.badge.img+1
  • Author
  • Data Voyager
  • Nov 17, 2022 6:48 AM UTC

Thanks @AKislyakov and @fbarretto for the info shared.

I have tried creating connection and tried the way that I have mentioned in the above screenshots  too.

But unable to execute the input template query/mutation. Please let me know if I missed anything.


Forum|alt.badge.img+2
  • Ataccamer
  • Nov 17, 2022 7:12 AM UTC

Hi @AvinashV0407, can you please share the whole plan with JSON call (you can remove Authorization details and obscure URL) and the error details. 

Meanwhile, I noticed that you set Content-Type:application/json in JSON Call, whereas Postman uses Content-Type:application/graphql, so please check that you properly transformed the query for the JSON Call (check graphql docs for the details)


Forum|alt.badge.img+1
  • Author
  • Data Voyager
  • Nov 17, 2022 7:33 AM UTC
Postman used application/json only . will share the plan so that you can have a look.