24-07-19 10:41 PM
Answered! Go to Answer.
02-03-21 09:12 PM
03-03-21 07:33 PM
What're you doing to try to get this to work?
To get it to work I ended up having to do a code state as shown below. I worked with the API endpoints for everything else and then created an object with multiple actions leveraging those endpoints and with one action for uploading files that used the code stage below.
var client = new RestClient("https://api.website.com/api/documents/"+documentID+"/file");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Basic "+token);
request.AddHeader("X-TR-API-APP-ID", API_Key);
request.AddFile("", File_Name);
IRestResponse response = client.Execute(request);
output=response.Content;
20-04-21 01:28 PM
20-04-21 02:27 PM
Sheela,
Is it a form you are trying to upload? Also to truly help I'd have to know how this API works, without that information I'm a little limited in how I can assist. The code I posted was for the API I used but it should function similarly to the one you're using.
If you can provide more information on the API I will be able to assist you further.
21-04-21 09:24 AM
21-04-21 09:32 AM
21-04-21 03:43 PM
21-04-21 07:18 PM
22-04-21 06:09 AM
22-04-21 02:21 PM
@SireeshaJaggems
That doesn't do much good with out information on how the API expects things.
What does the API documentation state about how you're supposed to do the upload.
If you are trying to do as I did you need to use a code section and configure it to use C#.net.
I had to create my own Object with custom actions one of those being the upload file action. I did this for all the API endpoints as it allowed me to do more than just using the API action or setting them up in BluePrism. Does this make sense?
Look beyond what they provide, create your own objects with custom actions, you'll find this works better as you can make your work easier by doing this. I have better error handling, modify JSON on the fly and don't have to recreate these every single time.