Call API Rest from c# script

Hi community!

How are you?

Any example for call a API Rest from c# script in a businessProcess?

 

I have a list of processes to call from a detail, one of them must call an API and process the response but I can not use the "Call Web service" element because the request needs a json structure with many nests and I can not complete it in any other way that is not a script, any suggestions?

King Regards,

 

Ezequiel

Like 0

Like

1 comments



Dear Ezequiel,

Configuring the method for "Call web service" business process parameter please use quick setup:

In this case, for example, if you provide the JSON with a nested element or even with a nested array:

The system will automatically configure correct JSON paths:

Afterward, choosing this method in "Call web service" business process parameter, you will be able to fill in any nested parameter:

The only thing that may be uncomfortable for now is that for the nested array you can fill only the first element.

In case you need to fill a bunch of the array elements please try to use any synchronous C# methods in scrip-task instead, for example, the first answer in this topic may work for you: https://stackoverflow.com/questions/9145667/how-to-post-json-to-a-server-using-c

Regards,

Anastasia

Show all comments