update

Purpose

Updates an existing data record and, optionally, related records from values passed in as an XML document.

Note: Do not use this method with PHP CURL. Instead use update2

For objects in dedicated tables, you must specify the objName.

HTTP Method

PUT or POST

URL

https://app.infiniteblue.com/rest/api/update

URL Parameters

sessionId

The session ID obtained from the body of the response when calling login.

objName

The object integration name.

Request Body

XML document valid record ID, "useIds" attribute (true or false - same meaning as in the Web API) and data Fields to be updated (see example below). You only need to include the Fields that should be changed; Fields not included will remain unchanged.

Permissions Required

Edit permission for the requested object type.

Response

Standard success or failure output.

Example

Input example:

<?xml version="1.0" encoding="utf-8" ?>
        <data objName="person" id="314452" useIds="false">
        <Field name="club_member">false</Field>
        <Field name="lastName">Smith</Field>
        <Field name="status">Created</Field>
        </data>

Output example:

<resp status="ok">
        <Msg>12 fields have been processed.</Msg>
        </resp>

Like create, update can be used to update several related records in one call. To do that, include a composite XML node that wraps a set of data XML nodes with valid id attributes as described above. Records corresponding to each "data" XML node are updated. These updated nodes will have a relationship with the core record.

For objects in dedicated tables, you must specify the objName in the data XML nodes.

Consider this example with dependent nodes:

<?xml version="1.0" encoding="utf-8" ?>
<data objName="person" id="314452" useIds="false">
<Field name="club_member">false</Field>
<Field name="lastName">Smith</Field>
<Field name="status">Created</Field>
<composite>
<data objName="payment" id="314453" useIds="false">
<Field name="amount">500.00</Field>
<Field name="paym_date">09/12/2011</Field>
</data>
<data objName="payment" id="314454" useIds="false">
<Field name="amount">450.00</Field>
<Field name="paym_date">09/22/2011</Field>
</data>
</composite>
</data>

This XML updates one existing record and two related records in one call. Output example:

<resp status="ok">
<data id="314452"/>
<Msg>12 fields have been processed. 2 related records have been updated.</Msg>
</resp>