如何通过Version One API进行更改时提交更改注释?

时间:2014-11-21 00:07:10

标签: rest versionone

说我是通过API创建用户或禁用用户。版本1中的所有更改都会创建一个带有更改注释的时刻。如何让API调用与API调用一起提交注释?

例如,在创建用户时,或许我想要一个评论说"通过自动化系统创建"。当我使用以下示例创建用户时:

POST /VersionOne/rest-1.v1/Data/Member HTTP/1.1
Host: www14.v1host.com
Content-Type: application/xml

<Asset href="/v1sdktesting/rest-1.v1/New/Member">
    <Attribute name="Name" act="set">Andre Agile</Attribute>
    <Attribute name="Nickname" act="set">Andre</Attribute>
    <Attribute name="Username" act="set">andre.agile</Attribute>
    <Attribute name="Email" act="set">andre.agile@mailinator.com</Attribute>
    <Attribute name="IsCollaborator" act="set">false</Attribute>
    <Attribute name="NotifyViaEmail" act="set">false</Attribute>
    <Attribute name="SendConversationEmails" act="set">false</Attribute>
    <Relation name="DefaultRole" act="set">
        <Asset href="/v1sdktesting/rest-1.v1/Data/Role/4" idref="Role:4" />
    </Relation>
</Asset>

1 个答案:

答案 0 :(得分:2)

您可以使用HTTP POST的URL中的comment参数设置API调用的更改注释。

使用您的示例,URL将如下所示:

/VersionOne/rest-1.v1/Data/Member?comment=Added+from+automation

XML有效负载就像你拥有它一样。

请注意,这也适用于资产更新。

相关问题