Result XML Format - EcoSys - Customization & Programming - Hexagon PPM

EcoSys Web Service API Usage Documentation

Language
English
Product
EcoSys
Search by Category
Customization & Programming
EcoSys Version
8.7

The resulting XML document format for a REST call is as follows, assuming the API name is "SampleProject". This same format applies to object reads, object writes, and event triggers.

<SampleProjectResult

successFlag="true">

← Enclosing result tag, success flag for event triggers

<Meta>

. . .

</Meta>

← Meta data, if requested

<SampleProject>

<Attribute1>value</Attribute1>

<Attribute2>value</Attribute2>

. . .

</SampleProject>

<SampleProject>

<Attribute1>value</Attribute1>

<Attribute2>value</Attribute2>

. . .

</SampleProject>

← List of resulting objects for read requests (if any)

<ObjectResult index="0" successFlag="true" internalId="123" externalId="ABC" />

<ObjectResult index="1" successFlag="false" internalId="456" externalId="DEF" >

<ResultMessage Level="FAILURE" ReasonCode="ESRC_OBJECT_NOT_FOUND_BY_KEY">

<KeyName>Project Id "ABC"</KeyName>

<Message>Record update disallowed because

object not found by key.</Message>

</ResultMessage>

</ObjectResult>

. . .

← List of object results for write requests (if any), examples for success and non success

<Performance>

. . .

</Performance>

← Performance data, if requested

</SampleProjectResult>

← Closing result tag

The actual names of the highlighted tags will depend on the base object type for the specific API called.

For write requests (POST, PUT, PATCH, and DELETE), the resulting list corresponds one-to-one with the original input list.

Each <ObjectResult> node in the output has the following attributes:

  • index (numeric) — index into sequence of original input object list, starting with zero

  • internalId (numeric) — the internal database id for the row, if available

  • externalId (string) — the external key value for the row, if any

  • successFlag (true/false) — indicates whether the write operation was successful for this object

In addition to the attributes above, each <ObjectResult> node can have zero or more optional <ResultMessage> sub nodes. When the successFlag is False, there will be at least one ResultMessage node attached, if the succesFlag is True, there can be messages included such as warnings.

The <ResultMessage> node has the following attributes:

  • Level — one of: SUCCESS, WARN, FAILURE

  • ReasonCode — a string indicating the reason for the message. For more information, see Result Reason Codes.

The <ResultMessage> node has the following sub nodes:

  • <KeyName> — contains a human-readable identifier for the row, typically the short name/id field's value, suitable for display to an end user

  • <Message> — a description of the cause of the message or error, suitable for display to an end user

  • <Exception> (optional) — string representation of the root cause exception, if any

  • <StackTrace> (optional) — the Java stack trace of the original exception, if available