WEB Rest POST API 16.3

Hi all,

for a project we need to implement an integration to a POST API that need to be used in order to retrive a list of data that need to be showed into an interface.

Since I don't have experiences with 16.3 version, anyone that can suggest me in which way I can perform this?

Thanks

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Hi Peter,

    first of all, really thanks for you suggestion.
    I tried in this way but I don't understand how to use it into the process model in order to store the response of the API.

    I tried also the following:

    a!httpQuery(
    url: "URL",
    method: "HEAD",
    headers:{
    a!httpHeader(
    name: "Content-Type",
    value: "application/json"
    )
    }
    )

    but unfortunately it seems that we cannot use POST with this httpQuery function.

    Can I ask you if you have a snippet or some example that can clarify better how to configure it and save the response into the process model?

  • Oh sorry my mistake - I forgot that you can't use a!httpQuery() for a POST (you must use a process model in this case). The best way to do this is to set up your http query in a process to run first. Then, save the results into a process variable and pass the variable as an input to your form. Here's an example of how I'd suggest setting it up (ignore the deprecated node - yours should display correctly in 16.3):

    You must use activity chaining to query the data first using this node. Then, save the output of the HTTP Query into a process variable that you can reference in your interface. Note: you might need to use a function like a!fromJson() if your response body is JSON.