How to submit a change comment when making a change via the Version One API?

371 views Asked by At

Say I'm creating a user or disabling a user via the API. All changes in Version One create a Moment with a change comment. How can I make my API calls submit a comment along with the API call?

For example, when creating a user, perhaps I want a comment saying "Created through automated system". When I'm using the following example to create a user:

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>
1

There are 1 answers

0
acey.bunch On BEST ANSWER

You can set the change comment for an API call by using the comment parameter in the URL of your HTTP POST.

Using your example, the URL would be like this:

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

The XML payload would be just as you have it.

Note that this also works for asset updates.