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

4

3 回答 3

1

尝试 json 编码发布数据,看看是否会得到不同的结果。如:

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

仅供参考: url 中的 v4.0 指定 AtTask 的 api 版本,如果 url 中没有它,它将默认为 v2.0。

于 2014-05-30T15:19:25.060 回答
1

如果您仍然遇到问题,错误可能很简单,就像“proj”是小写的一样,而 AtTask 只需要大写的对象缩写。尝试将“proj”更改为“PROJ”。我们通过提供以下内容成功地将 Notes 加载到 AtTask:

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

我们当时使用的是 v2.0,而不是 v4.0正如约翰建议的那样。展望未来,建议使用 v4.0。如果您没有指定特定版本,AtTask 目前默认您使用 v4.0。

于 2014-05-30T16:28:36.893 回答
0

我不确定您使用的是什么语言,但这里是 PHP 的代码以及相关的 RESTful 断言。

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

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

RESTful 调用:

 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
于 2014-05-30T05:23:53.383 回答