Hi,


I'm setting up a simple integration with a google api https://developers.google.com/knowledge-graph/:

It's a get operation with URL parameters. Something like this: https://kgsearch.googleapis.com/v1/entities:search?query={INPUT}&key={KEY}


I'm able to call it successfully on:

  • Service Studio "Consume API" pop up (and use the response to create the output struct).
  • In my laptop's browser/postman
  • Inside my on-premises machine where outsystems server is running


When I call the api operation from a screen action I'm getting a 404 Not Found error.

If I go to service center - monitor - integration and copy the URL from the log it works when I call it as described above.




Also tested on my personal cloud and have the same problem so it doesn't look like an infrastructure issue.


Any ideas?


Thank you and best regards

Hi Hugo,

404 is resource not found. It has nothing to do with infrastructure/server.

Check the formation of URL from screen action. Most likely the dynamically generated URL is malformed.

Regards,

Swatantra

Swatantra Kumar wrote:

Hi Hugo,

404 is resource not found. It has nothing to do with infrastructure/server.

Check the formation of URL from screen action. Most likely the dynamically generated URL is malformed.

Regards,

Swatantra

Thank you.


If I use the url from the logs outside the flow it works.

I've also tested removing the parameters and hardcode them in the URL in the operation definition and I get the same error.


Hi Hugo,

Can you try Base64 encoding url and check. Hope It will help.


Thanks

Dileep

Hi, 

Could be that the search is not returning anything and the Api is using the 404 to indicate it? This is very common in Rest services. 

You can increase log level or add an OnAfterResponse so you can check the answer in runtime. 

Cheers 

Hugo, increase the logging verbosity and indicate the response headers.

Also, check the API treatment towards CORS possibility, that also returns 404. 

Solution

Hi all


Thank you for your replies.


I found the issue and was able to workaround it.


The API URL path contains a ":" - /v1/entities:search

It was being replaced by the HEX code %3A that wasn't being recognized by the API. For now I'm replacing it in onBeforeRequest action with the ":" and I'm getting the expected response,


Best regards

Solution

Hugo, that's malformation of URL. Special chars manipulated the original URL, hence 404.