LiquidPlanner Classic Forum

Ask a Question
Back to All

Updating Field for Projects c#

(edited)

Posted on behalf of Alexm. Original posting date 2016-07-18.

Hi,

I am trying to update the field "external_referance" on existing projects.

The method that i use to do this is:

public Project UpdateProjectWithExternalReference(Project project)
        {
            uRLBuilder.Append("/workspaces/");
            uRLBuilder.Append(workspaceId);
            uRLBuilder.Append("/projects/");
            uRLBuilder.Append(project.id);
            uRLBuilder.Append("/update_external_reference");

            return GetObject<Project>(put(uRLBuilder.ToString(), new {project = project }));c

When i run this code i get a 404 error;

I have also tried:

public Project UpdateProjectWithExternalReference(Project project)

    {
        uRLBuilder.Append("/workspaces/");
        uRLBuilder.Append(workspaceId);
        uRLBuilder.Append("/projects/");
        uRLBuilder.Append(project.id);
        uRLBuilder.Append("/update_external_reference");

        return GetObject<Project>(put(uRLBuilder.ToString(), new {external_reference = project.external_reference }));

    }

and i get the same 404 (the remote server returned an error) message.

And finally i have tried:

public Project UpdateProjectWithExternalReference(Project project)

    {
        uRLBuilder.Append("/workspaces/");
        uRLBuilder.Append(workspaceId);
        uRLBuilder.Append("/projects/");
        uRLBuilder.Append(project.id);

        return GetObject<Project>(put(uRLBuilder.ToString(), new {external_reference = project.external_reference }));

    }

and

public Project UpdateProjectWithExternalReference(Project project)

    {
        uRLBuilder.Append("/workspaces/");
        uRLBuilder.Append(workspaceId);
        uRLBuilder.Append("/projects/");
        uRLBuilder.Append(project.id);

        return GetObject<Project>(put(uRLBuilder.ToString(), new {project = project}));

    }
 

Both of these return 400 Bad request errors.

 I would also like to mention that the GetObject<t>() and put() methods are exactly as they are in the example hyperlinked above.

Any assistance would be appreciated.

Thanks