Unable to make an HTTP request with a parameter named "Body"

studio
http

#1

Hi guys,

I’m trying to make an HTTP request with multiple parameters. One of them is named “Body”, this makes UiPath to raise an error : A variable, RuntimeArgument or a DelegateArgument already exists with the name ‘Body’. Names must be unique within an environment scope.

When I delete the parameter named “Body”, the error disappears.

I saw an Option of the activity named “Body”, but I need to add a parameter named “Body”.

Someone please can help me on that. Is it a bug in UiPath or is it something I’m doing wrong ?

Edit: I’m using UiPath Studio v. 2016.2.6232

Thanks.

Masiré


Activitie "Send sms message"
#2

I’m having the same issue… except, I can literally name my parameter anything and it will throw the error!

Check it out:



please help!


#3

I am experiencing a similar issue. I am attempting to POST to the Twilio API to send an SMS message. One of the required parameters is the “BODY” parameter which is actually the text to send via the SMS message.

It works fine when triggered in Preview mode through the HTTP Request wizard, but as soon as you commit the Activity it throws a configuration error and will not run.

Anyone else experienced this and have a solutions?


#4

BTW. I am using the latest 2018 release.


#5

I had this issue with “Body” trying to POST to Twilio as well and wasn’t able to get around it, so my solution was to write a Custom Activity for UiPath in C# - the instructions for doing so are here.

You’ll need Visual Studio and NuGet Package Explorer installed in order to do this.

I used this guide on Twilio as a reference for writing the code. Note, once you create the new Project in Visual Studio make sure to type “Install-Package Twilio” in the Package Manager Console, otherwise it won’t recognize the “using Twilio”.

using System;
using Twilio;
using Twilio.Rest.Api.V2010.Account;
using Twilio.Types;
using System.Activities;
using System.ComponentModel;

namespace CustomTwilio
{
    public sealed class SendSMS : CodeActivity
    {
        [Category("Input")]
        [RequiredArgument]
        public InArgument<string> To { get; set; }

        [Category("Input")]
        [RequiredArgument]
        public InArgument<string> From { get; set; }

        [Category("Input")]
        [RequiredArgument]
        public InArgument<string> Username { get; set; }

        [Category("Input")]
        [RequiredArgument]
        public InArgument<string> Password { get; set; }

        [Category("Input")]
        [RequiredArgument]
        public InArgument<string> Body { get; set; }

        protected override void Execute(CodeActivityContext context)
        {
            var to = To.Get(context);
            var from = From.Get(context);
            var username = Username.Get(context);
            var password = Password.Get(context);
            var body = Body.Get(context);

            var accountSid = username;
            var authToken = password;

            TwilioClient.Init(accountSid, authToken);

            var message = MessageResource.Create(
                to,
                from: from,
                body: body);

            Console.WriteLine(message.Sid);
        }
    }
}

I’m new to C# so please forgive any amateurness in the code.
After importing the Custom Activity, here’s what it looks like in UiPath:

twl

Hope this helps anyone who was having the same issue :grinning:


#6

Hi All,
I tried to make a HTTP request using POST method .
I have used HTTP Request wizard.
But here, my request is to pass ‘Attachment’ to the body.
When we tried to preview it , am getting the below error.
"There is already a parameter named “Abc”. Please choose a different value

Question:
How to send POST request using attachment
Kindly help me