Sorry for late response. I hope ppr answered your bit
Can you try changing the name of attachments to be same as what you need and if you are attaching multiple files , then place them in different folders with same name. As arguments are having same name as filename this might suffice
thank you for your tip, I tried with calling them like you suggested.
This is what I got:
So recipient side crashed totally, not even being able to return any validation error.
I guess Freshdesk attachment logic and UiPath HTTP request activity are not compatible to each other
@Anil_G → I tried your suggestion aswell. It works with one file, but it somehow corrupts the files, if you attach more than one.
And, with your suggestion, I would completely bin all the attachment names. Which I don’t really want.
So if there is no other idea, I maybe need to use invoke code
created with the wizard. So internally it is added as Attachments to the request. we just configuren a name and a valid filepath
This will not work either.
In this example, both attachments do have the field names “CV” and “Letter” and Freshdesk will deny it.
As far as I know (and all my prior tests confirm that), all attachments have to be called “attachments”. You even need the squared brackets for all of them.
keep in mind, that internally these information will be used, post-processed and then added to the requestParameters
The name of the file is preserved after it is attached i.e the filename sent in the response will be the same as the one in the request.
yes, we have seen in their docu the curl part -F for multipart form data
in their C# example-(done for only 1 atttachment)
surprising are the same traces of question (sending multiple attachments / unique names…) when checking other resources e.g. the freshdesk forum…
Perfect as we would also recommend getting it done anyhow. Once it is confirmed that the API is working / controllable then we can do the mapping to a solution approach and also giving feedback to UiPath if there is a break within the functionalities.
For analyzing techniques also have a look here (using fiddler for request inspections) just for the idea even when the scenario was a different one
I unfortunately got no reply from FD support yet to confirm how it works.
But I tried around a bit with the API and the only way it works, is to name all attachments the same.
So I decided to go for Invoke Code and came up with this working thingy:
Dim client As System.Net.Http.HttpClient = New System.Net.Http.HttpClient()
client.BaseAddress = New Uri(EndPoint)
client.DefaultRequestHeaders.Authorization = New System.Net.Http.Headers.AuthenticationHeaderValue("Basic", auth)
Dim request As System.Net.Http.MultipartFormDataContent = New System.Net.Http.MultipartFormDataContent("----------------------------" + DateTime.Now.Ticks.ToString("x"))
request.Add(New System.Net.Http.StringContent(subject), """subject""")
request.Add(New System.Net.Http.StringContent(email), """email""")
request.Add(New System.Net.Http.StringContent(description), """description""")
request.Add(New System.Net.Http.StringContent(email_config_id), """email_config_id""")
request.Add(New System.Net.Http.StringContent("2"), """status""")
request.Add(New System.Net.Http.StringContent("1"), """priority""")
files.ForEach(Sub( f As String) request.Add(New System.Net.Http.StreamContent(System.IO.File.OpenRead(f)), "attachments", (New FileInfo(f).Name)))
Dim response As System.Net.Http.HttpResponseMessage = client.PostAsync("", request).Result
status = response.StatusCode
result = response.Content.ReadAsStringAsync.Result
So I am happy with what I have now, but the question arises, if the activity should have some rework???
@ppr - Fiddler is not an option, as we are not allowed to install such tools by our IT policy (we also do not have admin rights on our laptops).