Mautic Community Forums

Rest Api Contact Stage Change Problem

Hi

I am using Mautic rest api on a .net project. Everything works except updating stages. I use an url like this

Code:
https://MY_URL/api/stages/4/contact/add/4065?access_token=MY_TOKEN
. It returns
Code:
"success": 1
, but update does not happen. I share the piece of the code that I use also.
Code:
string apiResult = "";
        MauticContact mauticContact = GetContactByEmail(contactEmail);
        MauticStage mauticStage = GetStageByName(stageName);

        string uri = _mauticBaseUri + _apiUri + "/stages/" + mauticStage.Id + "/contact/" + "add"+ mauticContact.Id;

#if NET461
using (WebClient client = new WebClient())
{
byte[] response =
client.UploadValues(uri, new NameValueCollection()
{
{ “access_token”, _token}
});

            apiResult = System.Text.Encoding.UTF8.GetString(response);
        }

#endif

As I said before apiResult is
Code:
"success": 1
but nothing happens.

Hi
I am using Mautic rest api on a .net project. Everything works except updating stages. I use an url like this https://MY_URL/api/stages/4/contact/add/4065?access_token=MY_TOKEN . It returns "success": 1, but update does not happen. I share the piece of the code that I use also.

            string apiResult = "";

            MauticContact mauticContact = GetContactByEmail(contactEmail);
            MauticStage mauticStage = GetStageByName(stageName);

            string uri = _mauticBaseUri + _apiUri + "/stages/" + mauticStage.Id + "/contact/" + "add"+ mauticContact.Id;
#if NET461
            using (WebClient client = new WebClient())
            {
                byte[] response =
                client.UploadValues(uri, new NameValueCollection()
                {
                { "access_token", _token}
                });

                apiResult = System.Text.Encoding.UTF8.GetString(response);
            }
#endif

As I said before apiResult is "success": 1 but nothing happens.