XML support

Appendices ››
Parent Previous Next


The TidyWork Developer API is configured to understand JSON (JavaScript Object Notation). However, it will also consume and generate XML. To use XML, you only need to specify the following in the request header:

"Accept:application/xml"

And the accepted/returned data will use the XML format. For example, the following XML data structure when the "Accept:application/xml" option is specified in the request header of a method that retrieves a Time entry:

<Time xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SiliconAvenue.ProcisionPlus.WebClient.Areas.ApiV1.Models.Time">

  <ActivityCode>MEET</ActivityCode>

  <ActivityId>29477771-47ea-434a-a1e1-fff55af5e15f</ActivityId>

  <ActivityName>Meeting</ActivityName>

  <ChargeRate>70.0000</ChargeRate>

  <ChargeRateCurrencyISOCode>NZD</ChargeRateCurrencyISOCode>

  <Minutes>60</Minutes>

  <Narrative i:nil="true" />

  <ProjectCode>A0002</ProjectCode>

  <ProjectId>c7de8201-e822-460e-94fa-12c7ab80e23f</ProjectId>

  <ProjectName>SB Cabinets</ProjectName>

  <StartTime>2012-06-18T07:00:02.883</StartTime>

  <StartTimeUtc>2012-06-17T19:00:02.883</StartTimeUtc>

  <State>Approved</State>

  <TaskCompletionIndicated>false</TaskCompletionIndicated>

  <TaskId>709dbf7a-e6a5-44fa-b5f3-e4438f5b3af0</TaskId>

  <TaskName>Construction</TaskName>

  <TimeEntryId>a82a795e-dc9a-44cc-84d4-ef900f1419cc</TimeEntryId>

  <UserId>68d08e75-fb74-4386-b91c-e3b9cb2aebd9</UserId>

</Time>


If the method returns an array of Time Entries, for example, then in XML this will be

<ArrayOfTime xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SiliconAvenue.ProcisionPlus.WebClient.Areas.ApiV1.Models.Time">

  <Time>

    <ActivityCode>MAIL</ActivityCode>

    ...

    <UserId>456d4461-97c3-4f3f-963d-21ba73dc174e</UserId>

  </Time>

  <Time>

    <ActivityCode>WRITING</ActivityCode>

    ...

    <UserId>456d4461-97c3-4f3f-963d-21ba443ee234</UserId>

  </Time>

</ArrayOfTime>


For the type of data encoded for its products, TidyWork recommends use of JSON over XML, unless your programming language does not support it.