How to construct a 'thing' element for HeartRate

May 25, 2013 at 3:39 PM
Somewhere there must be some documentation/example of what the xml would look like for the heart rate measurement. I have stumbled on some stuff but not all. My current 'info' element looks as follows:
<info>
<thing>
<type-id>b81eb4a6-6eac-4292-ae93-3872d6870994</type-id>
<data-xml>
  <heartrate>
    <when>
      <date>
        <y>2013</y>
        <m>05</m>
        <d>25</d>
      </date>
      <time>
        <h>10</h>
        <m>23</m>
        <s>37</s>
        <f>0</f>
      </time>
    </when>
    <value>50</value>
    <unit>
      <text>Beats per Minute</text>
    </unit>
  </heartrate>
</data-xml>
</thing>
</info>

But this xml is being rejected. My suspicion is the <heartrate> element which was a pure guess. Anybody know what this xml should look like? (Note this is not a vital sign but the independent heart rate measurement.

Thanks!
Coordinator
Jun 11, 2013 at 11:41 PM
Hi,

The error returned from HealthVault should contain a string message telling you what went wrong. If you can use the Jaxb code, it will construct valid XML for you. I added HeartRateTest to the unit test so that you could see it. Here is some XML:
<info>
  <thing>
    <type-id>b81eb4a6-6eac-4292-ae93-3872d6870994</type-id>
    <data-xml>
      <heart-rate>
        <when>
          <date>
            <y>2013</y>
            <m>6</m>
            <d>11</d>
          </date>
          <time>
            <h>15</h>
            <m>32</m>
            <s>40</s>
            <f>556</f>
          </time>
        </when>
        <value>60</value>
      </heart-rate>
    </data-xml>
  </thing>
</info>