POST api/devices/fitness/sync/scale/{id}
Sync user body analysis data from fitness devices to Lifetrons server
Request Information
URI Parameters
| Name | Description | Type | Additional 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| Name | Description | Type | Additional 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| Name | Description | Type | Additional information |
|---|---|---|---|
| log_data |
list of data synced to user |
Collection of LogData |
None. |
| id_key_map |
id key map data |
Collection of IdKeyMappingDto |
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"
}
],
"id_key_map": [
{
"temp_id": 1,
"new_id": 2,
"key": "sample string 3",
"entity_type": "sample string 4"
},
{
"temp_id": 1,
"new_id": 2,
"key": "sample string 3",
"entity_type": "sample string 4"
}
],
"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>
<id_key_map>
<IdKeyMappingDto>
<entity_type>sample string 4</entity_type>
<key>sample string 3</key>
<new_id>2</new_id>
<temp_id>1</temp_id>
</IdKeyMappingDto>
<IdKeyMappingDto>
<entity_type>sample string 4</entity_type>
<key>sample string 3</key>
<new_id>2</new_id>
<temp_id>1</temp_id>
</IdKeyMappingDto>
</id_key_map>
<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>