2014-11-21 46 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有效載荷將是就像你擁有它。

請注意,這也適用於資產更新。