Text analytics API

Hi,

I want to use a text analytics API like the one provided by Microsoft Azure in my script, is there a way to call an API in RPA Express, provide text to analyze, API keys etc. and get the results?

Hi @alexr.
As I know, we don’t have any samples with text analytics API. But you can try with Custom script or writing code in Code perspective in WorkFusion Studio to find your own solution.
Please see more details about Custom script here: https://kb.workfusion.com/display/RPAe/Script+as+Custom+Action

I tried using the following custom script using the AYLIEN text analytics API:

def customScript() {
def connection = new URL( “https://api.aylien.com/api/v1/sentiment”).openConnection() as HttpURLConnection

connection.setRequestProperty( ‘X-AYLIEN-TextAPI-Application-Key’, ‘//mykey’ )
connection.setRequestProperty( ‘X-AYLIEN-TextAPI-Application-ID’, ‘//myid’ )

println connection.responseCode + ": " + connection.inputStream.text
}

The call itself seems to work because when I run the script I can see that my usage statistics of AYLIEN is increasing. However I am not sure how to provide the text to analyze as input.
I attached a text file with the error I am also getting after execution if that helps.
error.txt (12.2 KB)

EDIT: Found the solution, you have to provide the input parameters in the URL itself.

1 Like