I’m new to working with APIs in UiPath and need some guidance on how to send a POST API request and read the response properly.
I have an API endpoint (URL), a request body (JSON), and I want to send it from UiPath using the HTTP Request activity. I’m a bit confused about where to set the URL, headers, and JSON body, and how to capture the response.
URL goes in endpoint url property.
Headers goes in header collection.
JSON body goes in body.
For response, there is an output parameter, define a variable for that and use it to capture response.
in SFTP_.xaml
at DeserializeJson`1 “Deserialize the JSON string responseString to a JObject variable named jsonResponse.”
at Sequence “Sequence”
at Flowchart “SFTP_”
at SFTP_ “SFTP_”
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path ‘’, line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at UiPath.Web.Activities.DeserializeJson`1.Execute(CodeActivityContext context)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)