1

I have my JSON string which contains the parameter I want to Update

var oCreateTaskParameter = JSON.stringify
(
 {
  "parameters":
     {   
       "Custom_x005f_5ef4c0a0aaa1e61180cc00155d302506": "Testing"
     }
 }
);

Below is my Ajax Query

$.ajax({
url:'<<site url>>/sites/pwa/_api/ProjectServer/Projects(<<guid>>)/Draft/Tasks/GetById(<<guid>>)',
type: "POST",
 contentType: "application/json;odata=verbose",
    data: oCreateTaskParameter,
   headers: {
             "accept": "application/json;odata=verbose",
             "content-type": "application/json;odata=verbose",
             "X-RequestDigest": '<<Request Digest>>'
            },
 success:function(data){

},
error:function(data){
console.log(data);
},
async:false
});

But i get an error as "The parameter parameters does not exist in method GetById"

I am sending the parameters parameter, can anyone tell me what i am doing wrong here?

dsouzajoel22
  • 111
  • 1
  • 5

1 Answers1

0

It looks like the endpoint you are using only supports GET (as noted here), and will just retrieve the content of a DraftTask. I think you'll want to use the MERGE verb with this URL:

http://<sitecollection>/<site>/_api/ProjectServer/Projects('projectid')/Draft/Tasks('taskid')

Documentation is here.

Jon Iles
  • 2,519
  • 1
  • 20
  • 30