Post an update to a project or task

733 Views Asked by At

I want to post an update to a project or a task. To do this, I think that the right object type is a note, but I haven't been able to do this successfully.

I'm making a request to:

https://COMPANYNAME.attask-ondemand.com/attask/api/note?noteText=testing&objID=PROJECTID&method=POST&SESSIONID&noteObjCode=proj

but receive the following error:

{"error":{"class":"com.attask.common.InvalidParameterException","message":"Invalid Parameter: objCode value \"proj\"","title":null,"msgKey":"exception.attask","attributes":[""],"code":0}}

Am I on the right track or is there something else I need to do?

Thanks.

Joe

3

There are 3 best solutions below

1
On BEST ANSWER

Try json encoding the post data and see if that gets you a different result. Such as:

https://COMPANYNAME.attask-ondemand.com/attask/api/v4.0/note?updates={noteText=testing&objID=PROJECTID&noteObjCode=proj}&method=post&sessionID=XXXX

FYI: The v4.0 in the url is specifying the AtTask's api version if you do not have it in the url it will default to v2.0.

0
On

If you're still having the problem, the error could be as simple as "proj" being lower-case, while AtTask expects only upper-case object abbreviations. Try changing "proj" into "PROJ". We've been successful loading Notes into AtTask by providing:

noteObjCode: "PROJ", objID: "your-projectID-guid", noteText: "blah blah blah"

We were using v2.0 at the time, rather than v4.0 as John has suggested. Going forward, working with v4.0 is recommended. If you don't specify a particular version, AtTask currently defaults you to v4.0 anyway.

3
On

I am not sure of what language you are using but here is the code for PHP with the associated RESTful assertion.

$fields = array(
            "noteText" => "New Note from The API",
            "projectID" => "52d996bb00620673f2e6b00f54018e76",
            "topNoteObjCode" => "PROJ",
            "topObjID" => "52d996bb00620673f2e6b00f54018e76",
            );

$results = $client->post($objCode,$fields);

The RESTful Call:

 https://outbox.attask-ondemand.com/attask/api/v4.0/note?sessionID=XXXX&method=POST&noteText=New Note from The API&projectID=52d996bb00620673f2e6b00f54018e76&topNoteObjCode=PROJ&topObjID=52d996bb00620673f2e6b00f54018e76