2014-11-21 50 views
1

假设我正在通过API创建用户或禁用用户。版本1中的所有更改都会通过更改评论创建一个Moment。我如何使API调用与API调用一起提交注释?如何在通过Version One 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">[email protected]</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> 

回答

2

您可以通过在HTTP POST的URL中使用的注释参数设置API调用的变化发表评论。使用

您例如,URL会是这样:

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

的XML有效载荷将是就像你拥有它。

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