I’m trying to figure out how to use the HTTP Request activity. I’m trying to send out a request and get some information returned. Where in the activity would I add the request code? I have entered the endpoint, and my authorization credentials. Below is the request code I’m just not sure where or how i would add this to the http activity. Some help would be appreciated.
Install uipath.web.activities
there you can find http request activity
give the end point url
select the type of method you are using get,put post or delete
and in the headers you can give the bearer authentication token
and the parameters you can can add all the query paramerters and url parameters
Sandhy,
I have the activity, im just nor sure how to use the the code in the above thread into the activity to request that information, like I would in postman. I’m new to API calls.
I got the response using post master. the error I’m getting in the Expression Editor is "Compiler Errors encountered Processing Expression ‘}’ Expected.
Here is the code i added in the expression, they have a red dot, so maybe my code is in correct? this code works in postman when i sent it out. Is there a way to add code from a vb. net file? In postman i just imported a vb.net file that had the request code and it worked just fine.
Maciej,
Nice work! I no longer have the error, I have been battling with that issue for the last week and i was thinking that it had to be in only one line with all the research I have done. I haven’t done API calls before so this is all new. How would you suggest that I get the results once I run it? Using the Output properties of the activity. Do you have a simple workflow by any chance?
There is a Result property that returns the API call output as a string. If the string is actually a JSON file, you can parse it using the Deserialize JSON activity.
The easiest starting point is to print the Result output using a Write Line activity and go from there.
Feel free to browse other topics on how to parse the string to JSON in case it is not clear There is a lot of examples here.
This could mean that the request is not properly processed. Feel free to assign a variable to the StatusCode and print it out as well.
Even simpler, if you start a debugging with a Step Into button, you will be able to see before and after result of executing the activity. This might give you some clues as to what is going wrong here.