POST api/devices/fitness/sync/scale/{id}

Sync user body analysis data from fitness devices to Lifetrons server

Request Information

URI Parameters

NameDescriptionTypeAdditional information
id

object representing logged in userid that need to sync fitness data.

integer

Required

Body Parameters

object representing scale data that need sync.

ScaleDataReq
NameDescriptionTypeAdditional information
Lifetrons_device_id

Lifetrons device id created by Lifetrons

string

None.

scale

full body analysis data

Collection of ScaleData

Required

Request Formats

application/json, text/json

Sample:
{
  "Lifetrons_device_id": "sample string 1",
  "scale": [
    {
      "log_id": 1,
      "user_id": 2,
      "weight": 3.0,
      "BMI": 4.0,
      "BMR": 5.0,
      "fat_mass": 6.0,
      "fat_mass_kg": 7.0,
      "muscle_mass": 8.0,
      "muscle_mass_percent": 9.0,
      "hydration": 10.0,
      "hydration_kg": 11.0,
      "visceral_fat": 12.0,
      "bone_mass": 13.0,
      "metabolic_age": 14.0,
      "date_of_activity": 15.1,
      "is_uploaded": 16,
      "protein": 17.0,
      "protein_kg": 18.0,
      "subcutaneous_fat": "sample string 19",
      "skeletal_muscle_kg": 20.0,
      "skeletal_muscle_percent": 21.0,
      "device_id": "sample string 22",
      "subcutaneous_fat_kg": 23.0,
      "subcutaneous_fat_percent": 24.0,
      "date_of_birth": 1.1,
      "height": 1.1,
      "gender": "sample string 26"
    },
    {
      "log_id": 1,
      "user_id": 2,
      "weight": 3.0,
      "BMI": 4.0,
      "BMR": 5.0,
      "fat_mass": 6.0,
      "fat_mass_kg": 7.0,
      "muscle_mass": 8.0,
      "muscle_mass_percent": 9.0,
      "hydration": 10.0,
      "hydration_kg": 11.0,
      "visceral_fat": 12.0,
      "bone_mass": 13.0,
      "metabolic_age": 14.0,
      "date_of_activity": 15.1,
      "is_uploaded": 16,
      "protein": 17.0,
      "protein_kg": 18.0,
      "subcutaneous_fat": "sample string 19",
      "skeletal_muscle_kg": 20.0,
      "skeletal_muscle_percent": 21.0,
      "device_id": "sample string 22",
      "subcutaneous_fat_kg": 23.0,
      "subcutaneous_fat_percent": 24.0,
      "date_of_birth": 1.1,
      "height": 1.1,
      "gender": "sample string 26"
    }
  ]
}

application/xml, text/xml

Sample:
<ScaleDataReq xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.RequestAgg">
  <Lifetrons_device_id>sample string 1</Lifetrons_device_id>
  <scale xmlns:d2p1="http://schemas.datacontract.org/2004/07/CommonClasses.devices">
    <d2p1:scale_data>
      <d2p1:BMI>4</d2p1:BMI>
      <d2p1:BMR>5</d2p1:BMR>
      <d2p1:bone_mass>13</d2p1:bone_mass>
      <d2p1:date_of_activity>15.1</d2p1:date_of_activity>
      <d2p1:date_of_birth>1.1</d2p1:date_of_birth>
      <d2p1:device_id>sample string 22</d2p1:device_id>
      <d2p1:fat_mass>6</d2p1:fat_mass>
      <d2p1:fat_mass_kg>7</d2p1:fat_mass_kg>
      <d2p1:gender>sample string 26</d2p1:gender>
      <d2p1:height>1.1</d2p1:height>
      <d2p1:hydration>10</d2p1:hydration>
      <d2p1:hydration_kg>11</d2p1:hydration_kg>
      <d2p1:is_uploaded>16</d2p1:is_uploaded>
      <d2p1:log_id>1</d2p1:log_id>
      <d2p1:metabolic_age>14</d2p1:metabolic_age>
      <d2p1:muscle_mass>8</d2p1:muscle_mass>
      <d2p1:muscle_mass_percent>9</d2p1:muscle_mass_percent>
      <d2p1:protein>17</d2p1:protein>
      <d2p1:protein_kg>18</d2p1:protein_kg>
      <d2p1:skeletal_muscle_kg>20</d2p1:skeletal_muscle_kg>
      <d2p1:skeletal_muscle_percent>21</d2p1:skeletal_muscle_percent>
      <d2p1:subcutaneous_fat>sample string 19</d2p1:subcutaneous_fat>
      <d2p1:subcutaneous_fat_kg>23</d2p1:subcutaneous_fat_kg>
      <d2p1:subcutaneous_fat_percent>24</d2p1:subcutaneous_fat_percent>
      <d2p1:user_id>2</d2p1:user_id>
      <d2p1:visceral_fat>12</d2p1:visceral_fat>
      <d2p1:weight>3</d2p1:weight>
    </d2p1:scale_data>
    <d2p1:scale_data>
      <d2p1:BMI>4</d2p1:BMI>
      <d2p1:BMR>5</d2p1:BMR>
      <d2p1:bone_mass>13</d2p1:bone_mass>
      <d2p1:date_of_activity>15.1</d2p1:date_of_activity>
      <d2p1:date_of_birth>1.1</d2p1:date_of_birth>
      <d2p1:device_id>sample string 22</d2p1:device_id>
      <d2p1:fat_mass>6</d2p1:fat_mass>
      <d2p1:fat_mass_kg>7</d2p1:fat_mass_kg>
      <d2p1:gender>sample string 26</d2p1:gender>
      <d2p1:height>1.1</d2p1:height>
      <d2p1:hydration>10</d2p1:hydration>
      <d2p1:hydration_kg>11</d2p1:hydration_kg>
      <d2p1:is_uploaded>16</d2p1:is_uploaded>
      <d2p1:log_id>1</d2p1:log_id>
      <d2p1:metabolic_age>14</d2p1:metabolic_age>
      <d2p1:muscle_mass>8</d2p1:muscle_mass>
      <d2p1:muscle_mass_percent>9</d2p1:muscle_mass_percent>
      <d2p1:protein>17</d2p1:protein>
      <d2p1:protein_kg>18</d2p1:protein_kg>
      <d2p1:skeletal_muscle_kg>20</d2p1:skeletal_muscle_kg>
      <d2p1:skeletal_muscle_percent>21</d2p1:skeletal_muscle_percent>
      <d2p1:subcutaneous_fat>sample string 19</d2p1:subcutaneous_fat>
      <d2p1:subcutaneous_fat_kg>23</d2p1:subcutaneous_fat_kg>
      <d2p1:subcutaneous_fat_percent>24</d2p1:subcutaneous_fat_percent>
      <d2p1:user_id>2</d2p1:user_id>
      <d2p1:visceral_fat>12</d2p1:visceral_fat>
      <d2p1:weight>3</d2p1:weight>
    </d2p1:scale_data>
  </scale>
</ScaleDataReq>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

On success, Lifetrons response codes On failure, Lifetrons response codes

SyncDataResp
NameDescriptionTypeAdditional information
log_data

list of data synced to user

Collection of LogData

None.

resp_code

Lifetrons response code

string

None.

resp_msg

Lifetrons response message

string

None.

Response Formats

application/json, text/json

Sample:
{
  "log_data": [
    {
      "log_id": 1,
      "date_of_activity": 2.1,
      "data_type": "sample string 3"
    },
    {
      "log_id": 1,
      "date_of_activity": 2.1,
      "data_type": "sample string 3"
    }
  ],
  "resp_code": "sample string 1",
  "resp_msg": "sample string 2"
}

application/xml, text/xml

Sample:
<sync_data_resp xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.ResponseAgg.v5">
  <resp_code xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Models">sample string 1</resp_code>
  <resp_msg xmlns="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Models">sample string 2</resp_msg>
  <log_data xmlns:d2p1="http://schemas.datacontract.org/2004/07/LifetronsPhoneApi.Domain.DeviceAgg">
    <d2p1:log_data>
      <d2p1:data_type>sample string 3</d2p1:data_type>
      <d2p1:date_of_activity>2.1</d2p1:date_of_activity>
      <d2p1:log_id>1</d2p1:log_id>
    </d2p1:log_data>
    <d2p1:log_data>
      <d2p1:data_type>sample string 3</d2p1:data_type>
      <d2p1:date_of_activity>2.1</d2p1:date_of_activity>
      <d2p1:log_id>1</d2p1:log_id>
    </d2p1:log_data>
  </log_data>
</sync_data_resp>