2

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 Answers3

1

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.

Jim Young
  • 169
  • 2
1

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.

Chris Reid
  • 11
  • 1
0

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
jclawton
  • 241
  • 1
  • 2
  • Thanks very much, I am using python, with the following code: update = AtTaskObject(client.post(ObjCode.NOTE,{'noteText':'Good stuff', "entryDate": "$$TODAY", 'projectID':myproj.ID, 'topNoteObjCode': ObjCode.PROJECT, 'topObjID': myproj.ID })) The url ends up like: – user3689503 May 30 '14 at 11:50
  • URL looks like: https://CO.attask-ondemand.com/attask/api/note?topObjID=5386de9d002f2863449cXXXXX&projectID=5386de9d002f2863449cXXXXX&noteText=Good+stuff&sessionID=YYYYY&topNoteObjCode=proj&method=POST I note there is no v4.0 in my url, but adding it manually does not seem to have changed anythin – user3689503 May 30 '14 at 11:55
  • The v4.0 makes the call version safe to the fourth version of the API. Not required, but it is more safe. I updated the response and removed the entryDate. It is set by the system and therefore causes an error. – jclawton May 30 '14 at 15:26